Makefile.menhir enhancement

This commit factorizes the way the menhir flags for unused tokens
is defined. It also brings the comments explaining why tokens are
unused above the definition of the unused_tokens variable.
This commit is contained in:
Sébastien Hinderer 2019-01-03 17:36:44 +01:00
parent 7491f8a8dc
commit 87d475c5e0
1 changed files with 8 additions and 6 deletions

View File

@ -46,12 +46,7 @@
MENHIR ?= menhir
## Menhir compilation flags
MENHIRFLAGS := --explain --dump --ocamlc "$(CAMLC) $(COMPFLAGS)" --infer \
--lalr --strict --table -lg 1 -la 1 \
--unused-token COMMENT --unused-token DOCSTRING --unused-token EOL\
--unused-token GREATERRBRACKET --fixed-exception
## Unused tokens
# tokens COMMENT, DOCSTRING and EOL are produced by special lexer
# modes used by other consumers than the parser.
@ -60,6 +55,13 @@ MENHIRFLAGS := --explain --dump --ocamlc "$(CAMLC) $(COMPFLAGS)" --infer \
# (which is used in polymorphic variant), but is not currently used by
# the grammar.
unused_tokens := COMMENT DOCSTRING EOL GREATERRBRACKET
## Menhir compilation flags
MENHIRFLAGS := --explain --dump --ocamlc "$(CAMLC) $(COMPFLAGS)" --infer \
--lalr --strict --table -lg 1 -la 1 \
$(addprefix --unused-token ,$(unused_tokens)) --fixed-exception
## promote-menhir