From 62f8e8640926b88201e6d33c4fe0a7c5abd2c08a Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sat, 14 Aug 2021 16:43:48 +0200 Subject: [PATCH] Improved language design --- src/cc_lang/model/language_definition.py | 2 ++ src/lexer/model/token_value_types.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/cc_lang/model/language_definition.py b/src/cc_lang/model/language_definition.py index 7fe6ed6..ba51750 100644 --- a/src/cc_lang/model/language_definition.py +++ b/src/cc_lang/model/language_definition.py @@ -18,6 +18,7 @@ class LanguageDefinition: Keywords.Length.value, Keywords.Range.value, Keywords.Exit.value, + Keywords.ForEach.value, # normal keywords Keywords.If.value, Keywords.ElseIf.value, @@ -28,6 +29,7 @@ class LanguageDefinition: # loops Keywords.While.value, Keywords.For.value, + Keywords.Foreach.value, # access Keywords.Public.value, Keywords.This.value diff --git a/src/lexer/model/token_value_types.py b/src/lexer/model/token_value_types.py index 70dc45b..8713c28 100644 --- a/src/lexer/model/token_value_types.py +++ b/src/lexer/model/token_value_types.py @@ -16,6 +16,7 @@ class Keywords(Enum): Length = 'length' Range = 'range' Exit = 'exit' + ForEach = 'forEach' # normal keywords If = 'if' @@ -28,6 +29,7 @@ class Keywords(Enum): # loops While = 'while' For = 'for' + Foreach = 'foreach' # access Public = 'public'