diff --git a/grammar/tatsu.ebnf b/grammar/tatsu.ebnf index a70e42fc..32dac162 100644 --- a/grammar/tatsu.ebnf +++ b/grammar/tatsu.ebnf @@ -65,7 +65,7 @@ keywords keyword = - '@@keyword' ~ '::' ~ {@+:literal !(':'|'=')} + '@@keyword' ~ '::' ~ {@+:(word|string) !(':'|'=')} ; diff --git a/tatsu/bootstrap.py b/tatsu/bootstrap.py index 2f74ba91..b34dfae4 100644 --- a/tatsu/bootstrap.py +++ b/tatsu/bootstrap.py @@ -238,7 +238,16 @@ def _keyword_(self): self._cut() def block0(): - self._literal_() + with self._group(): + with self._choice(): + with self._option(): + self._word_() + with self._option(): + self._string_() + self._error( + 'expecting one of: ' + ' ' + ) self.add_last_node_to_name('@') with self._ifnot(): with self._group():