Getty Ritter 2 years ago
parent
commit
e34462d33b
5 changed files with 60 additions and 176 deletions
  1. 2 10
      tests/assn.parsed
  2. 1 5
      tests/atom_lit.parsed
  3. 41 131
      tests/exprs.parsed
  4. 1 5
      tests/num_lit.parsed
  5. 15 25
      tests/str_lit.parsed

+ 2 - 10
tests/assn.parsed

@@ -1,14 +1,6 @@
-Assn  x Chc(
-  Cat(
-    Num(5)
-  )
-)
+Assn  x Num(5)
 
-Assn  y Chc(
-  Cat(
-    Lit(Atom(This))
-  )
-)
+Assn  y Lit(Atom(This))
 
 LitAssn  a, [  a  b  c  d ]
 

+ 1 - 5
tests/atom_lit.parsed

@@ -1,6 +1,2 @@
-Puts Chc(
-  Cat(
-    Lit(Atom(Foo))
-  )
-)
+Puts Lit(Atom(Foo))
 

+ 41 - 131
tests/exprs.parsed

@@ -1,163 +1,73 @@
-Puts Chc(
-  Cat(
-    Lit(Atom(This))
-    Lit(Atom(That))
-    Lit(Atom(The-Other))
-  )
+Puts Cat(
+  Lit(Atom(This))
+  Lit(Atom(That))
+  Lit(Atom(The-Other))
 )
 
 Puts Chc(
-  Cat(
-    Lit(Atom(This))
-  )
-  Cat(
-    Lit(Atom(That))
-  )
-  Cat(
-    Lit(Atom(The-Other))
-  )
+  Lit(Atom(This))
+  Lit(Atom(That))
+  Lit(Atom(The-Other))
 )
 
 Puts Chc(
   5:
-    Cat(
-      Lit(Atom(This))
-    )
-  Cat(
-    Lit(Atom(That))
-  )
+    Lit(Atom(This))
+  Lit(Atom(That))
 )
 
-Puts Chc(
-  Cat(
-    Ap(
-      Ap(
-        Var(foo)
-        Var(bar)
-      )
-      Var(baz)
-    )
+Puts Ap(
+  Ap(
+    Var(foo)
+    Var(bar)
   )
+  Var(baz)
 )
 
-Puts Chc(
+Puts Tup(
   Cat(
-    Tup(
-      Chc(
-        Cat(
-        )
-      )
-    )
   )
 )
 
-Puts Chc(
-  Cat(
-    Tup(
-      Chc(
-        Cat(
-          Num(1)
-        )
-      )
-    )
-  )
+Puts Tup(
+  Num(1)
 )
 
-Puts Chc(
-  Cat(
-    Tup(
-      Chc(
-        Cat(
-          Num(1)
-        )
-      )
-      Chc(
-        Cat(
-          Num(2)
-        )
-      )
-    )
-  )
+Puts Tup(
+  Num(1)
+  Num(2)
 )
 
-Puts Chc(
-  Cat(
-    Tup(
-      Chc(
-        Cat(
-          Num(1)
-        )
-      )
-      Chc(
-        Cat(
-          Num(2)
-        )
-      )
-      Chc(
-        Cat(
-          Num(3)
-        )
-      )
-    )
-  )
+Puts Tup(
+  Num(1)
+  Num(2)
+  Num(3)
 )
 
-Puts Chc(
-  Cat(
-    Range(
-      Num(0)
-      Num(20)
-    )
-  )
+Puts Range(
+  Num(0)
+  Num(20)
 )
 
-Puts Chc(
-  Cat(
-    Range(
-      Var(x)
-      Var(y)
-    )
-  )
+Puts Range(
+  Var(x)
+  Var(y)
 )
 
-Puts Chc(
-  Cat(
-    Ap(
-      Var(f)
-      Var(x)
-    )
-  )
+Puts Ap(
+  Var(f)
+  Var(x)
 )
 
-Puts Chc(
-  Cat(
-    Fun(
-      x =>
-        Chc(
-          Cat(
-            Var(x)
-          )
-        )
-    )
-  )
+Puts Fun(
+  x =>
+    Var(x)
 )
 
-Puts Chc(
-  Cat(
-    Fun(
-      True =>
-        Chc(
-          Cat(
-            Str("yes")
-          )
-        )
-      False =>
-        Chc(
-          Cat(
-            Str("no")
-          )
-        )
-    )
-  )
+Puts Fun(
+  True =>
+    Str("yes")
+  False =>
+    Str("no")
 )
 

+ 1 - 5
tests/num_lit.parsed

@@ -1,6 +1,2 @@
-Puts Chc(
-  Cat(
-    Num(55)
-  )
-)
+Puts Num(55)
 

+ 15 - 25
tests/str_lit.parsed

@@ -1,35 +1,25 @@
-Puts Chc(
-  Cat(
-    Str("foo")
-    Str("foo")
-  )
+Puts Cat(
+  Str("foo")
+  Str("foo")
 )
 
-Puts Chc(
-  Cat(
-    Str("foo bar baz")
-    Str("foo bar baz")
-  )
+Puts Cat(
+  Str("foo bar baz")
+  Str("foo bar baz")
 )
 
-Puts Chc(
-  Cat(
-    Str("won't you")
-    Str("quoth the raven \"nevermore\"")
-  )
+Puts Cat(
+  Str("won't you")
+  Str("quoth the raven \"nevermore\"")
 )
 
-Puts Chc(
-  Cat(
-    Str("this\nthat")
-    Str("one\ntwo")
-  )
+Puts Cat(
+  Str("this\nthat")
+  Str("one\ntwo")
 )
 
-Puts Chc(
-  Cat(
-    Str("\n\t\r")
-    Str("\n\t\r")
-  )
+Puts Cat(
+  Str("\n\t\r")
+  Str("\n\t\r")
 )