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

Unified Diff: mojo/public/bindings/pylib/parse/mojo_lexer.py

Issue 221953005: Mojo: Mojom: Add basic lexer tests, and remove hex float constants. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « no previous file | mojo/public/bindings/pylib/parse/mojo_lexer_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/pylib/parse/mojo_lexer.py
diff --git a/mojo/public/bindings/pylib/parse/mojo_lexer.py b/mojo/public/bindings/pylib/parse/mojo_lexer.py
index 101b79c222a8b37759adea3333960106c8911003..16f84b64c58dc755303b85869d4bcc70ef55b2f6 100644
--- a/mojo/public/bindings/pylib/parse/mojo_lexer.py
+++ b/mojo/public/bindings/pylib/parse/mojo_lexer.py
@@ -78,7 +78,7 @@ class Lexer(object):
# Constants
'ORDINAL',
'INT_CONST_DEC', 'INT_CONST_OCT', 'INT_CONST_HEX',
- 'FLOAT_CONST', 'HEX_FLOAT_CONST',
+ 'FLOAT_CONST',
'CHAR_CONST',
# String literals
@@ -154,13 +154,7 @@ class Lexer(object):
fractional_constant = r"""([0-9]*\.[0-9]+)|([0-9]+\.)"""
floating_constant = \
'(((('+fractional_constant+')'+ \
- exponent_part+'?)|([0-9]+'+exponent_part+'))[FfLl]?)'
- binary_exponent_part = r'''([pP][+-]?[0-9]+)'''
- hex_fractional_constant = \
- '((('+hex_digits+r""")?\."""+hex_digits+')|('+hex_digits+r"""\.))"""
- hex_floating_constant = \
- '('+hex_prefix+'('+hex_digits+'|'+hex_fractional_constant+')'+ \
- binary_exponent_part+'[FfLl]?)'
+ exponent_part+'?)|([0-9]+'+exponent_part+')))'
# Ordinals
ordinal = r'@[0-9]+'
@@ -222,10 +216,6 @@ class Lexer(object):
def t_FLOAT_CONST(self, t):
return t
- @TOKEN(hex_floating_constant)
- def t_HEX_FLOAT_CONST(self, t):
- return t
-
@TOKEN(hex_constant)
def t_INT_CONST_HEX(self, t):
return t
« no previous file with comments | « no previous file | mojo/public/bindings/pylib/parse/mojo_lexer_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698