summaryrefslogtreecommitdiffstats
path: root/src/lexer.mll
diff options
context:
space:
mode:
Diffstat (limited to 'src/lexer.mll')
-rw-r--r--src/lexer.mll3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lexer.mll b/src/lexer.mll
index ee58a7d..fd3eef0 100644
--- a/src/lexer.mll
+++ b/src/lexer.mll
@@ -51,6 +51,7 @@ type raw_token =
| CONCAT of raw_pos | POWER of raw_pos | TIGHT_NOT of raw_pos | BIT_NEG of raw_pos | REF of raw_pos | ONE_SCALAR_PARA of (string * raw_pos) | PATTERN_MATCH of raw_pos | PATTERN_MATCH_NOT of raw_pos | MULT of (string * raw_pos) | MULT_L_STR of raw_pos
| PLUS of (string * raw_pos) | BIT_SHIFT of (string * raw_pos)
| LT of raw_pos | GT of raw_pos | COMPARE_OP of (string * raw_pos) | COMPARE_OP_STR of (string * raw_pos) | EQ_OP of (string * raw_pos) | EQ_OP_STR of (string * raw_pos)
+ | SMART_OP of (string * raw_pos)
| BIT_AND of raw_pos | BIT_OR of raw_pos | BIT_XOR of raw_pos | AND_TIGHT of raw_pos | OR_TIGHT of raw_pos | DOTDOT of (string * raw_pos)
| QUESTION_MARK of raw_pos | COLON of raw_pos | ASSIGN of (string * raw_pos) | COMMA of raw_pos | RIGHT_ARROW of raw_pos | NOT of raw_pos | AND of raw_pos | OR of raw_pos | XOR of raw_pos
@@ -136,6 +137,7 @@ let rec raw_token_to_pos_and_token spaces = function
| COMPARE_OP_STR(s, pos) -> pos, Parser.COMPARE_OP_STR(new_any M_special s spaces pos)
| EQ_OP(s, pos) -> pos, Parser.EQ_OP(new_any M_special s spaces pos)
| EQ_OP_STR(s, pos) -> pos, Parser.EQ_OP_STR(new_any M_special s spaces pos)
+ | SMART_OP(s, pos) -> pos, Parser.SMART_OP(new_any M_special s spaces pos)
| ASSIGN(s, pos) -> pos, Parser.ASSIGN(new_any M_special s spaces pos)
| FOR(s, pos) -> pos, Parser.FOR(new_any M_special s spaces pos)
@@ -492,6 +494,7 @@ rule token = parse
| ">" { GT(pos lexbuf) }
| "<=" | ">=" { COMPARE_OP(lexeme lexbuf, pos lexbuf) }
| "lt" | "gt" | "le" | "ge" { COMPARE_OP_STR(lexeme lexbuf, pos lexbuf) }
+| "~~" { SMART_OP(lexeme lexbuf, pos lexbuf) }
| "==" | "!=" | "<=>" { EQ_OP(lexeme lexbuf, pos lexbuf) }
| "eq" | "ne" | "cmp" { EQ_OP_STR(lexeme lexbuf, pos lexbuf) }
| "&" { BIT_AND(pos lexbuf) }