Implemented FunctionParser

This commit is contained in:
2020-09-17 14:11:09 +02:00
parent 8a866880bc
commit 177a6b1d5f
40 changed files with 1752 additions and 561 deletions
+1 -14
View File
@@ -1,5 +1,5 @@
import pytest
from core.tokenizer import Tokenizer, Token, TokenKind, LexerError, Keywords
from core.tokenizer import Tokenizer, Token, TokenKind, LexerError
def test_i_can_tokenize():
@@ -156,19 +156,6 @@ def test_i_can_parse_numbers(text):
assert tokens[0].value == text
@pytest.mark.parametrize("text, expected", [
("def", Keywords.DEF),
("concept", Keywords.CONCEPT),
("as", Keywords.AS),
("pre", Keywords.PRE),
("post", Keywords.POST)
])
def test_i_can_recognize_keywords(text, expected):
tokens = list(Tokenizer(text))
assert tokens[0].type == TokenKind.KEYWORD
assert tokens[0].value == expected
@pytest.mark.parametrize("text, expected", [
("c:key:", ("key", None)),
("c:key|id:", ("key", "id")),