Skip to content

Parser is a bit too tolerant after multi-word keywords #830

@AltGr

Description

@AltGr

Fun fact: space is not mandatory after multi-word keywords. For example, this is accepted:

declaration scope Foo:
  output f content integer depends onx content integer

scope Foo under conditiontrue:
  definition f of x equals 0

normally, this is refused because there is an ambiguity between identifier and keyword, that is solved by being greedy, so definitionfoo is lexed as an identifier. Here, because of the space within the keyword, we no longer have this ambiguity (or rather, it's hidden behind a different branch : keywords are not a subset or identifiers)

This is not critical, but can be surprising, and could lead to breakages later on if unnoticed in the code and we fix the bug.

Metadata

Metadata

Assignees

Labels

❓ invalidThis doesn't seem right🔧 compilerIssue concerns the compiler

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions