Added keyword c:xxx: to express that we want the concept, not its body

This commit is contained in:
2019-12-29 18:56:41 +01:00
parent 81b2355633
commit 197b0700fa
9 changed files with 191 additions and 65 deletions
+12
View File
@@ -55,3 +55,15 @@ def test_i_can_detect_error():
assert isinstance(res.value, ParserResultConcept)
assert isinstance(res.value.value[0], PythonErrorNode)
assert isinstance(res.value.value[0].exception, SyntaxError)
def test_i_can_parse_a_concept():
text = "c:concept_name: + 1"
parser = PythonParser()
res = parser.parse(get_context(), text)
assert res
assert res.value.value == PythonNode(
"c:concept_name: + 1",
ast.parse("__C__concept_name__C__+1", mode="eval"))