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

Side by Side Diff: pkg/polymer/lib/src/build/common.dart

Issue 211393006: Enables codegen support in polymer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « pkg/polymer/lib/deploy.dart ('k') | pkg/polymer/lib/src/build/linter.dart » ('j') | 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, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Common methods used by transfomers. 5 /// Common methods used by transfomers.
6 library polymer.src.build.common; 6 library polymer.src.build.common;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:math' show min, max; 9 import 'dart:math' show min, max;
10 10
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 var scanner = new Scanner(null, reader, errorListener); 181 var scanner = new Scanner(null, reader, errorListener);
182 var token = scanner.tokenize(); 182 var token = scanner.tokenize();
183 var parser = new Parser(null, errorListener); 183 var parser = new Parser(null, errorListener);
184 return parser.parseCompilationUnit(token); 184 return parser.parseCompilationUnit(token);
185 } 185 }
186 186
187 class _ErrorCollector extends AnalysisErrorListener { 187 class _ErrorCollector extends AnalysisErrorListener {
188 final errors = <AnalysisError>[]; 188 final errors = <AnalysisError>[];
189 onError(error) => errors.add(error); 189 onError(error) => errors.add(error);
190 } 190 }
191
192 /// These names have meaning in SVG or MathML, so they aren't allowed as custom
193 /// tags. See [isCustomTagName].
194 const invalidTagNames = const {
195 'annotation-xml': '',
196 'color-profile': '',
197 'font-face': '',
198 'font-face-src': '',
199 'font-face-uri': '',
200 'font-face-format': '',
201 'font-face-name': '',
202 'missing-glyph': '',
203 };
204
205 /// Returns true if this is a valid custom element name. See:
206 /// <http://w3c.github.io/webcomponents/spec/custom/#dfn-custom-element-type>
207 bool isCustomTagName(String name) {
208 if (name == null || !name.contains('-')) return false;
209 return !invalidTagNames.containsKey(name);
210 }
211
212 /// Regex to split names in the 'attributes' attribute, which supports 'a b c',
213 /// 'a,b,c', or even 'a b,c'. This is the same as in `lib/src/declaration.dart`.
214 final ATTRIBUTES_REGEX = new RegExp(r'\s|,');
OLDNEW
« no previous file with comments | « pkg/polymer/lib/deploy.dart ('k') | pkg/polymer/lib/src/build/linter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698