From e53f559f361d94822eb27cfdc97413ba14610949 Mon Sep 17 00:00:00 2001 From: Eatswap Date: Sat, 10 Dec 2022 21:04:44 +0800 Subject: [PATCH] add: more token --- DragonLisp.l | 6 ++++++ DragonLisp.y | 6 ++++++ token.h | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/DragonLisp.l b/DragonLisp.l index d01a6bb..3c20fe1 100644 --- a/DragonLisp.l +++ b/DragonLisp.l @@ -48,6 +48,12 @@ print (print|PRINT) loop (loop|LOOP) setq (setq|SETQ) quote (quote|QUOTE) +for (for|FOR) +in (in|IN) +from (from|FROM) +to (to|TO) +dotimes (dotimes|DOTIMES) +dolist (dolist|DOLIST) defconstant (defconstant|DEFCONSTANT) %% diff --git a/DragonLisp.y b/DragonLisp.y index 788935d..fbe0d89 100644 --- a/DragonLisp.y +++ b/DragonLisp.y @@ -75,6 +75,12 @@ namespace DragonLisp { LOOP "loop" SETQ "setq" QUOTE "quote" + FOR "for" + IN "in" + FROM "from" + TO "to" + DOTIMES "dotimes" + DOLIST "dolist" DEFCONSTANT "defconstant" ; diff --git a/token.h b/token.h index f176d6f..0e4be3a 100644 --- a/token.h +++ b/token.h @@ -41,6 +41,12 @@ enum Token { LOOP, SETQ, QUOTE, + FOR, + IN, + FROM, + TO, + DOTIMES, + DOLIST, DEFCONSTANT, };