diff options
author | ptmcg <ptmcg@austin.rr.com> | 2018-12-28 14:42:07 -0600 |
---|---|---|
committer | ptmcg <ptmcg@austin.rr.com> | 2018-12-28 14:42:07 -0600 |
commit | 45b78401e8c224619e1b18b9cf43fc02b196676e (patch) | |
tree | fd4c4db17624f48d8efb275946240794c7f059cf /examples/statemachine/trafficLightDemo.py | |
parent | 3288d48409269b404e24888ec90e76ee751251e3 (diff) | |
download | pyparsing-git-45b78401e8c224619e1b18b9cf43fc02b196676e.tar.gz |
Fix partial named results when And embedded in named MatchFirst or Or
Diffstat (limited to 'examples/statemachine/trafficLightDemo.py')
-rw-r--r-- | examples/statemachine/trafficLightDemo.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/statemachine/trafficLightDemo.py b/examples/statemachine/trafficLightDemo.py new file mode 100644 index 0000000..30fe934 --- /dev/null +++ b/examples/statemachine/trafficLightDemo.py @@ -0,0 +1,12 @@ +import statemachine +import trafficlight + +tl = trafficLight.Red() +for i in range(10): + print(tl, end='') + print(("STOP", "GO")[tl.carsCanGo]) + tl.crossingSignal() + tl.delay() + print() + + tl = tl.nextState() |