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

Side by Side Diff: Source/bindings/scripts/blink_idl_parser.py

Issue 336733002: IDL parser: drop AttributeOrOperation and StaticAttribute overrides (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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
« 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 (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 """IntegerLiteral : integer""" 233 """IntegerLiteral : integer"""
234 p[0] = ListFromConcat(self.BuildAttribute('TYPE', 'integer'), 234 p[0] = ListFromConcat(self.BuildAttribute('TYPE', 'integer'),
235 self.BuildAttribute('NAME', p[1])) 235 self.BuildAttribute('NAME', p[1]))
236 236
237 # [b27.2] 237 # [b27.2]
238 def p_StringLiteral(self, p): 238 def p_StringLiteral(self, p):
239 """StringLiteral : string""" 239 """StringLiteral : string"""
240 p[0] = ListFromConcat(self.BuildAttribute('TYPE', 'DOMString'), 240 p[0] = ListFromConcat(self.BuildAttribute('TYPE', 'DOMString'),
241 self.BuildAttribute('NAME', p[1])) 241 self.BuildAttribute('NAME', p[1]))
242 242
243 # [b30] Add StaticAttribute
244 def p_AttributeOrOperation(self, p):
245 """AttributeOrOperation : STRINGIFIER StringifierAttributeOrOperation
246 | Attribute
247 | StaticAttribute
248 | Operation"""
249 # Standard is (no StaticAttribute):
250 # AttributeOrOperation : STRINGIFIER StringifierAttributeOrOperation
251 # | Attribute
252 # | Operation
253 if len(p) > 2:
254 # FIXME: Clearer to add stringifier property here, as:
255 # p[2].AddChildren(self.BuildTrue('STRINGIFIER'))
256 # Fix when actually implementing stringifiers.
257 p[0] = p[2]
258 else:
259 p[0] = p[1]
260
261 # [b30.1]
262 def p_StaticAttribute(self, p):
263 """StaticAttribute : STATIC Attribute"""
264 p[2].AddChildren(self.BuildTrue('STATIC'))
265 p[0] = p[2]
266
267 # [b47] 243 # [b47]
268 def p_ExceptionMember(self, p): 244 def p_ExceptionMember(self, p):
269 """ExceptionMember : Const 245 """ExceptionMember : Const
270 | ExceptionField 246 | ExceptionField
271 | Attribute 247 | Attribute
272 | ExceptionOperation""" 248 | ExceptionOperation"""
273 # Standard is (no Attribute, no ExceptionOperation): 249 # Standard is (no Attribute, no ExceptionOperation):
274 # ExceptionMember : Const 250 # ExceptionMember : Const
275 # | ExceptionField 251 # | ExceptionField
276 # FIXME: In DOMException.idl, Attributes should be changed to 252 # FIXME: In DOMException.idl, Attributes should be changed to
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 try: 437 try:
462 outputdir = argv[1] 438 outputdir = argv[1]
463 except IndexError as err: 439 except IndexError as err:
464 print 'Usage: %s OUTPUT_DIR' % argv[0] 440 print 'Usage: %s OUTPUT_DIR' % argv[0]
465 return 1 441 return 1
466 parser = BlinkIDLParser(outputdir=outputdir) 442 parser = BlinkIDLParser(outputdir=outputdir)
467 443
468 444
469 if __name__ == '__main__': 445 if __name__ == '__main__':
470 sys.exit(main(sys.argv)) 446 sys.exit(main(sys.argv))
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