about summary refs log tree commit diff
path: root/src/comp/syntax/fold.rs
AgeCommit message (Collapse)AuthorLines
2011-12-16reorder args to the various vec, option fns so blk comes lastNiko Matsakis-47/+47
2011-12-16Make polymorphic impl methods workMarijn Haverbeke-1/+2
Something will still have to be done to the AST to make it possible to say `x.foo::<int>()`, since currently field access never allows type parameters. Issue #1227
2011-12-16Change syntax for implMarijn Haverbeke-2/+2
Move the name of the bundle to the front, allow type parameters (not handled yet), and add a 'for' keyword: impl utils for int { fn str() -> str { int::str(self) } fn times(f: block()) { ... } }
2011-12-16Make uses of self in impls compileMarijn Haverbeke-1/+0
Get rid of expr_self_call, introduces def_self. `self` is now, syntactically, simply a variable. A method implicitly brings a `self` binding into scope. Issue #1227
2011-12-16Parse and resolve implementations.Marijn Haverbeke-0/+4
Issue #1227
2011-12-14first attempt, not happy with itNiko Matsakis-1/+2
2011-12-13Copy first batch of material from libstd to libcore.Graydon Hoare-1/+1
2011-12-08Allow binding of nested patternsMarijn Haverbeke-1/+3
See src/test/run-pass/nested-patterns.rs for some examples. The syntax is boundvar@subpattern Which will match the subpattern as usual, but also bind boundvar to the whole matched value. Closes #838
2011-12-07Remove stmt_crate_directive, it's vestigial and confusing.Graydon Hoare-4/+1
2011-11-30Box ast::path valuesMarijn Haverbeke-4/+4
It seems inefficient to copy them around. Let's measure whether that's actually > the case
2011-11-24rustc: Add a path attribute for crate directivesHaitao Li-4/+4
The path information was an optional "filename" component of crate directive AST. It is now replaced by an attribute with metadata named "path". With this commit, a directive mod foo = "foo.rs"; should be written as: #[path = "foo.rs"] mod foo; Closes issue #906.
2011-11-23Allow import directives in any blockMarijn Haverbeke-1/+2
Closes #49
2011-11-23Remove last traces of auth keywordMarijn Haverbeke-1/+0
The reference now has an empty hole where the auth keyword used to be. Changing the keyword table seems to require manually sorting the keywords and putting them back into some kind of arcane interleaved order. I'll open an issue to actually fix this. Closes #1211
2011-11-21rustc: Remove abi from ast::native_modHaitao Li-2/+1
2011-11-17remove compile-command from local variable blocksNiko Matsakis-1/+0
2011-11-16Use attributes for native module ABI and link nameHaitao Li-2/+1
This patch changes how to specify ABI and link name of a native module. Before: native "cdecl" mod llvm = "rustllvm" {...} After: #[abi = "cdecl"] #[link_name = "rustllvm"] native mod llvm {...} The old optional syntax for ABI and link name is no longer supported. Fixes issue #547
2011-11-16rustc: Use link_name attribute for native functionHaitao Li-3/+2
Fixes issue #906
2011-10-21Remove hack to break the AST fold cycle. Closes #998Brian Anderson-38/+2
2011-10-21Change the way block calls are parsed, mark them as block-calls.Marijn Haverbeke-2/+3
This makes it possible to omit the semicolon after the block, and will cause the pretty-printer to properly print such calls (if pretty-printing of blocks wasn't so broken). Block calls (with the block outside of the parentheses) can now only occur at statement level, and their value can not be used. When calling a block-style function that returns a useful value, the block must be put insde the parentheses. Issue #1054
2011-10-21Drop support for iter, put, and for-eachMarijn Haverbeke-5/+0
Closes #1056
2011-10-20Make fn denote a bare function. Convert fn to fn@ as neededBrian Anderson-77/+80
2011-10-10Adjust function signatures to allow for vecs being immediateMarijn Haverbeke-5/+5
Some code was relying on vectors being implicitly by-reference (as non-immediate value). This adds the necessary &&-sigils. Closes #1021
2011-10-07Give up on providing a by-value version of map, convert fold over toMarijn Haverbeke-78/+76
passing pointers by ref Issue #1008
2011-10-07Parse and typecheck by-value and by-ref arg specsMarijn Haverbeke-31/+31
Add sprinkle && throughout the compiler to make it typecheck again. Issue #1008
2011-09-28Revert "Revert "Implement pattern ranges for all numeric types.""Brian Anderson-0/+1
This reverts commit a034f87146e60e1db2327c6f6807c47406a1bb0b. Conflicts: src/comp/middle/check_alt.rs src/comp/middle/trans_alt.rs src/comp/syntax/ast.rs src/comp/syntax/ast_util.rs src/comp/syntax/fold.rs src/comp/syntax/print/pprust.rs Conflicts: src/comp/middle/trans_alt.rs
2011-09-23Begin to support pattern matching on unique boxesBrian Anderson-0/+1
Issue #409
2011-09-21Revert "Implement pattern ranges for all numeric types."Marijn Haverbeke-1/+0
This reverts commit ce0f054f9d56df4e60291fc2e1b89ce979cf374f.
2011-09-21Implement pattern ranges for all numeric types.Josh Matthews-0/+1
2011-09-20Represent unique creation as a unop in the AST instead of its own exprBrian Anderson-1/+0
Like the box unop. Issue #409
2011-09-19Break fold's circular reference during unwindingBrian Anderson-2/+7
This converts the AST fold into a resource that breaks it's own circular reference (just a temporary workaround until GC), so that failure during fold will unwind correctly. Issue #936
2011-09-15Add representation for by-ref let bindingsMarijn Haverbeke-1/+4
Issue #918
2011-09-12Factor imports mindlessly.Graydon Hoare-2/+1
2011-09-12Reformat for new mode syntax, step 1Marijn Haverbeke-131/+129
Long lines were fixed in a very crude way, as I'll be following up with another reformat in a bit.
2011-09-10Fuzzer: move tys around in addition to exprsJesse Ruderman-0/+1
2011-08-25Support unchecked blocksTim Chevalier-1/+2
This patch supports the syntax unchecked { ... } to disable purity checking within a block. Presumably it will only be used within a declared "pure fn". However, there is no checking that it doesn't occur elsewhere, and it would be harmless for it to do so. I went with Lindsey's suggestion for the syntax, but it's subject to change. This allows you to write code that uses predicates that call arbitrary Rust functions, but you must declare your intentions by wrapping it in an unchecked { ... } block. The test case run-pass/unchecked-predicates.rs demonstrates how to do that.
2011-08-22Implement pattern guardsMarijn Haverbeke-1/+3
The syntax is alt x { mypat where mycond { ... } } The condition may refer to any of the variables bound by the pattern. When a guard fails, pattern-matching continues with the next pattern. Closes #857
2011-08-22Drop arguments on the caller side, not the calleeMarijn Haverbeke-1/+0
This makes it easier for the caller to optimize the take/drop away for temporary values, and opens up new possibilities for alias handling. Breaks tail calls.
2011-08-20ReformatBrian Anderson-81/+77
This changes the indexing syntax from .() to [], the vector syntax from ~[] to [] and the extension syntax from #fmt() to #fmt[]
2011-08-18Remove seq_kind from ast::expr_vecBrian Anderson-2/+2
2011-08-18Remove or _-prefix all unused function argumentsMarijn Haverbeke-26/+26
This should make the compilation process a bit less noisy.
2011-08-16Port the compiler to the expr foo::<T> syntax.Erick Tryzelaar-3/+3
2011-08-16Port the compiler to foo<T> decl syntax.Erick Tryzelaar-1/+1
2011-08-16Port the compiler to the typaram foo<T> syntax.Erick Tryzelaar-1/+1
2011-08-16Removing tasks, ports and chans from the compiler.Eric Holk-14/+0
2011-08-16Rename std::ivec to std::vecBrian Anderson-34/+34
2011-08-15The wonky for...in... whitespace was bothering me. Sorry!Lindsey Kuper-1/+1
2011-08-15Add operator 'copy', translates as fall-through.Graydon Hoare-0/+3
2011-08-15Use span stacks to track macro expansion for less troublesome error messages.Paul Stansifer-20/+30
2011-08-15Rename a field (so that macros can mention it).Paul Stansifer-1/+1
2011-08-15Change `node_id`s when expanding, to avoid duplicates.Paul Stansifer-8/+19