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

Side by Side Diff: mojo/public/bindings/pylib/parse/mojo_parser.py

Issue 149703003: Mojo: Remove '*' from the list of unary operators in mojom expressions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Generates a syntax tree from a Mojo IDL file.""" 6 """Generates a syntax tree from a Mojo IDL file."""
7 7
8 8
9 import sys 9 import sys
10 import os.path 10 import os.path
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 | LAND 247 | LAND
248 | LOR""" 248 | LOR"""
249 p[0] = p[1] 249 p[0] = p[1]
250 250
251 def p_unary_expression(self, p): 251 def p_unary_expression(self, p):
252 """unary_expression : primary_expression 252 """unary_expression : primary_expression
253 | unary_operator expression""" 253 | unary_operator expression"""
254 p[0] = ''.join(p[1:]) 254 p[0] = ''.join(p[1:])
255 255
256 def p_unary_operator(self, p): 256 def p_unary_operator(self, p):
257 """unary_operator : TIMES 257 """unary_operator : PLUS
258 | PLUS
259 | MINUS 258 | MINUS
260 | NOT 259 | NOT
261 | LNOT""" 260 | LNOT"""
262 p[0] = p[1] 261 p[0] = p[1]
263 262
264 def p_primary_expression(self, p): 263 def p_primary_expression(self, p):
265 """primary_expression : constant 264 """primary_expression : constant
266 | NAME 265 | NAME
267 | LPAREN expression RPAREN""" 266 | LPAREN expression RPAREN"""
268 p[0] = ''.join(p[1:]) 267 p[0] = ''.join(p[1:])
(...skipping 28 matching lines...) Expand all
297 def Main(): 296 def Main():
298 if len(sys.argv) < 2: 297 if len(sys.argv) < 2:
299 print("usage: %s filename" % (sys.argv[0])) 298 print("usage: %s filename" % (sys.argv[0]))
300 sys.exit(1) 299 sys.exit(1)
301 tree = Parse(filename=sys.argv[1]) 300 tree = Parse(filename=sys.argv[1])
302 print(tree) 301 print(tree)
303 302
304 303
305 if __name__ == '__main__': 304 if __name__ == '__main__':
306 Main() 305 Main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698