diff --git a/SMILEBASIC/parser.d b/SMILEBASIC/parser.d index 8a91c80..47dc00f 100644 --- a/SMILEBASIC/parser.d +++ b/SMILEBASIC/parser.d @@ -75,6 +75,7 @@ class Lexical reserved["TRUE"] = TokenType.True; reserved["FALSE"] = TokenType.False; reserved["CALL"] = TokenType.Call; + reserved["COMMON"] = TokenType.Common; reserved.rehash(); } this(wstring input) @@ -526,7 +527,20 @@ class Parser { auto token = lex.front(); Statement statement; - if(token.type == TokenType.Def) + if(token.type == TokenType.Common) + { + lex.popFront(); + token = lex.front(); + if (token.type != TokenType.Def) + { + syntaxError(); + } + else + { + statement = defineFunction(); + } + } + else if(token.type == TokenType.Def) { statement = defineFunction(); } diff --git a/SMILEBASIC/token.d b/SMILEBASIC/token.d index 35277f3..d32fd20 100644 --- a/SMILEBASIC/token.d +++ b/SMILEBASIC/token.d @@ -68,6 +68,7 @@ enum TokenType Use, Exec, Call, + Common, } struct Token