Commit 0ef0ac55 authored by Timothy Bourke's avatar Timothy Bourke Committed by Gwenaël Delaval

Allow "and" as a synonym for "&"

parent 3d75602a
......@@ -57,6 +57,7 @@ List.iter (fun (str,tok) -> Hashtbl.add keyword_table str tok) [
"true", BOOL(true);
"false", BOOL(false);
"pre", PRE;
"and", AND;
"or", OR;
"not", NOT;
"open", OPEN;
......
......@@ -47,7 +47,7 @@ open Hept_parsetree
%token <string * string> PRAGMA
%token TYPE FUN NODE RETURNS VAR VAL OPEN END CONST UNSAFE EXTERNAL
%token FBY PRE SWITCH EVERY
%token OR STAR NOT
%token AND OR STAR NOT
%token AMPERSAND
%token AMPERAMPER
%token AUTOMATON
......@@ -95,7 +95,7 @@ open Hept_parsetree
%left ELSE
%right ARROW
%left OR
%left AMPERSAND
%left AND AMPERSAND
%left INFIX0 EQUAL LESS_GREATER
%right INFIX1
%right WHEN WHENOT
......@@ -567,6 +567,8 @@ _exp:
{ mk_op_call "or" [$1; $3] }
| exp STAR exp
{ mk_op_call "*" [$1; $3] }
| exp AND exp
{ mk_op_call "&" [$1; $3] }
| exp AMPERSAND exp
{ mk_op_call "&" [$1; $3] }
| exp SUBTRACTIVE exp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment