about summary refs log tree commit diff
path: root/users/fcuny
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--users/fcuny/exp/monkey/pkg/token/token.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/users/fcuny/exp/monkey/pkg/token/token.go b/users/fcuny/exp/monkey/pkg/token/token.go
index 6937595..a211c55 100644
--- a/users/fcuny/exp/monkey/pkg/token/token.go
+++ b/users/fcuny/exp/monkey/pkg/token/token.go
@@ -24,8 +24,14 @@ const (
 	LBRACE = "{"
 	RBRACE = "}"
 
+	// The following tokens are keywords
 	FUNCTION = "FUNCTION"
 	LET      = "LET"
+	TRUE     = "TRUE"
+	FALSE    = "FALSE"
+	IF       = "IF"
+	ELSE     = "ELSE"
+	RETURN   = "RETURN"
 
 	// The following tokens are for operators
 	ASSIGN   = "="
@@ -40,8 +46,13 @@ const (
 
 // List of our keywords for the language
 var keywords = map[string]TokenType{
-	"fn":  FUNCTION,
-	"let": LET,
+	"fn":     FUNCTION,
+	"let":    LET,
+	"true":   TRUE,
+	"false":  FALSE,
+	"if":     IF,
+	"else":   ELSE,
+	"return": RETURN,
 }
 
 // LookupIdent returns the token type for a given identifier.