Index: ppapi/generators/idl_lexer.py |
diff --git a/ppapi/generators/idl_lexer.py b/ppapi/generators/idl_lexer.py |
index d33414c3daf0cc38d5ca66f5a15e1755b3a3aeae..d2414ced19eda3b29c2fa846cadf3ec3a35f4e1b 100755 |
--- a/ppapi/generators/idl_lexer.py |
+++ b/ppapi/generators/idl_lexer.py |
@@ -55,6 +55,16 @@ class IDLLexer(object): |
'STRUCT', |
'TYPEDEF', |
+ # Extra WebIDL keywords |
+ 'CALLBACK', |
+ 'DICTIONARY', |
+ 'OPTIONAL', |
+ 'STATIC', |
+ |
+ # Invented for apps use |
+ 'NAMESPACE', |
+ |
+ |
# Data types |
'FLOAT', |
'OCT', |
@@ -77,11 +87,17 @@ class IDLLexer(object): |
'readonly' : 'READONLY', |
'struct' : 'STRUCT', |
'typedef' : 'TYPEDEF', |
+ |
+ 'callback' : 'CALLBACK', |
+ 'dictionary' : 'DICTIONARY', |
+ 'optional' : 'OPTIONAL', |
+ 'static' : 'STATIC', |
+ 'namespace' : 'NAMESPACE', |
} |
# 'literals' is a value expected by lex which specifies a list of valid |
# literal tokens, meaning the token type and token value are identical. |
- literals = '"*.(){}[],;:=+-/~|&^' |
+ literals = '"*.(){}[],;:=+-/~|&^?' |
# Token definitions |
# |
@@ -116,7 +132,7 @@ class IDLLexer(object): |
# A C or C++ style comment: /* xxx */ or // |
def t_COMMENT(self, t): |
- r'(/\*(.|\n)*?\*/)|(//.*)' |
+ r'(/\*(.|\n)*?\*/)|(//.*(\n//.*)*)' |
self.AddLines(t.value.count('\n')) |
return t |