Teach front-end about simple, first-cut version of const items.

This commit is contained in:
Graydon Hoare 2010-09-14 10:52:32 -07:00
parent 43ec78636f
commit 7287d3aaa0
10 changed files with 46 additions and 0 deletions

View file

@ -137,6 +137,7 @@ fn new_reader(stdio_reader rdr, str filename) -> reader
keywords.insert("export", token.EXPORT());
keywords.insert("let", token.LET());
keywords.insert("const", token.CONST());
keywords.insert("log", token.LOG());
keywords.insert("spawn", token.SPAWN());

View file

@ -103,6 +103,7 @@ tag token {
/* Value / stmt declarators */
LET();
CONST();
/* Magic runtime services */
LOG();
@ -261,6 +262,7 @@ fn to_str(token t) -> str {
/* Value / stmt declarators */
case (LET()) { ret "let"; }
case (CONST()) { ret "const"; }
/* Magic runtime services */
case (LOG()) { ret "log"; }