summary refs log tree commit diff
path: root/src/comp/syntax/visit.rs
AgeCommit message (Collapse)AuthorLines
2012-01-19rustc: ";" to "," in enumsPatrick Walton-6/+6
2012-01-19rustc: "tag" -> "enum"Patrick Walton-3/+3
2012-01-18Remove '.' after nullary tags in patternsTim Chevalier-9/+9
Does what it says on the tin. The next commit will remove support for this syntax.
2012-01-17Allow omission of the '.' after nullary tag patternsTim Chevalier-1/+5
This commit allows patterns like: alt x { some(_) { ... } none { } } without the '.' after none. The parser suspends judgment about whether a bare ident is a tag or a new bound variable; instead, the resolver disambiguates. This means that any code after resolution that pattern-matches on patterns needs to call pat_util::normalize_pat, which consults an environment to do this disambiguation. In addition, local variables are no longer allowed to shadow tag names, so this required changing some code (e.g. renaming variables named "mut", and renaming ast::sub to subtract). The parser currently accepts patterns with and without the '.'. Once the compiler and libraries are changed, it will no longer accept the '.'.
2012-01-13deprecate fn exprs and the fn() type, preferring fn@ and native fnNiko Matsakis-15/+15
2012-01-13Obj system? What obj system?Marijn Haverbeke-33/+0
Removes the obj system from the compiler. Closes #1484
2012-01-09Remove proto_sugar and 'lambda' as keyword, commit to fn@.Graydon Hoare-1/+1
2012-01-05require a non-semi expr acting as a stmt to have unit return typeNiko Matsakis-0/+1
2012-01-04Add visit_ty_params to visit.rsMarijn Haverbeke-7/+16
And use it to make typechecking of bounds less error-prone.
2011-12-29split proto from fn_decl, as not all fn_decls know the proto.Niko Matsakis-28/+49
this will address the (crashing) new test added.
2011-12-28Change representation of type params to handle interface boundsMarijn Haverbeke-7/+26
Issue #1227
2011-12-23Go back to a single visit_fn function in visit.rsMarijn Haverbeke-49/+21
2011-12-23Get rid of visit_fn_block in visit.rsMarijn Haverbeke-23/+2
It seems redundant and error-prone.
2011-12-23Parse `iface` items and interface references in `impl` items.Marijn Haverbeke-2/+9
The (temporary) syntax is iface seq<T> { fn len() -> uint; fn iter(f: block(T)); } // The 'blah<T>' can be left of to default the name of the // impl to seq<T>. The 'of seq<T>' can be left off when // not implementing a named interface. impl blah<T> of seq<T> for [T] { fn len() -> uint { vec::len(self) } fn iter(f: block(T)) { for x in self { f(x); } } }
2011-12-23Make ast::ty_method hold a fn_decl, rather than duplicating its fieldsMarijn Haverbeke-2/+2
2011-12-22Unify some data structures in syntax::ast that were doing the same thingMarijn Haverbeke-31/+34
As a preparation to removing some duplication in typeck.
2011-12-21Switch log_expr to carrying a full expr:u32 for level. Add log_full variant ↵Graydon Hoare-1/+4
that parses that expr, prepare for snapshot.
2011-12-21upgrade kind checkNiko Matsakis-0/+1
2011-12-21Make { || ... } sugar for any type of closure, inferredNiko Matsakis-22/+75
2011-12-19Add type argument field to expr_pathMarijn Haverbeke-1/+4
This way, you can explicitly provide type parameters when calling a generic method. Issue #1227
2011-12-16Make polymorphic impl methods workMarijn Haverbeke-6/+6
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/+1
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-3/+16
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-2/+2
2011-12-08Allow binding of nested patternsMarijn Haverbeke-2/+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-1/+0
2011-12-07Change literal representation to not truncateMarijn Haverbeke-14/+1
Also shuffles around the organization of numeric literals and types, separating by int/uint/float instead of machine-vs-non-machine types. This simplifies some code. Closes #974 Closes #1252
2011-11-30Box ast::path valuesMarijn Haverbeke-7/+7
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-2/+2
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-22Make ast::visit only descend into types when necessaryMarijn Haverbeke-3/+12
If visit_ty is not overridden, it uses a stub function which does not descend into types. Closes #1204
2011-11-17remove compile-command from local variable blocksNiko Matsakis-1/+0
2011-11-16rustc: Use link_name attribute for native functionHaitao Li-1/+1
Fixes issue #906
2011-10-21Change the way block calls are parsed, mark them as block-calls.Marijn Haverbeke-1/+1
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-2/+1
Closes #1056
2011-10-20Make fn denote a bare function. Convert fn to fn@ as neededBrian Anderson-56/+56
2011-10-07Parse and typecheck by-value and by-ref arg specsMarijn Haverbeke-14/+14
Add sprinkle && throughout the compiler to make it typecheck again. Issue #1008
2011-09-23Add missing case for pat_uniq to syntax::visitBrian Anderson-0/+1
Issue #409
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-20Parse unique box typesBrian Anderson-0/+1
Issue #409
2011-09-15Add representation for by-ref let bindingsMarijn Haverbeke-1/+1
Issue #918
2011-09-12Factor imports mindlessly.Graydon Hoare-2/+1
2011-09-12Reformat for new mode syntax, step 1Marijn Haverbeke-83/+83
Long lines were fixed in a very crude way, as I'll be following up with another reformat in a bit.
2011-09-02Rename ty_istr to ty_str. Issue #855Brian Anderson-1/+1
2011-09-01Remove lots of estr code from rustc. Issue #855Brian Anderson-1/+0
2011-08-30Stop relying on klunky hack in alias.rsMarijn Haverbeke-1/+1
It assumed node_ids increased monotonically for locals, but macros make this no longer the case, and it was a dubious assumption anyway. It now numbers locals itself and uses that to determine which precede which.
2011-08-22Implement pattern guardsMarijn Haverbeke-0/+1
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