core_marking3/postfix_test1.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Sat, 11 Mar 2023 23:12:49 +0000
changeset 467 9b5165b8a762
parent 424 daf561a83ba6
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
424
Christian Urban <christian.urban@kcl.ac.uk>
parents: 386
diff changeset
     1
import C3a._
384
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     2
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     3
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     4
assert(syard(split("3 + 4 * ( 2 - 1 )")) == List("3", "4", "2", "1", "-", "*", "+"))
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     5
assert(syard(split("( ( ( 3 ) ) + ( ( 4 + ( 5 ) ) ) )")) == List("3", "4", "5", "+", "+"))
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     6
assert(syard(split("5 + 7 / 2")) == List("5", "7", "2", "/", "+"))
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     7
assert(syard(split("5 * 7 / 2")) == List("5", "7", "*", "2", "/"))