about summary refs log tree commit diff
path: root/src/comp/syntax/parse
AgeCommit message (Collapse)AuthorLines
2012-01-18Remove '.' after nullary tags in patternsTim Chevalier-123/+123
Does what it says on the tin. The next commit will remove support for this syntax.
2012-01-18Allow any alternative (not just a block) to follow a nullary tag patternTim Chevalier-3/+1
2012-01-18allow dotless nullary patterns inside or-patternsTim Chevalier-1/+2
2012-01-18Another minor parser fix for nullary-tag patternsTim Chevalier-1/+1
2012-01-18Allow nullary tag names to be qualifiedTim Chevalier-3/+2
2012-01-18rustc: Assert that the parser doesn't assign node id 0Brian Anderson-0/+2
It is reserved for indicating the crate, but doesn't exist in the AST
2012-01-18rustc: Accept commas to separate tag variantsPatrick Walton-3/+12
2012-01-17Allow omission of the '.' after nullary tag patternsTim Chevalier-6/+23
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-16Don't evaluate discriminator value constants when parsing.Kevin Atkinson-27/+2
Remove disr_val from ast::variant_ and always use ty::variant_info when the value is needed. Move what was done during parsing into other passes, primary typeck.rs. This move also correctly type checks the disr. value expression; thus, fixing rustc --pretty=typed when disr. values are used.
2012-01-15rustc: Parse fn inner attributes. Closes #1506Brian Anderson-29/+96
2012-01-15rustc: Extract comman parts of view parsingBrian Anderson-7/+13
2012-01-13rustc: Rename the lexer's err message to fatal and make it failBrian Anderson-17/+12
2012-01-13rustc: Replace the lexer's error handling with diagnostic implBrian Anderson-8/+18
2012-01-13rustc: Replace parser's error handling with diagnostic implBrian Anderson-9/+10
2012-01-13rustc: Extract driver::diagnostic from syntax::codemapBrian Anderson-5/+7
2012-01-13rustc: Refactor codemap::emit_* functionsBrian Anderson-7/+6
A codemap is only needed when we have a span so put them both into the option.
2012-01-13distinguish "any closure" and "stack closure" (block)Niko Matsakis-10/+10
2012-01-13make blocks fn& and fn stand for "any closure"Niko Matsakis-14/+17
2012-01-13deprecate fn exprs and the fn() type, preferring fn@ and native fnNiko Matsakis-2/+13
2012-01-13Obj system? What obj system?Marijn Haverbeke-77/+7
Removes the obj system from the compiler. Closes #1484
2012-01-13Convert the objects used in the lexer and parser to records + implsMarijn Haverbeke-484/+435
2012-01-12make parser disambiguate fn~ at top level correctlyNiko Matsakis-1/+12
2012-01-12Cleanups to previous commits for issue #1393.Kevin Atkinson-2/+2
2012-01-11Major clean-up of std::ioMarijn Haverbeke-0/+1
Use ifaces instead of objs, stop wrapping everything in two (or three) layers of no-value-added indirection, and remove some of the more pointless/outdated idioms from the code.
2012-01-10Fold and re-evaluate expr in tag discriminant.Graydon Hoare-1/+1
2012-01-10Support explicit discriminant numbers on tag variants.Kevin Atkinson-2/+41
Addresses issue #1393. For now disallow disr. values unless all variants use nullary contractors (i.e. "enum-like"). Disr. values are now encoded in the crate metadata, but only when it will differ from the inferred value based on the order.
2012-01-10rustc: Accept "enum" in addition to "tag"Patrick Walton-2/+3
2012-01-10replace lambda with fn@Niko Matsakis-1/+5
2012-01-10rename sendfn to fn~, lambda to fn@Niko Matsakis-7/+10
2012-01-09Remove support for 'when' in alt-patterns from parserAustin Seipp-5/+1
Issue #1396
2012-01-09Change all uses of 'when' in alt-patterns to 'if'Austin Seipp-4/+4
Issue #1396
2012-01-09Remove proto_sugar and 'lambda' as keyword, commit to fn@.Graydon Hoare-6/+6
2012-01-09Make the parser accept 'if' as an alternative to 'when' in alt patterns.Austin Seipp-1/+5
Also fix the pretty printer, making it output 'if' instead of 'when'. Issue #1396
2012-01-05require a non-semi expr acting as a stmt to have unit return typeNiko Matsakis-13/+14
2012-01-05make parser handle parenthesized block-sugar exprs properlyNiko Matsakis-49/+80
2012-01-05Switch to new param kind bound syntaxMarijn Haverbeke-10/+8
And remove support for the old syntax
2012-01-05Fix bad spans for ast::ty parsingMarijn Haverbeke-9/+6
The span would be pointing after the actual text.
2012-01-03Allow tail expressions even in no_value blocks. Type checkerNiko Matsakis-28/+16
will guarantee they have unit type.
2012-01-03extend parser so that expressions that do not require semi-colonsNiko Matsakis-2/+2
to be statements are not considered expressions in the tail position
2012-01-03rewrite to put blk as 2nd argNiko Matsakis-1/+1
2012-01-03minimal changes to permit fn blocks in exprNiko Matsakis-68/+64
2012-01-03Make syntax for impls less magicalMarijn Haverbeke-23/+18
The trick of interpreting parameters to the iface type as parameters to the impl was just too magical. Issue #1227
2011-12-29split proto from fn_decl, as not all fn_decls know the proto.Niko Matsakis-38/+21
this will address the (crashing) new test added.
2011-12-29Add support in lexer for utf8 identifiers. No NFKC logic in char yet.Graydon Hoare-2/+4
2011-12-28Change representation of type params to handle interface boundsMarijn Haverbeke-5/+14
Issue #1227
2011-12-23Check impls methods against the type of their iface.Marijn Haverbeke-8/+8
2011-12-23Parse `iface` items and interface references in `impl` items.Marijn Haverbeke-56/+61
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-8/+1
2011-12-22Register new snapshots, purge log_err and log_full in favour of log(...).Graydon Hoare-9/+5
2011-12-22Merge all 3 log syntaxes, tidy up residual misuses.Graydon Hoare-11/+6