summary refs log tree commit diff
path: root/src/comp/syntax
AgeCommit message (Collapse)AuthorLines
2012-01-19Additional ; to , changes, disable "tag" and ";" in parser. Close #1430. ↵Graydon Hoare-1/+1
Close #1428.
2012-01-19rustc: Stop parsing "tag"Patrick Walton-2/+2
2012-01-19rustc: Make the pretty printer output commas after enum variants. Update all ↵Patrick Walton-1/+1
tests accordingly.
2012-01-19rustc: Fix fun_to_strBrian Anderson-0/+14
2012-01-19rustc: ";" to "," in enumsPatrick Walton-264/+264
2012-01-19rustc: Fix long linesPatrick Walton-2/+2
2012-01-19rustc: "tag" -> "enum"Patrick Walton-60/+60
2012-01-19Rename fn*() to fn() as originally planned.Niko Matsakis-8/+10
2012-01-19treat fn*() as fn&()Niko Matsakis-8/+2
This is not my ideal way of going about things. I'd prefer not to have expressions typed as fn*(), for example, but I couldn't get that to work together with inferring the modes of arguments and other corner cases.
2012-01-19Remove support for the '.' after a nullary tag in a patternTim Chevalier-18/+14
(Commit also includes lots of changes to remove '.'s that a git merge messed up, or else it was monkeys.)
2012-01-18Remove '.' after nullary tags in patternsTim Chevalier-340/+340
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-55/+59
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-43/+8
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-16Be more careful about pretty-printing literalsMarijn Haverbeke-12/+19
Before, literal printing would basically get derailed completely when a literal was encountered that did not end up being printed. This caused the strangeness seen in #1532. Also cleans up pretty-printing of discriminants a little. Closes #1510 Closes #1532
2012-01-16Update pretty printer to print out disr. values.Kevin Atkinson-0/+8
Partly fixes issue #1510. "rustc --pretty=typed" fails.
2012-01-16Properly print u suffix for uint literalsMarijn Haverbeke-1/+1
Issue #1532
2012-01-15rustc: Parse fn inner attributes. Closes #1506Brian Anderson-30/+109
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-10/+22
2012-01-13rustc: Replace parser's error handling with diagnostic implBrian Anderson-9/+10
2012-01-13rustc: Extract driver::diagnostic from syntax::codemapBrian Anderson-137/+7
2012-01-13rustc: Some more codemap refactoringBrian Anderson-74/+67
2012-01-13rustc: Refactor codemap::emit_* functionsBrian Anderson-24/+25
A codemap is only needed when we have a span so put them both into the option.
2012-01-13Change builtin macro defs to use #macro()Graydon Hoare-4/+4
2012-01-13distinguish "any closure" and "stack closure" (block)Niko Matsakis-15/+23
2012-01-13make blocks fn& and fn stand for "any closure"Niko Matsakis-16/+20
2012-01-13make "native fn" the type for bare functions, remove fn exprsNiko Matsakis-4/+11
2012-01-13deprecate fn exprs and the fn() type, preferring fn@ and native fnNiko Matsakis-25/+36
2012-01-13Obj system? What obj system?Marijn Haverbeke-251/+10
Removes the obj system from the compiler. Closes #1484
2012-01-13Remove all remaining uses of objs from the compilerMarijn Haverbeke-202/+207
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-12Make driver::session::session no longer an objectMarijn Haverbeke-5/+5
Rather, it is now a struct where properties like opts are accessed directly, and the error-reporting methods are part of a static impl (with the same name as the type).
2012-01-12Cleanups to previous commits for issue #1393.Kevin Atkinson-3/+5
2012-01-11Major clean-up of std::ioMarijn Haverbeke-14/+15
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-11add a log_str() function and allow '%?' in fmt strings to use itNiko Matsakis-0/+2
2012-01-10Fold and re-evaluate expr in tag discriminant.Graydon Hoare-4/+17
2012-01-10Support explicit discriminant numbers on tag variants.Kevin Atkinson-4/+46
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-4/+5
2012-01-10replace lambda with fn@Niko Matsakis-1/+5
2012-01-10rename sendfn to fn~, lambda to fn@Niko Matsakis-13/+16
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