 
   # http://en.wikipedia.org/wiki/Shunting-yard_algorithm
   got_expr: (expr) ->
+    tail = expr.pop()
+    for elem in tail
+      expr = expr.concat elem
     [out, ops] = [[],[]]
     out.push expr.shift()
     while expr.length

# captures below.

# An expression is a list of one or more values separated by operators
expr: value+ % op

# Capture an operator. One of: + - * / ^ (with optional whitespace)
op: /~([<PLUS><DASH><STAR><SLASH><CARET>])~/

#
# Originally inspired by:
#   https://github.com/dmajda/pegjs/blob/master/examples/arithmetics.pegjs

{pegex} = require '../lib/Pegex'
require '../lib/Pegex/Receiver'
