You can use double quote when defining a concept name to protect keyword

This commit is contained in:
2020-09-22 10:00:18 +02:00
parent dd520c1680
commit 310c9ae839
2 changed files with 18 additions and 15 deletions
+6 -1
View File
@@ -312,7 +312,12 @@ class DefaultParser(BaseParser):
if TokenKind.NEWLINE in [t.type for t in name_tokens]:
self.add_error(SyntaxErrorNode(tokens_found_by_parts[Keywords.CONCEPT], "Newline are not allowed in name."))
name_node = NameNode(name_tokens[name_first_token_index:]) # skip the first token
tokens = name_tokens[name_first_token_index:]
stripped = core.utils.strip_tokens(tokens)
if len(stripped) == 1 and stripped[0].type == TokenKind.STRING and stripped[0].value[0] == '"':
tokens = list(Tokenizer(stripped[0].strip_quote, yield_eof=False))
name_node = NameNode(tokens) # skip the first token
return name_node
def get_concept_definition(self, current_concept_def, tokens_found_by_parts):