• 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évisiondd3f259f732d4425b68cd43f1a987d51bb6f7e60 (tree)
l'heure2021-12-23 08:21:18
AuteurAlbert Mietus < albert AT mietus DOT nl >
CommiterAlbert Mietus < albert AT mietus DOT nl >

Message de Log

Added ID (rule_name & rule_crossref) to AST/vistor

Change Summary

Modification

diff -r 7156fb339e33 -r dd3f259f732d Arpeggio/pytst/d2_ast/test_2_ID.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Arpeggio/pytst/d2_ast/test_2_ID.py Thu Dec 23 00:21:18 2021 +0100
@@ -0,0 +1,23 @@
1+import pytest
2+
3+import grammar
4+
5+import sys; sys.path.append("./../AST/") ; sys.path.append("./../../AST/")
6+from castle import peg # has the AST clases
7+
8+from . import parse
9+
10+def test_rule_name():
11+ """The name of a rule is an ID"""
12+ txt="aName"
13+ ast = parse(txt, grammar.rule_name)
14+ assert isinstance(ast, peg.ID), "It should be an ID"
15+ assert ast.name == txt
16+
17+def test_rule_crossref():
18+ """The rule's expressions can also refer an ID"""
19+ txt="aName"
20+ ast = parse(txt, grammar.rule_crossref)
21+ assert isinstance(ast, peg.ID), "It should be an ID"
22+ assert ast.name == txt
23+