summaryrefslogtreecommitdiffstats
path: root/src/lexer.mll
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2016-10-11 10:48:02 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2016-10-11 11:11:06 +0200
commit712f0891d18e6230c2f53f4d1ff9231d95e3c3cd (patch)
tree33fd1c1313e739bf69520bb188523d64b526eec8 /src/lexer.mll
parent67c46ecfebf9af723b56e41c8ebdee375f43df68 (diff)
downloadperl_checker-712f0891d18e6230c2f53f4d1ff9231d95e3c3cd.tar
perl_checker-712f0891d18e6230c2f53f4d1ff9231d95e3c3cd.tar.gz
perl_checker-712f0891d18e6230c2f53f4d1ff9231d95e3c3cd.tar.bz2
perl_checker-712f0891d18e6230c2f53f4d1ff9231d95e3c3cd.tar.xz
perl_checker-712f0891d18e6230c2f53f4d1ff9231d95e3c3cd.zip
recognize ~~ (smartmatch)
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) }