summary refs log tree commit diff
path: root/src/comp/syntax/print
AgeCommit message (Collapse)AuthorLines
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-8/+8
2012-01-19rustc: "tag" -> "enum"Patrick Walton-6/+6
2012-01-19Rename fn*() to fn() as originally planned.Niko Matsakis-1/+1
2012-01-19Remove support for the '.' after a nullary tag in a patternTim Chevalier-13/+13
(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-61/+61
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-3/+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-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-15rustc: Parse fn inner attributes. Closes #1506Brian Anderson-1/+13
2012-01-13rustc: Replace the lexer's error handling with diagnostic implBrian Anderson-2/+4
2012-01-13distinguish "any closure" and "stack closure" (block)Niko Matsakis-5/+6
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-6/+6
2012-01-13Obj system? What obj system?Marijn Haverbeke-76/+0
Removes the obj system from the compiler. Closes #1484
2012-01-13Remove all remaining uses of objs from the compilerMarijn Haverbeke-157/+156
2012-01-11Major clean-up of std::ioMarijn Haverbeke-11/+10
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-10rustc: Accept "enum" in addition to "tag"Patrick Walton-2/+2
2012-01-10rename sendfn to fn~, lambda to fn@Niko Matsakis-2/+2
2012-01-09Remove proto_sugar and 'lambda' as keyword, commit to fn@.Graydon Hoare-2/+1
2012-01-09Make the parser accept 'if' as an alternative to 'when' in alt patterns.Austin Seipp-1/+1
Also fix the pretty printer, making it output 'if' instead of 'when'. Issue #1396
2012-01-06Fix pretty-printing of ty params in iface methodsMarijn Haverbeke-3/+5
2012-01-05fix pretty printer to correctly insert parens for disambNiko Matsakis-35/+5
2012-01-05require a non-semi expr acting as a stmt to have unit return typeNiko Matsakis-0/+5
2012-01-05make parser handle parenthesized block-sugar exprs properlyNiko Matsakis-32/+34
2012-01-03Allow tail expressions even in no_value blocks. Type checkerNiko Matsakis-2/+30
will guarantee they have unit type.
2011-12-30add cap clause to pretty printer, with a testNiko Matsakis-2/+34
2011-12-29split proto from fn_decl, as not all fn_decls know the proto.Niko Matsakis-9/+11
this will address the (crashing) new test added.
2011-12-28Change representation of type params to handle interface boundsMarijn Haverbeke-6/+12
Issue #1227
2011-12-23Parse `iface` items and interface references in `impl` items.Marijn Haverbeke-10/+28
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-14/+10
2011-12-22Register new snapshots, purge log_err and log_full in favour of log(...).Graydon Hoare-2/+2
2011-12-22Merge all 3 log syntaxes, tidy up residual misuses.Graydon Hoare-6/+6
2011-12-22Merge branch 'master' of github.com:graydon/rustGraydon Hoare-37/+37
2011-12-22Register snapshots and switch logging over to use of log_full or #error / ↵Graydon Hoare-22/+22
#debug.
2011-12-22Unify some data structures in syntax::ast that were doing the same thingMarijn Haverbeke-37/+37
As a preparation to removing some duplication in typeck.
2011-12-21More flailing on log syntax due to call-expr ambiguity in previous attempt.Graydon Hoare-1/+5
2011-12-21Switch log_expr to carrying a full expr:u32 for level. Add log_full variant ↵Graydon Hoare-6/+13
that parses that expr, prepare for snapshot.
2011-12-21update pprinter to understand ret type of block, add warningsNiko Matsakis-0/+5
2011-12-21Make { || ... } sugar for any type of closure, inferredNiko Matsakis-18/+13
2011-12-19Add type argument field to expr_pathMarijn Haverbeke-1/+6
This way, you can explicitly provide type parameters when calling a generic method. Issue #1227
2011-12-18Only look for a matching method when normal field access failsMarijn Haverbeke-5/+3
We should probalby warn when defining a method foo on {foo: int} etc. This should reduce the amount of useless typevars that are allocated. Issue #1227
2011-12-16Change syntax for implMarijn Haverbeke-9/+6
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-4/+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/+16
Issue #1227
2011-12-14change syntax from lambda[send] to sendfnNiko Matsakis-1/+1
2011-12-14push changes through to get things compiling, if not running.Niko Matsakis-0/+1
2011-12-14first attempt, not happy with itNiko Matsakis-1/+1
2011-12-13Copy first batch of material from libstd to libcore.Graydon Hoare-2/+4