scrall 0.9.3__tar.gz → 0.10.0__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.

Files changed (32) hide show
  1. {scrall-0.9.3/src/scrall.egg-info → scrall-0.10.0}/PKG-INFO +1 -1
  2. {scrall-0.9.3 → scrall-0.10.0}/pyproject.toml +1 -1
  3. scrall-0.10.0/src/scrall/__init__.py +1 -0
  4. {scrall-0.9.3 → scrall-0.10.0}/src/scrall/parse/scrall.peg +2 -2
  5. {scrall-0.9.3 → scrall-0.10.0}/src/scrall/parse/visitor.py +24 -19
  6. {scrall-0.9.3 → scrall-0.10.0/src/scrall.egg-info}/PKG-INFO +1 -1
  7. scrall-0.10.0/tests/test_calls.py +77 -0
  8. scrall-0.9.3/src/scrall/__init__.py +0 -1
  9. scrall-0.9.3/tests/test_calls.py +0 -39
  10. {scrall-0.9.3 → scrall-0.10.0}/LICENSE +0 -0
  11. {scrall-0.9.3 → scrall-0.10.0}/MANIFEST.in +0 -0
  12. {scrall-0.9.3 → scrall-0.10.0}/README.md +0 -0
  13. {scrall-0.9.3 → scrall-0.10.0}/setup.cfg +0 -0
  14. {scrall-0.9.3 → scrall-0.10.0}/src/scrall/__main__.py +0 -0
  15. {scrall-0.9.3 → scrall-0.10.0}/src/scrall/exceptions.py +0 -0
  16. {scrall-0.9.3 → scrall-0.10.0}/src/scrall/log.conf +0 -0
  17. {scrall-0.9.3 → scrall-0.10.0}/src/scrall/parse/__init__.py +0 -0
  18. {scrall-0.9.3 → scrall-0.10.0}/src/scrall/parse/parser.py +0 -0
  19. {scrall-0.9.3 → scrall-0.10.0}/src/scrall.egg-info/SOURCES.txt +0 -0
  20. {scrall-0.9.3 → scrall-0.10.0}/src/scrall.egg-info/dependency_links.txt +0 -0
  21. {scrall-0.9.3 → scrall-0.10.0}/src/scrall.egg-info/entry_points.txt +0 -0
  22. {scrall-0.9.3 → scrall-0.10.0}/src/scrall.egg-info/requires.txt +0 -0
  23. {scrall-0.9.3 → scrall-0.10.0}/src/scrall.egg-info/top_level.txt +0 -0
  24. {scrall-0.9.3 → scrall-0.10.0}/tests/test_decision_scalar_expr.py +0 -0
  25. {scrall-0.9.3 → scrall-0.10.0}/tests/test_decision_wrap.py +0 -0
  26. {scrall-0.9.3 → scrall-0.10.0}/tests/test_decision_wrap_false.py +0 -0
  27. {scrall-0.9.3 → scrall-0.10.0}/tests/test_delete.py +0 -0
  28. {scrall-0.9.3 → scrall-0.10.0}/tests/test_operation.py +0 -0
  29. {scrall-0.9.3 → scrall-0.10.0}/tests/test_ping_actions.py +0 -0
  30. {scrall-0.9.3 → scrall-0.10.0}/tests/test_selection.py +0 -0
  31. {scrall-0.9.3 → scrall-0.10.0}/tests/test_signals.py +0 -0
  32. {scrall-0.9.3 → scrall-0.10.0}/tests/test_state_actions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scrall
3
- Version: 0.9.3
3
+ Version: 0.10.0
4
4
  Summary: Starr's Concise Relational Action Language - For Shlaer-Mellor Executable UML
5
5
  Author-email: Leon Starr <leon_starr@modelint.com>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "scrall"
7
- version = "0.9.3"
7
+ version = "0.10.0"
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.10.0"
@@ -74,9 +74,9 @@ inst_assignment = flow_output SP+ INST_ASSIGN SP+ instance_set
74
74
  INST_ASSIGN = '.=' / '..='
75
75
 
76
76
  // Synchronous call action (method or ee operation or type operation)
77
- call = ('~' / instance_set) op_chain? // Post-parse verify that last element is an operation, otherwise invalid call
77
+ call = instance_set op_chain? // Post-parse verify that last element is an operation, otherwise invalid call
78
78
  operation = owner? '.' name supplied_params
79
- owner = name
79
+ owner = '~' / name
80
80
  supplied_params = '(' SP* (param (',' SP+ param)*)? SP* ')'
81
81
  param = (name SP* ':' SP*)? scalar_expr // Comma above keeps scalar_expr from grabbing next param
82
82
 
@@ -157,7 +157,7 @@ class ScrallVisitor(PTNodeVisitor):
157
157
  _logger.info(f' :: {node.value}')
158
158
 
159
159
  _logger.info(f"< {children}")
160
- result = [c for c in children if c]
160
+ result = children[:]
161
161
  _logger.info(f" -> {result}")
162
162
  return result
163
163
 
@@ -239,7 +239,7 @@ class ScrallVisitor(PTNodeVisitor):
239
239
 
240
240
  _logger.info(f" < {children}")
241
241
  _logger.info(f" > pass")
242
- return children
242
+ return children[:] # Removes the result component
243
243
 
244
244
  @classmethod
245
245
  def visit_statement(cls, node, children):
@@ -333,7 +333,7 @@ class ScrallVisitor(PTNodeVisitor):
333
333
 
334
334
  _logger.info(f" < {children}")
335
335
  _logger.info(" > pass")
336
- return children
336
+ return children[:]
337
337
 
338
338
  @classmethod
339
339
  def visit_attr_type_def(cls, node, children):
@@ -354,7 +354,7 @@ class ScrallVisitor(PTNodeVisitor):
354
354
 
355
355
  _logger.info(f" < {children}")
356
356
  _logger.info(f" > pass")
357
- return children
357
+ return children[:]
358
358
 
359
359
  @classmethod
360
360
  def visit_row(cls, node, children):
@@ -376,7 +376,7 @@ class ScrallVisitor(PTNodeVisitor):
376
376
 
377
377
  _logger.info(f" < {children}")
378
378
  _logger.info(f" > pass")
379
- return children
379
+ return children[:]
380
380
 
381
381
  # Implicit table assignment
382
382
  @classmethod
@@ -483,7 +483,7 @@ class ScrallVisitor(PTNodeVisitor):
483
483
 
484
484
  _logger.info(f" < {children}")
485
485
  _logger.info(f" > pass")
486
- return children
486
+ return children[:]
487
487
 
488
488
  @classmethod
489
489
  def visit_column_op(cls, node, children):
@@ -592,7 +592,7 @@ class ScrallVisitor(PTNodeVisitor):
592
592
  _logger.info(f' :: {node.value}')
593
593
 
594
594
  _logger.info(f" < {children}")
595
- result = children
595
+ result = children[:]
596
596
  _logger.info(f" > {result}")
597
597
  return result
598
598
 
@@ -781,7 +781,7 @@ class ScrallVisitor(PTNodeVisitor):
781
781
  _logger.info(f' :: {node.value}')
782
782
 
783
783
  _logger.info(f" < {children}")
784
- result = children
784
+ result = children[:]
785
785
  _logger.info(f" > {result}")
786
786
  return result
787
787
 
@@ -832,7 +832,7 @@ class ScrallVisitor(PTNodeVisitor):
832
832
  owner = children.results.get('owner')
833
833
  p = children.results.get('supplied_params')
834
834
  result = Op_a(
835
- owner='implicit' if not owner else owner[0],
835
+ owner='_implicit' if not owner else owner[0],
836
836
  op_name=children.results['name'][0].name,
837
837
  supplied_params=[] if not p else p[0]
838
838
  )
@@ -841,7 +841,12 @@ class ScrallVisitor(PTNodeVisitor):
841
841
 
842
842
  @classmethod
843
843
  def visit_owner(cls, node, children):
844
- result = ''.join(children)
844
+ """
845
+ '~' / name
846
+ """
847
+ name = children.results.get('name')
848
+ # This is either ~ signifying an external service or a single instance flow (instance set)
849
+ result = name[0].name if name else '_external'
845
850
  return result
846
851
 
847
852
  @classmethod
@@ -853,7 +858,7 @@ class ScrallVisitor(PTNodeVisitor):
853
858
  _logger.info(f' :: {node.value}')
854
859
 
855
860
  _logger.info(f" < {children}")
856
- result = children if children else []
861
+ result = children[:]
857
862
  _logger.info(f" > {result}")
858
863
  return result
859
864
 
@@ -903,7 +908,7 @@ class ScrallVisitor(PTNodeVisitor):
903
908
  _logger.info(f' :: {node.value}')
904
909
 
905
910
  _logger.info(f" < {children}")
906
- result = Iteration_a(*children)
911
+ result = Iteration_a(*children) # TODO: Check this for inclusion of results member
907
912
  _logger.info(f" > {result}")
908
913
  return result
909
914
 
@@ -944,7 +949,7 @@ class ScrallVisitor(PTNodeVisitor):
944
949
  # Just like above case, but returning an IN_a (parameter name)
945
950
  result = p[0]
946
951
  else:
947
- result = INST_a(children)
952
+ result = INST_a(children[:])
948
953
  _logger.info(f" > {result}")
949
954
  return result
950
955
 
@@ -1012,7 +1017,7 @@ class ScrallVisitor(PTNodeVisitor):
1012
1017
  _logger.info(f' :: {node.value}')
1013
1018
 
1014
1019
  _logger.info(f" < {children}")
1015
- result = New_lineage_a(children)
1020
+ result = New_lineage_a(children[:])
1016
1021
  _logger.info(f" > {result}")
1017
1022
  return result
1018
1023
 
@@ -1109,7 +1114,7 @@ class ScrallVisitor(PTNodeVisitor):
1109
1114
  _logger.info(f' :: {node.value}')
1110
1115
 
1111
1116
  _logger.info(f" < {children}")
1112
- result = Scalar_Call_a(children)
1117
+ result = Scalar_Call_a(children[:])
1113
1118
  _logger.info(f" > {result}")
1114
1119
  return result
1115
1120
 
@@ -1146,7 +1151,7 @@ class ScrallVisitor(PTNodeVisitor):
1146
1151
  _logger.info(f' :: {node.value}')
1147
1152
 
1148
1153
  _logger.info(f" < {children}")
1149
- result = children
1154
+ result = children[:]
1150
1155
  _logger.info(f" > {result}")
1151
1156
  return result
1152
1157
 
@@ -1428,7 +1433,7 @@ class ScrallVisitor(PTNodeVisitor):
1428
1433
  return result
1429
1434
  # TODO: include opchain if supplied
1430
1435
 
1431
- result = children
1436
+ result = children[:]
1432
1437
  _logger.info(f" > {result}")
1433
1438
  return result
1434
1439
 
@@ -1459,7 +1464,7 @@ class ScrallVisitor(PTNodeVisitor):
1459
1464
  _logger.info(f' :: {node.value}')
1460
1465
 
1461
1466
  _logger.info(f" < {children}")
1462
- result = Op_chain_a(children)
1467
+ result = Op_chain_a(children[:])
1463
1468
  _logger.info(f" > {result}")
1464
1469
  return result
1465
1470
 
@@ -1568,7 +1573,7 @@ class ScrallVisitor(PTNodeVisitor):
1568
1573
  _logger.info(f' :: {node.value}')
1569
1574
 
1570
1575
  _logger.info(f" < {children}")
1571
- result = PATH_a(children)
1576
+ result = PATH_a(children[:])
1572
1577
  _logger.info(f" > {result}")
1573
1578
  return result
1574
1579
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scrall
3
- Version: 0.9.3
3
+ Version: 0.10.0
4
4
  Summary: Starr's Concise Relational Action Language - For Shlaer-Mellor Executable UML
5
5
  Author-email: Leon Starr <leon_starr@modelint.com>
6
6
  License: MIT License
@@ -0,0 +1,77 @@
1
+ """ test_calls.py - Test method calls and calls to an external service """
2
+
3
+ import pytest
4
+ from scrall.parse.parser import ScrallParser
5
+ from scrall.parse.visitor import *
6
+
7
+ actions = [
8
+ ("~.Goto floor( Dest floor: ^new dest )",
9
+ Execution_Unit_a(
10
+ statement_set=Seq_Statement_Set_a(
11
+ input_tokens=[],
12
+ statement=Call_a(
13
+ call=INST_a(
14
+ components=[
15
+ Op_a(owner='_external', op_name='Goto floor',
16
+ supplied_params=[
17
+ Supplied_Parameter_a(
18
+ pname='Dest floor', sval=IN_a(name='new dest')
19
+ )
20
+ ])]), op_chain=None), block=None), output_token=None)
21
+ ),
22
+ # Execution_Unit_a(
23
+ # statement_set=Seq_Statement_Set_a(
24
+ # input_tokens=[],
25
+ # statement=Call_a(
26
+ # call=None,
27
+ # op_chain=Op_chain_a(
28
+ # components=[
29
+ # Scalar_op_a(
30
+ # name=N_a(name='Goto floor'),
31
+ # supplied_params=[
32
+ # Supplied_Parameter_a(
33
+ # pname='Dest floor',
34
+ # sval=IN_a(name='new dest')
35
+ # )
36
+ # ]
37
+ # )
38
+ # ]
39
+ # )
40
+ # ), block=None),
41
+ # output_token=None)
42
+ # ),
43
+ (".Ping( dir: Travel direction.opposite )",
44
+ Execution_Unit_a(
45
+ statement_set=Seq_Statement_Set_a(
46
+ input_tokens=[],
47
+ statement=Call_a(
48
+ call=INST_a(
49
+ components=[
50
+ Op_a(
51
+ owner='_implicit',
52
+ op_name='Ping',
53
+ supplied_params=[
54
+ Supplied_Parameter_a(
55
+ pname='dir',
56
+ sval=INST_PROJ_a(
57
+ iset=N_a(name='Travel direction'),
58
+ projection=Projection_a(
59
+ expand=None, attrs=[N_a(name='opposite')]
60
+ )
61
+ )
62
+ )
63
+ ]
64
+ )
65
+ ]
66
+ ),
67
+ op_chain=None),
68
+ block=None),
69
+ output_token=None)
70
+ ),
71
+ ]
72
+
73
+ @pytest.mark.parametrize("text, expected", actions)
74
+ def test_call_action(text, expected):
75
+ parse = ScrallParser.parse_text(scrall_text=text, debug=False)[0]
76
+ print(parse)
77
+ assert parse[0] == expected
@@ -1 +0,0 @@
1
- version = "0.9.3"
@@ -1,39 +0,0 @@
1
- """ test_calls.py - Test method calls and calls to an external service """
2
-
3
- import pytest
4
- from scrall.parse.parser import ScrallParser
5
- from scrall.parse.visitor import (
6
- Execution_Unit_a, Seq_Statement_Set_a, Call_a, Op_chain_a, Scalar_op_a,
7
- Supplied_Parameter_a, N_a, IN_a,
8
- )
9
-
10
- actions = [
11
- ("~.Goto floor( Dest floor: ^new dest )",
12
- Execution_Unit_a(
13
- statement_set=Seq_Statement_Set_a(
14
- input_tokens=[],
15
- statement=Call_a(
16
- call=None,
17
- op_chain=Op_chain_a(
18
- components=[
19
- Scalar_op_a(
20
- name=N_a(name='Goto floor'),
21
- supplied_params=[
22
- Supplied_Parameter_a(
23
- pname='Dest floor',
24
- sval=IN_a(name='new dest')
25
- )
26
- ]
27
- )
28
- ]
29
- )
30
- ), block=None),
31
- output_token=None)
32
- ),
33
- ]
34
-
35
- @pytest.mark.parametrize("text, expected", actions)
36
- def test_call_action(text, expected):
37
- parse = ScrallParser.parse_text(scrall_text=text, debug=False)[0]
38
- print(parse)
39
- assert parse[0] == expected
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