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

Side by Side Diff: mojo/public/tools/bindings/pylib/mojom/parse/parser.py

Issue 296613002: Mojo: Mojom: The handle type can/should be a NAME not an identifier. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Generates a syntax tree from a Mojo IDL file.""" 5 """Generates a syntax tree from a Mojo IDL file."""
6 6
7 import imp 7 import imp
8 import os.path 8 import os.path
9 import sys 9 import sys
10 10
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 | array""" 191 | array"""
192 p[0] = p[1] 192 p[0] = p[1]
193 193
194 def p_basictypename(self, p): 194 def p_basictypename(self, p):
195 """basictypename : identifier 195 """basictypename : identifier
196 | handletype""" 196 | handletype"""
197 p[0] = p[1] 197 p[0] = p[1]
198 198
199 def p_handletype(self, p): 199 def p_handletype(self, p):
200 """handletype : HANDLE 200 """handletype : HANDLE
201 | HANDLE LANGLE identifier RANGLE""" 201 | HANDLE LANGLE NAME RANGLE"""
202 if len(p) == 2: 202 if len(p) == 2:
203 p[0] = p[1] 203 p[0] = p[1]
204 else: 204 else:
205 if p[3] not in ('data_pipe_consumer', 205 if p[3] not in ('data_pipe_consumer',
206 'data_pipe_producer', 206 'data_pipe_producer',
207 'message_pipe', 207 'message_pipe',
208 'shared_buffer'): 208 'shared_buffer'):
209 # Note: We don't enable tracking of line numbers for everything, so we 209 # Note: We don't enable tracking of line numbers for everything, so we
210 # can't use |p.lineno(3)|. 210 # can't use |p.lineno(3)|.
211 raise ParseError(self.filename, "Invalid handle type %r:" % p[3], 211 raise ParseError(self.filename, "Invalid handle type %r:" % p[3],
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 364
365 def Parse(source, filename): 365 def Parse(source, filename):
366 lexer = Lexer(filename) 366 lexer = Lexer(filename)
367 parser = Parser(lexer, source, filename) 367 parser = Parser(lexer, source, filename)
368 368
369 lex.lex(object=lexer) 369 lex.lex(object=lexer)
370 yacc.yacc(module=parser, debug=0, write_tables=0) 370 yacc.yacc(module=parser, debug=0, write_tables=0)
371 371
372 tree = yacc.parse(source) 372 tree = yacc.parse(source)
373 return tree 373 return tree
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