Commits

Anonymous committed 6a731e1

refactor article for computations,remove spurious arg to exeunts

  • Participants
  • Parent commits 03b411d

Comments (0)

Files changed (2)

src/parser/actions.pm

   make $past;
 }
 
-method exeunts($/, $k) {
+method exeunts($/) {
   my $past := PAST::Stmts.new();
 
   if $<charlist> == 0 {

src/parser/grammar.pg

   | 'if not,' <sentence> {*} #= unless
 }
 rule computation {
+  <article>?
+  [
   |<binary> {*} #= binary
   |<unary> {*} #= unary
+  ]
 }
 
 rule binary {
-<article>?
-[
-  |'remainder' 'of' 'the' 'quotient' 'between' <value> 'and' <value> {*} #= mod
-  |'difference' 'between' <value> 'and' <value> {*} #= sub
-  |'sum' 'of' <value> 'and' <value> {*} #= add
-  |'product' 'of' <value> 'and' <value> {*} #= mul
-  |'quotient' 'between' <value> 'and' <value> {*} #= div
-]
+    |'remainder' 'of' 'the' 'quotient' 'between' <value> 'and' <value> {*} #= mod
+    |'difference' 'between' <value> 'and' <value> {*} #= sub
+    |'sum' 'of' <value> 'and' <value> {*} #= add
+    |'product' 'of' <value> 'and' <value> {*} #= mul
+    |'quotient' 'between' <value> 'and' <value> {*} #= div
 }
 
 rule unary {
-<article>?
-[
-  |'factorial' 'of' <value> {*} #= fact
-  |'square' 'of' <value> {*} #= square
-  |'square root' 'of' <value> {*} #= sqrt
-  |'cube' 'of' <value> {*} #= cube
-  |'twice' <value> {*} #= dup
-]
+    |'factorial' 'of' <value> {*} #= fact
+    |'square' 'of' <value> {*} #= square
+    |'square root' 'of' <value> {*} #= sqrt
+    |'cube' 'of' <value> {*} #= cube
+    |'twice' <value> {*} #= dup
 }
 
 rule value {
 }
 
 rule immediate {
- <article>? [<adjective> ]* <noun> {*} 
+  <article>? [<adjective> ]* <noun> {*} 
 }
 
 token noun {
 }
 
 rule enters {
-'[' 
-  'enter' <charlist> {*} 
-']'
+  '[' 
+    'enter' <charlist> {*} 
+  ']'
 }
 rule exeunts {
-'[' 
- 'exeunt' <charlist> {*} #= list
-']'
+  '[' 
+   'exeunt' <charlist> {*} 
+  ']'
 }
 
 rule exits {