summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Scanner.l
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Slice/Scanner.l')
-rw-r--r--cpp/src/Slice/Scanner.l15
1 files changed, 14 insertions, 1 deletions
diff --git a/cpp/src/Slice/Scanner.l b/cpp/src/Slice/Scanner.l
index 24ee3543b04..f9a5df88a42 100644
--- a/cpp/src/Slice/Scanner.l
+++ b/cpp/src/Slice/Scanner.l
@@ -185,7 +185,19 @@ floating_literal (({fractional_constant}{exponent_part}?)|((\+|-)?[[:digit:]]+{e
{
return ICE_IDENT_OP;
}
- return checkKeyword(ident->v) == ICE_IDENTIFIER ? ICE_IDENT_OP : ICE_KEYWORD_OP;
+ int st = checkKeyword(ident->v);
+ if(st == ICE_IDENTIFIER)
+ {
+ return ICE_IDENT_OP;
+ }
+ else if(st == ICE_OPTIONAL)
+ {
+ return ICE_OPTIONAL_OP;
+ }
+ else
+ {
+ return ICE_KEYWORD_OP;
+ }
}
{identifier} {
@@ -477,6 +489,7 @@ initScanner()
keywordMap["false"] = ICE_FALSE;
keywordMap["true"] = ICE_TRUE;
keywordMap["idempotent"] = ICE_IDEMPOTENT;
+ keywordMap["optional"] = ICE_OPTIONAL;
}
//