scrall 0.9.0__tar.gz → 0.9.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of scrall might be problematic. Click here for more details.
- {scrall-0.9.0/src/scrall.egg-info → scrall-0.9.2}/PKG-INFO +1 -1
- {scrall-0.9.0 → scrall-0.9.2}/pyproject.toml +1 -1
- scrall-0.9.2/src/scrall/__init__.py +1 -0
- {scrall-0.9.0 → scrall-0.9.2}/src/scrall/parse/scrall.peg +1 -1
- {scrall-0.9.0 → scrall-0.9.2}/src/scrall/parse/visitor.py +5 -8
- {scrall-0.9.0 → scrall-0.9.2/src/scrall.egg-info}/PKG-INFO +1 -1
- {scrall-0.9.0 → scrall-0.9.2}/src/scrall.egg-info/SOURCES.txt +3 -0
- scrall-0.9.2/tests/test_decision_wrap.py +39 -0
- scrall-0.9.2/tests/test_decision_wrap_false.py +47 -0
- scrall-0.9.2/tests/test_operation.py +30 -0
- {scrall-0.9.0 → scrall-0.9.2}/tests/test_signals.py +22 -2
- scrall-0.9.0/src/scrall/__init__.py +0 -1
- {scrall-0.9.0 → scrall-0.9.2}/LICENSE +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/MANIFEST.in +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/README.md +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/setup.cfg +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/src/scrall/__main__.py +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/src/scrall/exceptions.py +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/src/scrall/log.conf +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/src/scrall/parse/__init__.py +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/src/scrall/parse/parser.py +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/src/scrall.egg-info/dependency_links.txt +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/src/scrall.egg-info/entry_points.txt +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/src/scrall.egg-info/requires.txt +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/src/scrall.egg-info/top_level.txt +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/tests/test_calls.py +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/tests/test_delete.py +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/tests/test_ping_actions.py +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/tests/test_selection.py +0 -0
- {scrall-0.9.0 → scrall-0.9.2}/tests/test_state_actions.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scrall"
|
|
7
|
-
version = "0.9.
|
|
7
|
+
version = "0.9.2"
|
|
8
8
|
description = "Starr's Concise Relational Action Language - For Shlaer-Mellor Executable UML"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Leon Starr", email = "leon_starr@modelint.com" }]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
version = "0.9.2"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
activity = LINEWRAP* execution_unit* EOF
|
|
2
|
-
execution_unit = LINEWRAP* statement_set sequence_token? LINEWRAP
|
|
2
|
+
execution_unit = LINEWRAP* statement_set sequence_token? (SP+ / LINEWRAP*)
|
|
3
3
|
statement_set = SP* sequenced_statement_set / component_statement_set
|
|
4
4
|
sequenced_statement_set = sequence_token* (block / statement)
|
|
5
5
|
component_statement_set = block / LINEWRAP* statement
|
|
@@ -635,14 +635,6 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
635
635
|
_logger.info(f" > {result}")
|
|
636
636
|
return result
|
|
637
637
|
|
|
638
|
-
# # Asynch service
|
|
639
|
-
# @classmethod
|
|
640
|
-
# def visit_asynch_service(cls, node, children):
|
|
641
|
-
# """
|
|
642
|
-
# name '.' signal_spec ASYNCH ee
|
|
643
|
-
# """
|
|
644
|
-
# result = Asynch_a(*children)
|
|
645
|
-
|
|
646
638
|
@classmethod
|
|
647
639
|
def visit_signal_action(cls, node, children):
|
|
648
640
|
"""
|
|
@@ -847,6 +839,11 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
847
839
|
_logger.info(f" > {result}")
|
|
848
840
|
return result
|
|
849
841
|
|
|
842
|
+
@classmethod
|
|
843
|
+
def visit_owner(cls, node, children):
|
|
844
|
+
result = ''.join(children)
|
|
845
|
+
return result
|
|
846
|
+
|
|
850
847
|
@classmethod
|
|
851
848
|
def visit_supplied_params(cls, node, children):
|
|
852
849
|
"""
|
|
@@ -17,7 +17,10 @@ src/scrall/parse/parser.py
|
|
|
17
17
|
src/scrall/parse/scrall.peg
|
|
18
18
|
src/scrall/parse/visitor.py
|
|
19
19
|
tests/test_calls.py
|
|
20
|
+
tests/test_decision_wrap.py
|
|
21
|
+
tests/test_decision_wrap_false.py
|
|
20
22
|
tests/test_delete.py
|
|
23
|
+
tests/test_operation.py
|
|
21
24
|
tests/test_ping_actions.py
|
|
22
25
|
tests/test_selection.py
|
|
23
26
|
tests/test_signals.py
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
""" test_decision_wrap.py -- Test line wrapping """
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
from scrall.parse.parser import ScrallParser
|
|
5
|
+
from scrall.parse.visitor import *
|
|
6
|
+
|
|
7
|
+
# The expected result is teh same for each input case
|
|
8
|
+
expected_parse = Execution_Unit_a(
|
|
9
|
+
statement_set=Seq_Statement_Set_a(
|
|
10
|
+
input_tokens=[],
|
|
11
|
+
statement=Decision_a(
|
|
12
|
+
input=N_a(name='choice'),
|
|
13
|
+
true_result=Comp_Statement_Set_a(
|
|
14
|
+
statement=None,
|
|
15
|
+
block=[
|
|
16
|
+
Execution_Unit_a(
|
|
17
|
+
statement_set=Seq_Statement_Set_a(
|
|
18
|
+
input_tokens=[],
|
|
19
|
+
statement=New_inst_a(
|
|
20
|
+
cname=N_a(name='cat'), attrs=[], rels=None),
|
|
21
|
+
block=None
|
|
22
|
+
),
|
|
23
|
+
output_token=None
|
|
24
|
+
)
|
|
25
|
+
]), false_result=None), block=None
|
|
26
|
+
), output_token=None
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
# Different line wrapping of the same content
|
|
30
|
+
@pytest.mark.parametrize("text", [
|
|
31
|
+
"choice? { *cat }",
|
|
32
|
+
"choice? {\n*cat }",
|
|
33
|
+
"choice? {\n *cat\n}",
|
|
34
|
+
"choice?\n { *cat }",
|
|
35
|
+
])
|
|
36
|
+
def test_signal_action(text):
|
|
37
|
+
parse = ScrallParser.parse_text(scrall_text=text, debug=False)[0]
|
|
38
|
+
print(parse)
|
|
39
|
+
assert parse[0] == expected_parse
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
""" test_decision_wrap_false.py -- Test line wrapping with true false decision cases """
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
from scrall.parse.parser import ScrallParser
|
|
5
|
+
from scrall.parse.visitor import *
|
|
6
|
+
|
|
7
|
+
# The expected result is teh same for each input case
|
|
8
|
+
expected_parse = Execution_Unit_a(
|
|
9
|
+
statement_set=Seq_Statement_Set_a(
|
|
10
|
+
input_tokens=[],
|
|
11
|
+
statement=Decision_a(
|
|
12
|
+
input=N_a(name='choice'),
|
|
13
|
+
true_result=Comp_Statement_Set_a(
|
|
14
|
+
statement=None,
|
|
15
|
+
block=[
|
|
16
|
+
Execution_Unit_a(
|
|
17
|
+
statement_set=Seq_Statement_Set_a(
|
|
18
|
+
input_tokens=[],
|
|
19
|
+
statement=New_inst_a(
|
|
20
|
+
cname=N_a(name='cat'), attrs=[], rels=None),
|
|
21
|
+
block=None), output_token=None
|
|
22
|
+
)
|
|
23
|
+
]),
|
|
24
|
+
false_result=Comp_Statement_Set_a(
|
|
25
|
+
statement=None,
|
|
26
|
+
block=[
|
|
27
|
+
Execution_Unit_a(
|
|
28
|
+
statement_set=Seq_Statement_Set_a(
|
|
29
|
+
input_tokens=[],
|
|
30
|
+
statement=New_inst_a(
|
|
31
|
+
cname=N_a(name='dog'), attrs=[], rels=None),
|
|
32
|
+
block=None), output_token=None
|
|
33
|
+
)
|
|
34
|
+
])
|
|
35
|
+
), block=None), output_token=None)
|
|
36
|
+
|
|
37
|
+
# Different line wrapping of the same content
|
|
38
|
+
@pytest.mark.parametrize("text", [
|
|
39
|
+
"choice? { *cat } : { *dog }",
|
|
40
|
+
"choice? { *cat } : {\n *dog\n }",
|
|
41
|
+
"choice? { *cat } : {\n *dog }",
|
|
42
|
+
"choice? { *cat } :\n {\n *dog\n }",
|
|
43
|
+
])
|
|
44
|
+
def test_signal_action(text):
|
|
45
|
+
parse = ScrallParser.parse_text(scrall_text=text, debug=False)[0]
|
|
46
|
+
print(parse)
|
|
47
|
+
assert parse[0] == expected_parse
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
""" test_operation.py - Test the invocation of an operation"""
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
from scrall.parse.parser import ScrallParser
|
|
5
|
+
from scrall.parse.visitor import *
|
|
6
|
+
|
|
7
|
+
actions = [
|
|
8
|
+
("dest aslev .= cabin in shaft.Ping both ways()",
|
|
9
|
+
Execution_Unit_a(statement_set=Seq_Statement_Set_a(
|
|
10
|
+
input_tokens=[],
|
|
11
|
+
statement=Inst_Assignment_a(
|
|
12
|
+
lhs=Flow_Output_a(name=N_a(name='dest aslev'), exp_type=None), card='1',
|
|
13
|
+
rhs=INST_a(
|
|
14
|
+
components=[
|
|
15
|
+
Op_a(
|
|
16
|
+
owner='cabin in shaft',
|
|
17
|
+
op_name='Ping both ways',
|
|
18
|
+
supplied_params=[])]
|
|
19
|
+
), X=(0, 45)
|
|
20
|
+
),
|
|
21
|
+
block=None), output_token=None)
|
|
22
|
+
),
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@pytest.mark.parametrize("text, expected", actions)
|
|
27
|
+
def test_ping_action(text, expected):
|
|
28
|
+
parse = ScrallParser.parse_text(scrall_text=text, debug=False)[0]
|
|
29
|
+
print(parse)
|
|
30
|
+
assert parse[0] == expected
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import pytest
|
|
4
4
|
from scrall.parse.parser import ScrallParser
|
|
5
|
-
from scrall.parse.visitor import Execution_Unit_a, Signal_a, Signal_Dest_a, N_a, INST_a, PATH_a, R_a,
|
|
6
|
-
Seq_Statement_Set_a, Supplied_Parameter_a, External_Signal_a
|
|
5
|
+
from scrall.parse.visitor import (Execution_Unit_a, Signal_a, Signal_Dest_a, N_a, INST_a, PATH_a, R_a,
|
|
6
|
+
Seq_Statement_Set_a, Supplied_Parameter_a, External_Signal_a, Decision_a, Comp_Statement_Set_a)
|
|
7
7
|
|
|
8
8
|
actions = [
|
|
9
9
|
("Time to close ->* me",
|
|
@@ -53,6 +53,26 @@ actions = [
|
|
|
53
53
|
block=None),
|
|
54
54
|
output_token=None)
|
|
55
55
|
),
|
|
56
|
+
("destination aslev?\n"
|
|
57
|
+
" Transfer created -> : No destination -> me",
|
|
58
|
+
Execution_Unit_a(
|
|
59
|
+
statement_set=Seq_Statement_Set_a(
|
|
60
|
+
input_tokens=[],
|
|
61
|
+
statement=Decision_a(
|
|
62
|
+
input=N_a(name='destination aslev'),
|
|
63
|
+
true_result=Comp_Statement_Set_a(
|
|
64
|
+
statement=Signal_a(
|
|
65
|
+
event='Transfer created',
|
|
66
|
+
supplied_params=[], dest=None), block=None),
|
|
67
|
+
false_result=Comp_Statement_Set_a(
|
|
68
|
+
statement=Signal_a(
|
|
69
|
+
event='No destination',
|
|
70
|
+
supplied_params=[],
|
|
71
|
+
dest=Signal_Dest_a(
|
|
72
|
+
target_iset=N_a(name='me'), assigner_dest=None, delay=0, cancel=False
|
|
73
|
+
)), block=None
|
|
74
|
+
)), block=None), output_token=None)
|
|
75
|
+
),
|
|
56
76
|
]
|
|
57
77
|
|
|
58
78
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
version = "0.9.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|