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

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: fixed reduce conflicts and allowed use of callback as identifier 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
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//.*)*)'
noelallen1 2012/02/28 22:31:33 Isn't this missing indentation/whitespace between
asargent_no_longer_on_chrome 2012/03/03 01:12:02 Done.
self.AddLines(t.value.count('\n'))
return t

Powered by Google App Engine
This is Rietveld 408576698