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

Unified Diff: frog/scripts/codegen.py

Issue 10548047: Remove frog from the repository. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move test and update apidoc.gyp. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « frog/scripts/bootstrap/frogc.bat ('k') | frog/scripts/corejs_gen.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/scripts/codegen.py
diff --git a/frog/scripts/codegen.py b/frog/scripts/codegen.py
deleted file mode 100644
index 6562460edbc848133461e5f4590fe8c80b7bc7d7..0000000000000000000000000000000000000000
--- a/frog/scripts/codegen.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-# TODO(jimhug): Move this and other gen files into Dart.
-
-HEADER = '''// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-// Generated by %s.
-
-'''
-
-EXT = '.g.dart'
-
-class CodeWriter:
- '''Helper class for generating source code. The main purpose right now
- is to keep track of indentation for pretty printing. In the future
- much more could be added here - but I'd rather wait until we can write
- this directly in Dart.
- '''
- def __init__(self, genfile):
- self._text = []
- self._indent = 0
- self._genfile = genfile
-
- def enterBlock(self, text=None):
- if text is not None: self.writeln(text)
- self._indent += 1
-
- def exitBlock(self, text=None):
- assert self._indent > 0
- self._indent -= 1
- if text is not None: self.writeln(text)
-
- def writeIndent(self):
- self._text.append(' ' * self._indent)
-
- def writeln(self, s=None, *args):
- if not s:
- self._text.append('\n')
- return
-
- self.writeIndent()
- if args:
- self._text.append(s % args)
- else:
- self._text.append(s)
- self._text.append('\n')
-
- def __str__(self):
- return ''.join(self._text)
-
- def writeToFile(self, filename):
- with open(filename + EXT, 'w') as f:
- f.write(HEADER % self._genfile)
- for line in self._text:
- f.write(line)
« no previous file with comments | « frog/scripts/bootstrap/frogc.bat ('k') | frog/scripts/corejs_gen.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698