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

Side by Side Diff: frog/scripts/corejs_gen.py

Issue 10548047: Remove frog from the repository. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix SDK dartdoc/frog. Created 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
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.
4 from token_info import tokens, keywords
5 from codegen import CodeWriter
6
7 EXCLUDES = ['$add']
8
9 def main():
10 '''Generates the TokenKind class into token_kind.g.dart.'''
11 cw = CodeWriter(__file__)
12 for tok in tokens:
13 if tok.methodName is not None and tok.methodName not in EXCLUDES:
14 dname = repr(tok.methodName).replace('$', '\\$')
15 cw.enterBlock('function %s(x, y) {' % tok.methodName)
16 cw.writeln("return (typeof(x) == 'number' && typeof(y) == 'number')")
17 cw.writeln(' ? x %s y : x.%s(y);' % (tok.text, tok.methodName))
18 cw.exitBlock('}')
19
20 cw.writeToFile('tests/core.g.js')
21
22 if __name__ == '__main__': main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698