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

Side by Side Diff: lib/dom/scripts/idlparser.py

Issue 10831190: Allow spaces in ext attr values. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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/python 1 #!/usr/bin/python
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 import re 6 import re
7 import subprocess 7 import subprocess
8 import tempfile 8 import tempfile
9 9
10 from pegparser import * 10 from pegparser import *
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 return re.compile(r'[\w\_\:\.\<\>]+') 351 return re.compile(r'[\w\_\:\.\<\>]+')
352 352
353 # Extended Attributes: 353 # Extended Attributes:
354 def ExtAttrs(): 354 def ExtAttrs():
355 return ['[', MAYBE(MANY(ExtAttr, ',')), ']'] 355 return ['[', MAYBE(MANY(ExtAttr, ',')), ']']
356 356
357 def ExtAttr(): 357 def ExtAttr():
358 return [Id, MAYBE(OR(['=', ExtAttrValue], ExtAttrArgList))] 358 return [Id, MAYBE(OR(['=', ExtAttrValue], ExtAttrArgList))]
359 359
360 def ExtAttrValue(): 360 def ExtAttrValue():
361 return OR(ExtAttrFunctionValue, re.compile(r'[\w&0-9:\-\|]+')) 361 return OR(ExtAttrFunctionValue, re.compile(r'[\w&0-9:\-\| ]+'))
362 362
363 def ExtAttrFunctionValue(): 363 def ExtAttrFunctionValue():
364 return [Id, ExtAttrArgList] 364 return [Id, ExtAttrArgList]
365 365
366 def ExtAttrArgList(): 366 def ExtAttrArgList():
367 return ['(', MAYBE(MANY(Argument, ',')), ')'] 367 return ['(', MAYBE(MANY(Argument, ',')), ')']
368 368
369 # Annotations - used in the FremontCut IDL grammar: 369 # Annotations - used in the FremontCut IDL grammar:
370 def _Annotations(): 370 def _Annotations():
371 return MANY(Annotation) 371 return MANY(Annotation)
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 Args: 430 Args:
431 content -- text to parse. 431 content -- text to parse.
432 defines -- an array of pre-processor defines. 432 defines -- an array of pre-processor defines.
433 includePaths -- an array of path strings used by the 433 includePaths -- an array of path strings used by the
434 gcc pre-processor. 434 gcc pre-processor.
435 """ 435 """
436 if self._syntax == WEBKIT_SYNTAX: 436 if self._syntax == WEBKIT_SYNTAX:
437 content = self._pre_process(content, defines, includePaths) 437 content = self._pre_process(content, defines, includePaths)
438 438
439 return self._pegparser.parse(content) 439 return self._pegparser.parse(content)
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