You can use double quote when defining a concept name to protect keyword
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user