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.master
parent
7491f8a8dc
commit
87d475c5e0
|
@ -46,12 +46,7 @@
|
||||||
|
|
||||||
MENHIR ?= menhir
|
MENHIR ?= menhir
|
||||||
|
|
||||||
## Menhir compilation flags
|
## Unused tokens
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
# tokens COMMENT, DOCSTRING and EOL are produced by special lexer
|
# tokens COMMENT, DOCSTRING and EOL are produced by special lexer
|
||||||
# modes used by other consumers than the parser.
|
# 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
|
# (which is used in polymorphic variant), but is not currently used by
|
||||||
# the grammar.
|
# 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
|
## promote-menhir
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue