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

Unified Diff: pkg/analysis_server/tool/spec/codegen_tools.dart

Issue 463163002: Initial cut at generating the AnalysisServer.java interface. Currently this generates a commented o… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: nit Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/tool/spec/codegen_matchers.dart ('k') | pkg/analysis_server/tool/spec/generate_files » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/tool/spec/codegen_tools.dart
diff --git a/pkg/analysis_server/tool/spec/codegen_tools.dart b/pkg/analysis_server/tool/spec/codegen_tools.dart
index 2a0dda8bc621dd8f47a9963aa4b9cd6663d0ee9a..53db1dbeedd8a0c3dc758a0f40708768634920a2 100644
--- a/pkg/analysis_server/tool/spec/codegen_tools.dart
+++ b/pkg/analysis_server/tool/spec/codegen_tools.dart
@@ -106,17 +106,37 @@ class CodeGenerator {
* If [javadocStyle] is true, then the output is compatable with Javadoc,
* which understands certain HTML constructs.
*/
- void docComment(List<dom.Node> docs, bool javadocStyle) {
+ void docComment(List<dom.Node> docs, {int width: 79, bool javadocStyle: false}) {
writeln('/**');
indentBy(' * ', () {
- write(nodesToText(docs, 79 - _state.indent.length, javadocStyle));
+ write(nodesToText(docs, width - _state.indent.length, javadocStyle));
});
writeln(' */');
}
- void outputHeader() {
- String header =
- '''
+ void outputHeader({bool javaStyle: false}) {
+ String header;
+ if(javaStyle) {
+ header = '''
+/*
+ * Copyright (c) 2014, the Dart project authors.
+ *
+ * Licensed under the Eclipse Public License v1.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ *
+ * This file has been automatically generated. Please do not edit it manually.
+ * To regenerate the file, use the script "pkg/analysis_server/spec/generate_files".
+ */''';
+ }
+ else {
+ header = '''
// Copyright (c) 2014, 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.
@@ -125,8 +145,8 @@ class CodeGenerator {
// To regenerate the file, use the script
// "pkg/analysis_server/spec/generate_files".
''';
+ }
writeln(header.trim());
- writeln();
}
}
« no previous file with comments | « pkg/analysis_server/tool/spec/codegen_matchers.dart ('k') | pkg/analysis_server/tool/spec/generate_files » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698