• R/O
  • SSH

Commit

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

Revisionaf147882bb4018964e907b4012b0b49acf63f569 (tree)
Zeit2024-05-12 21:32:36
AutorAlbert Mietus < albert AT mietus DOT nl >
CommiterAlbert Mietus < albert AT mietus DOT nl >

Log Message

TESTDOUBLES::sieveCastle solved mypy, by using (new) 'VoidCall' -- thanks mypy

Ändern Zusammenfassung

Diff

diff -r 37fd3f352fdc -r af147882bb40 TestDoubles_packages/TestDoubles-aigr-sieve/castle/TESTDOUBLES/aigr/sieve/basic1/sieveCastle.py
--- a/TestDoubles_packages/TestDoubles-aigr-sieve/castle/TESTDOUBLES/aigr/sieve/basic1/sieveCastle.py Sun May 12 14:30:11 2024 +0200
+++ b/TestDoubles_packages/TestDoubles-aigr-sieve/castle/TESTDOUBLES/aigr/sieve/basic1/sieveCastle.py Sun May 12 14:32:36 2024 +0200
@@ -22,33 +22,33 @@
2222 Sieve = ComponentImplementation('Sieve',
2323 interface=components.SieveMoat,
2424 parameters=(),
25- body=aigr.Body()) # Body in filed below
25+ body=aigr.Body()) # Body filled-in below
26+
27+assert isinstance(Sieve.body, aigr.Body) # This make mypy happy to fill-in the Body
28+
2629
2730 # init(int:onPrime) // `init` is (typically) part of the construction of a element.
2831 # {
2932 # super.init(); // `super` acts as port to the base-class
3033 # .myPrime := onPrime;
3134 # }
32-
3335 init_method = Method(ID('init'),
3436 returns=None,
3537 parameters=(aigr.TypedParameter(name=ID('onPrime'), type=int),),
3638 body=aigr.Body(statements=[
37- aigr.Call(
38- callable=aigr.Part(
39- base=aigr.Call(callable=ID('super')), attribute=ID('init')),
40- arguments=()),
39+ aigr.VoidCall(
40+ aigr.Call(
41+ callable=aigr.Part(
42+ base=aigr.Call(callable=ID('super')), attribute=ID('init')),
43+ arguments=())),
4144 aigr.Become(
4245 targets=(aigr.Part(base=ID('self'), attribute=ID('myPrime', context=aigr.Set())),),
4346 values=(ID('onPrime', context=aigr.Ref()),))]))
4447
45-assert isinstance(Sieve.body, aigr.Body) # This make mypy happy for the next line :-)
48+
4649 Sieve.body.expand(init_method)
4750
4851
49-
50-
51-
5252 # SimpleSieve.input(try) on .try
5353 # {
5454 # if ( (try % .myPrime) !=0 ) {
diff -r 37fd3f352fdc -r af147882bb40 TestDoubles_packages/TestDoubles-aigr-sieve/pytst/sieve/basic1/__init__.py
--- a/TestDoubles_packages/TestDoubles-aigr-sieve/pytst/sieve/basic1/__init__.py Sun May 12 14:30:11 2024 +0200
+++ b/TestDoubles_packages/TestDoubles-aigr-sieve/pytst/sieve/basic1/__init__.py Sun May 12 14:32:36 2024 +0200
@@ -8,14 +8,14 @@
88 from castle import aigr
99
1010
11-def find_name_in_body(name, body) -> PTH.Optional[aigr.statements.callables._Named_callable]:
11+def find_name_in_body(name, body) -> PTH.Optional[aigr.NamedNode]:
1212 logger.info("find_name_in_body(name=%s, body=%s", name, body)
1313 for s in body.statements:
1414 logger.debug("\t: %s", s)
1515 if isinstance(s, aigr.NamedNode):
1616 logger.debug("\t: name=%s in %s", s.name, s)
1717 if s.name == name:
18- logger.debug("\t: FOUND name=%s in %s", s.name, s)
18+ logger.debug("\t: FOUND name=%s: %s", s.name, s)
1919 return s
2020 logger.debug("NOT FOUND: %s", name)
2121 return None