Translate literal int, char, bool and str types, as well as logging them.
This commit is contained in:
parent
fbea4d04b7
commit
11e72fd4e0
2 changed files with 95 additions and 20 deletions
|
|
@ -150,6 +150,10 @@ state fn parse_lit(parser p) -> @ast.lit {
|
|||
p.bump();
|
||||
ret @ast.lit_bool(b);
|
||||
}
|
||||
case (token.LIT_STR(?s)) {
|
||||
p.bump();
|
||||
ret @ast.lit_str(s);
|
||||
}
|
||||
}
|
||||
p.err("expected literal");
|
||||
fail;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue