pre_marking3/postfix_test1.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 15 Jan 2021 02:47:51 +0000
changeset 385 44383203970f
parent 384 6e1237691307
child 386 e2170c91a9f2
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
384
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     1
import CW9a._
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", "/"))