Make |, \lvert, \rvert work

Test Plan: .

Reviewers: xymostech

Reviewed By: xymostech

Differential Revision: http://phabricator.benalpert.com/D33
This commit is contained in:
Ben Alpert
2013-07-05 21:20:04 -07:00
parent 96733c279c
commit d436e09d07
2 changed files with 11 additions and 3 deletions

View File

@@ -7,7 +7,9 @@
\s+ /* skip whitespace */
cdot return 'CDOT'
frac return 'FRAC'
[/a-zA-Z0-9] return 'ORD'
lvert return 'LVERT'
rvert return 'RVERT'
[/|a-zA-Z0-9] return 'ORD'
[*+-] return 'BIN'
\^ return '^'
[_] return '_'
@@ -66,6 +68,10 @@ func
{$$ = [{type: 'bin', value: yytext}];}
| 'FRAC' group group
{$$ = [{type: 'frac', value: {numer: $2, denom: $3}}];}
| 'LVERT'
{$$ = [{type: 'open', value: yytext}];}
| 'RVERT'
{$$ = [{type: 'close', value: yytext}];}
;
atom