<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -20,16 +20,19 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
-# A grammar for simple arithmetic.
+# A grammar for an arithmetic calculator.
+# Supports +,-,*,/, negation, parentheses and floating point numbers.
 
-Calc &lt;- Ws ?(Id :'=' Ws) Sum
+calc  &lt;- ws sum
 
-Id   &lt;- +[a-zA-Z] Ws
+sum   &lt;- prod *([+-] ws prod)
 
-Sum  &lt;= Prod *([+-] Ws Prod)
+prod  &lt;- unary *([*/] ws unary)
 
-Prod &lt;= Num *([*/] Ws Num)
+unary &lt;= '-' ws unary
+       | :'(' ws sum :')' ws
+       | num
 
-Num  &lt;- +[0-9] Ws
+num   &lt;- +[0-9] ?('.' +[0-9]) ws
 
-Ws   &lt;: *[ \t\n\r]
+ws    &lt;: *[ \t\n\r]</diff>
      <filename>grammars/calc.waxeye</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6c42615ce42e395f8742e0631d9a7213f500cabd</id>
    </parent>
  </parents>
  <author>
    <name>Orlando D. A. R. Hill</name>
    <email>orlandodarhill</email>
  </author>
  <url>http://github.com/orlandodarhill/waxeye/commit/5234db566c74ccea68337ef5cac1a4cff4720902</url>
  <id>5234db566c74ccea68337ef5cac1a4cff4720902</id>
  <committed-date>2008-11-11T09:40:32-08:00</committed-date>
  <authored-date>2008-11-11T09:40:32-08:00</authored-date>
  <message>Improved the calc grammar.</message>
  <tree>ebd50b753c5c15a192a65efd4d5a637ff6d158e6</tree>
  <committer>
    <name>Orlando D. A. R. Hill</name>
    <email>orlandodarhill</email>
  </committer>
</commit>
