• R/O
  • SSH

Commit

Tags
No 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

Revisão76f7a4c5a47d8278d7761ea14e1bce1fbcbfd288 (tree)
Hora2022-03-02 05:09:36
AutorAlbert Mietus < albert AT mietus DOT nl >
CommiterAlbert Mietus < albert AT mietus DOT nl >

Mensagem de Log

renamed test_9-... to _file.py; to make it uniform

Mudança Sumário

Diff

diff -r 68702f02a7ef -r 76f7a4c5a47d pytst/readers/parser/d1_parse_tree/test_9_file.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pytst/readers/parser/d1_parse_tree/test_9_file.py Tue Mar 01 21:09:36 2022 +0100
@@ -0,0 +1,22 @@
1+import pytest
2+from pathlib import Path
3+import os
4+
5+from castle.readers.parser import grammar
6+import arpeggio
7+
8+def parse_file(filename, dir=Path('..')):
9+ path_to_current_test = Path(os.path.realpath(__file__))
10+ path_to_current_dir = path_to_current_test.parent
11+ with (path_to_current_dir / dir / filename).open() as f:
12+ txt = f.read()
13+
14+ parser = arpeggio.ParserPython(grammar.peg_grammar, grammar.comment, debug=False)
15+ tree = parser.parse(txt)
16+
17+ assert tree.position_end == len(txt) , f"Not parsed whole input; Only: >>{regex[tree.position: tree.position_end]}<<; Not: >>{regex[tree.position_end:]}<<."
18+
19+ print("\nPARSE TREE\n" + tree.tree_str())
20+ return tree
21+
22+def test_grammar(): parse_file("grammar.peg")
diff -r 68702f02a7ef -r 76f7a4c5a47d pytst/readers/parser/d1_parse_tree/test_9_grammar.py
--- a/pytst/readers/parser/d1_parse_tree/test_9_grammar.py Fri Feb 25 23:39:53 2022 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
1-import pytest
2-from pathlib import Path
3-import os
4-
5-from castle.readers.parser import grammar
6-import arpeggio
7-
8-def parse_file(filename, dir=Path('..')):
9- path_to_current_test = Path(os.path.realpath(__file__))
10- path_to_current_dir = path_to_current_test.parent
11- with (path_to_current_dir / dir / filename).open() as f:
12- txt = f.read()
13-
14- parser = arpeggio.ParserPython(grammar.peg_grammar, grammar.comment, debug=False)
15- tree = parser.parse(txt)
16-
17- assert tree.position_end == len(txt) , f"Not parsed whole input; Only: >>{regex[tree.position: tree.position_end]}<<; Not: >>{regex[tree.position_end:]}<<."
18-
19- print("\nPARSE TREE\n" + tree.tree_str())
20- return tree
21-
22-def test_grammar(): parse_file("grammar.peg")