82 Commits

Author SHA1 Message Date
Margaret Meyerhofer
4f10c19215 Merge branch 'master' of git://github.com/mozilla/rust 2012-05-22 18:23:32 -07:00
Margaret Meyerhofer
507b8e5ae0 cleaned up debugging code 2012-05-22 18:13:24 -07:00
Margaret Meyerhofer
3177286a24 Changed the pretty printer also read #! comments 2012-05-22 17:49:16 -07:00
Margaret Meyerhofer
f1cea3ce21 Changed the lexer to accept #! comments on the first line. 2012-05-22 17:27:20 -07:00
Michael Sullivan
15cef374b9 Get rid of the >>> operator and make >> logical or arithmetic depending on the signedness. Closes #2417. 2012-05-22 14:59:15 -07:00
Paul Stansifer
f2ad7c3426 do is no longer a keyword 2012-05-22 11:20:23 -07:00
Niko Matsakis
0f969da882 port some code to use dvec 2012-05-18 20:00:50 -07:00
Brian Anderson
cb6ed42717 core: Generalize uint-string conversions to all uint types
Issue #2239
2012-05-15 22:50:35 -07:00
Lindsey Kuper
b8880e3254 Remove be keyword.
Closes #2227.
2012-05-15 10:41:14 -07:00
Tim Chevalier
5428a22b95 First cut at dtors for classes
Classes with dtors should compile now. Haven't yet tested
whether they actually run correctly.

Beginnings of support for #2295, though that won't be done until
there's more test cases and resources are removed.
2012-05-14 14:26:10 -07:00
Paul Stansifer
13c924c049 Remove do { ... } while ... from the language. 2012-05-10 15:09:33 -07:00
Marijn Haverbeke
96a159a6ea Support visibility modifiers and attributes on view items
Issue #1893
Tangentially, issue #2357
2012-05-08 23:14:24 +02:00
Marijn Haverbeke
5c0577f233 Import ast::* in parser.rs
And make the code look a lot less awkward.
2012-05-08 16:09:40 +02:00
Marijn Haverbeke
b619954457 Start parsing pub/priv on regular items
Issue #1893
2012-05-08 16:09:40 +02:00
Marijn Haverbeke
df3bf7c2a0 parser: Consolidate some duplicated code 2012-05-08 16:09:40 +02:00
Niko Matsakis
8a9df5aa38 make it illegal to implicitly capture mutable variables
this is the final part of #1273
2012-05-07 13:22:42 -07:00
Niko Matsakis
50ec6bd2c3 new cap clause syntax 2012-05-04 12:33:08 -07:00
Niko Matsakis
cfa09d35a3 Revert "allow fn exprs to omit arg types"
This reverts commit 1ba4ca4c4a0153578e812baf5f7f5554d079de40.
2012-05-03 14:42:34 -07:00
Niko Matsakis
1ba4ca4c4a allow fn exprs to omit arg types
also, avoid using type variables for fn args with omitted types
unless necessary.  This will be important for bound regions in
fn types.

fixes #2093
2012-05-03 14:32:32 -07:00
Niko Matsakis
2db4259b35 Stop inferring bot/static when types/regions are unconstrained.
Also, some other changes that came up along the way:
- add a 'blk' region for the current block.
- detect unused type/region variables.
2012-04-30 19:53:02 -07:00
Tim Chevalier
85fbfa25d7 Revert "Eliminate a copy in syntax::parse::new_parser_from_file"
This reverts commit 2bb3b63ec4379b812aeceb690d78763ec55d3cbb.

(I was confused.)
2012-04-30 11:52:07 -07:00
Tim Chevalier
2bb3b63ec4 Eliminate a copy in syntax::parse::new_parser_from_file
Fixing a FIXME turned out to be pretty involved. I added an io function
that returns a unique boxed string (for the contents of a file) rather than
a string, and went from there. Also made the src field of codemap a unique
boxed string. This doesn't seem to make that much difference in amount of
allocation according to valgrind (disappointingly), but I also had to introduce
a copy somewhere else pending a new snapshot, so maybe that's it.
2012-04-30 10:44:31 -07:00
Brian Anderson
5eca3c2210 parser: More refactoring of restricted value name checking 2012-04-27 16:45:54 -07:00
Brian Anderson
21dc41649b parser: Remove a restricted keyword check
I can't find a way to trigger this error
2012-04-27 16:45:54 -07:00
Brian Anderson
48368c5a07 test: Add test for two restricted keyword cases 2012-04-27 16:45:54 -07:00
Brian Anderson
bde5a842ce parser: Make parse_value_path use parse_value_ident 2012-04-27 16:45:54 -07:00
Brian Anderson
8ab9efe262 parser: Rewrite parse_path_without_tps so it knows beforehand which is the last ident
Needed to centralize all keyword-as-value parsing in parse_value_ident
2012-04-27 16:45:54 -07:00
Brian Anderson
beece25abe parser: Fix lookahead of > 1 token 2012-04-27 16:45:54 -07:00
Brian Anderson
345a21916c syntax: Refactor ident parsing 2012-04-27 16:45:54 -07:00
Tim Chevalier
8e15640ada Refactor operator precedence code
Use functions instead of a dynamically created table to determine
operator precedence. Gets rid of a FIXME in syntax::parse::prec.
Change precedences from int to uint while we're at it, since
don't use negative precedences.
2012-04-26 16:16:18 -07:00
Niko Matsakis
825fd1808e lots of work to make iface/impls parameterized by regions
- paths can now take region parameters, replacing the dirty hack
  I was doing before of abusing vstores.  vstores are now a bit
  of a hack though.

- fix various small bugs:
  - we never checked that iface types were compatible when casting
    to an iface with `as`
  - we allowed nonsense like int<int>
  - and more! (actually that may be it)
2012-04-25 19:26:56 -07:00
Brian Anderson
c9e3f387f4 syntax: Divide keywords into contextual/restricted. No bad words 2012-04-24 22:58:00 -07:00
Brian Anderson
08d0707556 syntax: Make 'true' and 'false' bad words
When these are idents they are always shadowed by the boolean
constants.
2012-04-24 22:00:32 -07:00
Brian Anderson
98ac8d4625 syntax: Clean up the bad_expr_word functions 2012-04-24 21:12:16 -07:00
Brian Anderson
7ee90cc7be syntax: Rename is_word to is_keyword, etc. 2012-04-24 21:08:49 -07:00
Tim Chevalier
f7641286b2 Allow classes to be cast to ifaces that are in the same crate
I had to xfail one existing test case (class-implements-int) because,
I think, of the same bug described in #2272.
2012-04-23 21:15:03 -07:00
Tim Chevalier
1c39fda0ea Rename option::get_or_default to get_default, for consistency 2012-04-23 20:52:50 -07:00
Marijn Haverbeke
9053f54498 Move map iface over to more for-friendly iteration methods 2012-04-23 15:18:19 +02:00
Marijn Haverbeke
a872a99bfe Simplify representation of ast::path 2012-04-23 13:04:46 +02:00
Brian Anderson
512927573e syntax: Replace token::DOLLAR_PAREN, DOLLAR_NUM with just DOLLAR
Figure the rest out in the parser
2012-04-22 17:24:49 -07:00
Brian Anderson
7321c17171 syntax: Eliminate token::POUND_LT, POUND_LBRACE
Use lookahead in the parser
2012-04-22 15:19:14 -07:00
Brian Anderson
92b2113583 syntax: Move is_lit to mod token 2012-04-22 14:59:04 -07:00
Brian Anderson
fa86b5d67f syntax: Remove unused BRACEQUOTE, IDX, LIT_BOOL tokens 2012-04-22 14:58:10 -07:00
Brian Anderson
7235f3cee2 syntax: Eliminate 'mutable' keyword. Closes #2254 2012-04-21 14:27:20 -07:00
Tim Chevalier
37b0549730 Add new syntax for patterns that match the head constructor only
Adds a new kind of pattern C(*) where C is a constructor that may
have any number of fields. This pattern matches any value
constructed with C, without binding names for any of the fields.

Closes #1701.
2012-04-20 00:56:46 -07:00
Brian Anderson
7fa7e56341 syntax: Move fn spanned into ast_util 2012-04-19 21:58:45 -07:00
Brian Anderson
bcbcbad774 syntax: Extract some functions into mod common 2012-04-19 21:58:45 -07:00
Brian Anderson
628e80d525 syntax: Extract attribute parsing to its own mod 2012-04-19 21:58:45 -07:00
Niko Matsakis
3d6c79109e update syntax to include a slash 2012-04-19 21:01:11 -07:00
Niko Matsakis
3c995fb8f3 make nominal types optionally parameterized by a self region.
Issue #2201.
2012-04-19 21:01:11 -07:00