Skip to content

Commit

Permalink
Define actions in test_code3.ns
Browse files Browse the repository at this point in the history
  • Loading branch information
retrodaredevil committed Jan 26, 2023
1 parent 4a48d36 commit f8b58a5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class ActionLangTest {
// actions
configMap.put("race", new SimpleNodeConfiguration("type", emptyList(), emptyMap(), "racers", null));
configMap.put("scope", new SimpleNodeConfiguration("type", emptyList(), emptyMap(), null, "action"));
configMap.put("act", new SimpleNodeConfiguration("type", Arrays.asList("name"), emptyMap(), null, "action"));
configMap.put("queue", new SimpleNodeConfiguration("type", emptyList(), emptyMap(), "actions", null));
configMap.put("parallel", new SimpleNodeConfiguration("type", emptyList(), emptyMap(), "actions", null));
configMap.put("print", new SimpleNodeConfiguration("type", Arrays.asList("message"), emptyMap(), null, "expression"));
Expand Down
52 changes: 30 additions & 22 deletions action-lang/src/test/resources/test_code3.ns
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
scope : queue {
print "Hello there how are you?"
parallel {
queue {
wait PT4.1S
print "4.1 seconds has passed"
}
queue {
wait PT3S
print "3 seconds has passed"
}
queue {
wait PT3.1S
print "3.1 seconds has passed"
act doSomething : queue {
print "Doing something"
}
act main : queue {
print "Hello there how are you?"
parallel {
queue {
wait PT4.1S
print "4.1 seconds has passed"
}
queue {
wait PT3S
print "3 seconds has passed"
}
queue {
wait PT3.1S
print "3.1 seconds has passed"
}
}
print : const "asdf"
init x : const 3
init y : ref x
init-exp z : ref x
print : join : union { const "x: "; str : ref x }
set x : const 4
print : join : union { const "y: "; str : ref y }
print : join : union { const "z: "; str : ref z }

call doSomething
}
print : const [ "asdf" ]
init x : const [ 3 ]
init y : ref x
init-exp z : ref x
print : join : union { const "x: "; str : ref x }
set x : const [ 4 ]
print : join : union { const "y: "; str : ref y }
print : join : union(expressions=[const "z: ", str : ref z])
//print : join : union { const "z: "; str : ref z }

call main
}

0 comments on commit f8b58a5

Please sign in to comment.