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

Side by Side Diff: tools/idl_parser/idl_node.py

Issue 329853005: IDL parser: align with current Web IDL specification (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: rebased 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 | « tools/idl_parser/idl_lexer.py ('k') | tools/idl_parser/idl_parser.py » ('j') | 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 (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 import sys 6 import sys
7 7
8 # 8 #
9 # IDL Node 9 # IDL Node
10 # 10 #
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 for child in children: 194 for child in children:
195 if not child: 195 if not child:
196 continue 196 continue
197 if type(child) == IDLAttribute: 197 if type(child) == IDLAttribute:
198 self.SetProperty(child.name, child.value) 198 self.SetProperty(child.name, child.value)
199 continue 199 continue
200 if type(child) == IDLNode: 200 if type(child) == IDLNode:
201 child._parent = self 201 child._parent = self
202 self._children.append(child) 202 self._children.append(child)
203 continue 203 continue
204 raise RuntimeError('Adding child of type .\n' % type(child).__name__) 204 raise RuntimeError('Adding child of type %s.\n' % type(child).__name__)
205 205
206 206
207 # 207 #
208 # Property Functions 208 # Property Functions
209 # 209 #
210 def SetProperty(self, name, val): 210 def SetProperty(self, name, val):
211 self._properties[name] = val 211 self._properties[name] = val
212 212
213 def GetProperty(self, name, default=None): 213 def GetProperty(self, name, default=None):
214 return self._properties.get(name, default) 214 return self._properties.get(name, default)
215 215
216 def GetProperties(self): 216 def GetProperties(self):
217 return self._properties 217 return self._properties
OLDNEW
« no previous file with comments | « tools/idl_parser/idl_lexer.py ('k') | tools/idl_parser/idl_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698