summaryrefslogtreecommitdiff
path: root/Makefile.menhir
diff options
context:
space:
mode:
authorSébastien Hinderer <Sebastien.Hinderer@inria.fr>2019-01-03 17:36:44 +0100
committerSébastien Hinderer <Sebastien.Hinderer@inria.fr>2019-01-10 12:22:23 +0100
commit87d475c5e0426d1b74f3670c88d251153b4a2355 (patch)
tree342a75ec19834c6777e5b0e0c479faf65746f514 /Makefile.menhir
parent7491f8a8dc3c6f9b280ad21402420d359a946b83 (diff)
downloadocaml-87d475c5e0426d1b74f3670c88d251153b4a2355.tar.gz
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.
Diffstat (limited to 'Makefile.menhir')
-rw-r--r--Makefile.menhir14
1 files changed, 8 insertions, 6 deletions
diff --git a/Makefile.menhir b/Makefile.menhir
index 31a24c49f0..c2068d235f 100644
--- a/Makefile.menhir
+++ b/Makefile.menhir
@@ -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