Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: ppapi/generators/idl_lexer.py

Issue 9388002: Add support for Chrome Apps to IDL lexer/parser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed apps_tests from this CL, will put them back in when we move generators to new location in t… Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/api/dev/pp_cursor_type_dev.idl ('k') | ppapi/generators/idl_node.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..d45a4b8ea425110e3314946a42f844c98a565602 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[ \t]*//.*)*)'
self.AddLines(t.value.count('\n'))
return t
« no previous file with comments | « ppapi/api/dev/pp_cursor_type_dev.idl ('k') | ppapi/generators/idl_node.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698