aboutsummaryrefslogtreecommitdiff
path: root/frontend/scanner.icl
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/scanner.icl')
-rw-r--r--frontend/scanner.icl17
1 files changed, 16 insertions, 1 deletions
diff --git a/frontend/scanner.icl b/frontend/scanner.icl
index 0df9ee7..911a127 100644
--- a/frontend/scanner.icl
+++ b/frontend/scanner.icl
@@ -135,6 +135,7 @@ ScanOptionNoNewOffsideForSeqLetBit:==4;
| DoubleBackSlashToken // \\
| LeftArrowToken // <-
| LeftArrowColonToken // <-:
+ | LeftArrowWithBarToken // <|-
| DotDotToken // ..
| AndToken // &
| HashToken // #
@@ -660,7 +661,20 @@ Scan c0=:'<' input TypeContext
Scan c0=:'<' input co
# (eof, c1, input) = ReadNormalChar input
| eof = (IdentToken "<", input)
- | c1 <> '-' = ScanOperator 0 (charBack input) [c0] co
+ | c1 <> '-'
+ | c1<>'|'
+ = ScanOperator 0 (charBack input) [c0] co
+ # (eof, c2, input) = ReadNormalChar input
+ | eof
+ = (IdentToken "<|",input)
+ | c2=='-'
+ # (eof, c3, input) = ReadNormalChar input
+ | eof = (LeftArrowWithBarToken, input)
+ | isSpecialChar c3 = ScanOperator 3 input [c3, c2, c1, c0] co
+ = (LeftArrowWithBarToken, charBack input)
+ | isSpecialChar c2
+ = ScanOperator 2 input [c2, c1, c0] co
+ = (IdentToken "<|", charBack input)
# (eof, c2, input) = ReadNormalChar input
| eof = (LeftArrowToken, input)
| c2 == ':'
@@ -1341,6 +1355,7 @@ where
toString DoubleBackSlashToken = "\\\\"
toString LeftArrowToken = "<-"
toString LeftArrowColonToken = "<-:"
+ toString LeftArrowWithBarToken = "<|-"
toString DotDotToken = ".."
toString AndToken = "&"
toString HashToken = "#"