Chromium Code Reviews

Unified Diff: ppapi/generators/idl_lexer.py

Issue 9359040: WIP IDL-IPC2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Checkpoint before going back to returning ListValue via ExtensionMsg_Response. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « ppapi/generators/apps_example.py ('k') | ppapi/generators/idl_parser.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ppapi/generators/apps_example.py ('k') | ppapi/generators/idl_parser.py » ('j') | no next file with comments »

Powered by Google App Engine