• R/O
  • SSH

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Castle: The best Real-Time/Embedded/HighTech language EVER. Attempt 2


Commit MetaInfo

Revisionc3522f82dc29e20af0deabba3a81339250dca067 (tree)
Zeit2022-01-15 06:58:06
AutorAlbert Mietus < albert AT mietus DOT nl >
CommiterAlbert Mietus < albert AT mietus DOT nl >

Log Message

Added make missing_visitors to warn on missing_visitors

Ändern Zusammenfassung

Diff

diff -r ddd4d080d1e2 -r c3522f82dc29 Arpeggio/Makefile
--- a/Arpeggio/Makefile Mon Jan 03 23:33:12 2022 +0100
+++ b/Arpeggio/Makefile Fri Jan 14 22:58:06 2022 +0100
@@ -1,6 +1,6 @@
1-default: test
1+default: all
22
3-all: test
3+all: test missing_visitors
44
55 test:
66 (cd pytst/; pytest)
@@ -17,3 +17,11 @@
1717 rm -f *.dot
1818 rm -f pytst/*.dot
1919
20+GRAMMAR_RULES := $(shell grep '^ *def ' ./grammar.py | awk '{print $$2}' | sed 's/()://')
21+
22+missing_visitors:
23+ @for R in ${GRAMMAR_RULES}; do \
24+ if ! grep -q -E "^ *((def)|(# *NOVISITOR_NEEDED:)) *visit_$$R" ./visitor.py> /dev/null ; then\
25+ echo "Warning: $${R} has no visitor (nor is marked as to need none)" ;\
26+ fi ;\
27+ done
diff -r ddd4d080d1e2 -r c3522f82dc29 Arpeggio/visitor.py
--- a/Arpeggio/visitor.py Mon Jan 03 23:33:12 2022 +0100
+++ b/Arpeggio/visitor.py Fri Jan 14 22:58:06 2022 +0100
@@ -7,6 +7,15 @@
77
88 class QuantityError(ValueError): pass
99
10+
11+#NOVISITOR_NEEDED: visit_str_no_s1
12+#NOVISITOR_NEEDED: visit_str_no_d1
13+#NOVISITOR_NEEDED: visit_str_no_s3
14+#NOVISITOR_NEEDED: visit_str_no_d3
15+#NOVISITOR_NEEDED: visit_comment
16+#NOVISITOR_NEEDED: visit_ID
17+#NOVISITOR_NEEDED: visit_re_no_slash
18+
1019 class PegVisitor(arpeggio.PTNodeVisitor):
1120 token_2_class = {'?': peg.Optional,
1221 '*': peg.ZeroOrMore,