diff options
Diffstat (limited to 'sources/scalac')
-rw-r--r-- | sources/scalac/ast/parser/Parser.java | 22 | ||||
-rw-r--r-- | sources/scalac/ast/parser/Scanner.java | 4 | ||||
-rw-r--r-- | sources/scalac/ast/parser/Tokens.java | 14 |
3 files changed, 26 insertions, 14 deletions
diff --git a/sources/scalac/ast/parser/Parser.java b/sources/scalac/ast/parser/Parser.java index 518ded67e6..6481ac730e 100644 --- a/sources/scalac/ast/parser/Parser.java +++ b/sources/scalac/ast/parser/Parser.java @@ -144,7 +144,7 @@ public class Parser implements Tokens { switch (s.token) { case CHARLIT: case INTLIT: case LONGLIT: case FLOATLIT: case DOUBLELIT: case STRINGLIT: - case SYMBOLLIT: case NULL: case IDENTIFIER: + case SYMBOLLIT: case TRUE: case FALSE: case NULL: case IDENTIFIER: case THIS: case SUPER: case IF: case FOR: case NEW: case USCORE: case LPAREN: case LBRACE: @@ -193,6 +193,10 @@ public class Parser implements Tokens { return make.Select(pos, make.Ident(pos, Names.scala), name); } + Tree scalaBooleanDot(int pos, Name name) { + return make.Select(pos, scalaDot(pos, Names.Boolean), name); + } + /** Create tree for for-comprehension <for (enums) do body> or * <for (enums) yield body> where mapName and flatmapName are chosen * corresponding to whether this is a for-do or a for-yield. @@ -452,6 +456,12 @@ public class Parser implements Tokens { case STRINGLIT: t = make.Literal(s.pos, s.name.toString()); break; + case TRUE: + t = scalaBooleanDot(s.pos, Names.True); + break; + case FALSE: + t = scalaBooleanDot(s.pos, Names.False); + break; case NULL: t = make.Ident(s.pos, Names.null_); break; @@ -774,6 +784,8 @@ public class Parser implements Tokens { case DOUBLELIT: case STRINGLIT: case SYMBOLLIT: + case TRUE: + case FALSE: case NULL: t = literal(false); break; @@ -943,12 +955,10 @@ public class Parser implements Tokens { new Tree.CaseDef[]{ (CaseDef)make.CaseDef( rhs.pos, pat.duplicate(), Tree.Empty, - make.Select(rhs.pos, - scalaDot(rhs.pos, Names.Boolean), Names.True)), + scalaBooleanDot(rhs.pos, Names.True)), (CaseDef)make.CaseDef( rhs.pos, make.Ident(rhs.pos, Names.WILDCARD), Tree.Empty, - make.Select(rhs.pos, - scalaDot(rhs.pos, Names.Boolean), Names.False))})}); + scalaBooleanDot(rhs.pos, Names.False))})}); return make.PatDef(pos, 0, pat, rhs); } @@ -1012,6 +1022,8 @@ public class Parser implements Tokens { case DOUBLELIT: case STRINGLIT: case SYMBOLLIT: + case TRUE: + case FALSE: case NULL: return literal(true); case LPAREN: diff --git a/sources/scalac/ast/parser/Scanner.java b/sources/scalac/ast/parser/Scanner.java index a86014d650..82eef0d408 100644 --- a/sources/scalac/ast/parser/Scanner.java +++ b/sources/scalac/ast/parser/Scanner.java @@ -791,18 +791,18 @@ public class Scanner extends TokenData { enterKeyword("final", FINAL); enterKeyword("private", PRIVATE); enterKeyword("protected", PROTECTED); - enterKeyword("qualified", QUALIFIED); enterKeyword("override", OVERRIDE); enterKeyword("var", VAR); enterKeyword("def", DEF); enterKeyword("type", TYPE); enterKeyword("extends", EXTENDS); - enterKeyword("let", LET); enterKeyword("module", MODULE); enterKeyword("class",CLASS); enterKeyword("constr",CONSTR); enterKeyword("import", IMPORT); enterKeyword("package", PACKAGE); + enterKeyword("true", TRUE); + enterKeyword("false", FALSE); enterKeyword(".", DOT); enterKeyword("_", USCORE); enterKeyword(":", COLON); diff --git a/sources/scalac/ast/parser/Tokens.java b/sources/scalac/ast/parser/Tokens.java index 2fa82eb5f3..10503ddd48 100644 --- a/sources/scalac/ast/parser/Tokens.java +++ b/sources/scalac/ast/parser/Tokens.java @@ -42,13 +42,13 @@ public interface Tokens { FINAL = 32, PRIVATE = 33, PROTECTED = 34, - QUALIFIED = 35, - OVERRIDE = 36, - VAR = 37, - DEF = 38, - TYPE = 39, - EXTENDS = 40, - LET = 41, + OVERRIDE = 35, + VAR = 36, + DEF = 37, + TYPE = 38, + EXTENDS = 39, + TRUE = 40, + FALSE = 41, MODULE = 43, CLASS = 44, CONSTR = 45, |