Document the decision

This commit is contained in:
John Doty 2024-06-15 06:18:04 -07:00
parent fb2dff51df
commit c82f53c346
2 changed files with 12 additions and 2 deletions

View file

@ -3,7 +3,18 @@ import pytest
def test_conflicting_names():
"""Terminals and nonterminals can have the same name."""
"""Terminals and nonterminals cannot have the same name.
I think that ultimately this gives a nicer experience, in error messages and
understandability. The input grammar can distinguish between them throughout,
and the system can always be unambiguous when it's working, but at times it
needs to report errors or display the grammar to humans. There is no clean
notation I can use at that time to distinguish between a terminal an a
nonterminal.
I think this restriction ultimately makes the grammars and the tooling easier
to understand.
"""
IDENTIFIER = parser.Terminal("Identifier")