• R/O
  • SSH

Commit

Tags
Aucun tag

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

Révisionf751c988d68b0f3d5bda13cb4e08c76b3564613a (tree)
l'heure2021-12-11 04:39:26
AuteurAlbert Mietus < albert AT mietus DOT nl >
CommiterAlbert Mietus < albert AT mietus DOT nl >

Message de Log

Rewriten grammar.py ::test_4_rule works again

Change Summary

Modification

diff -r 614d3d329c7e -r f751c988d68b Arpeggio/pytst/d1_parse_tree/test_4_rule.py
--- a/Arpeggio/pytst/d1_parse_tree/test_4_rule.py Fri Dec 10 20:28:40 2021 +0100
+++ b/Arpeggio/pytst/d1_parse_tree/test_4_rule.py Fri Dec 10 20:39:26 2021 +0100
@@ -1,19 +1,19 @@
11 import pytest
2-from grammar import *
2+import grammar
33
44 import arpeggio
55 RE, S = arpeggio.RegExMatch, arpeggio.StrMatch # shortcut
66
77 def parse_rule(txt, pattern=None):
8- parser = ParserPython(rule, comment)
8+ parser = arpeggio.ParserPython(grammar.rule)
99 tree = parser.parse(txt)
10- #print(f'\nTREE\n{tree.tree_str()}')
10+ print(f'\nTREE\n{tree.tree_str()}')
1111
1212 assert tree.position_end == len(txt) , f"Not parsed whole input; Only: >>{txt[tree.position: tree.position_end]}<<; Not: >>{txt[tree.position_end:]}<<."
1313 assert len(tree) == 4, "A rule should have length=4; ..."
1414 assert tree[0].rule_name == "rule_name", " at [0], the name of the rule"
1515 assert str(tree[1]) == '<-', " then a arrow"
16- assert tree[2].rule_name == "ordered_choice", " at [2] an ordered_choice"
16+ assert tree[2].rule_name == "expressions", " at [2] an ordered_choice"
1717 assert str(tree[3]) == ';', " and the the closing ':'"
1818
1919 return tree