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

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

Issue 969113002: Reformat (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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_tools.dart ('k') | pkg/analysis_server/tool/spec/html_tools.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/tool/spec/from_html.dart
diff --git a/pkg/analysis_server/tool/spec/from_html.dart b/pkg/analysis_server/tool/spec/from_html.dart
index 5b27e176cb2c29d02d81ef330778a3a9b7c98d24..6578a8a3d73a60cafd094a39757a10b40b73e1a3 100644
--- a/pkg/analysis_server/tool/spec/from_html.dart
+++ b/pkg/analysis_server/tool/spec/from_html.dart
@@ -16,28 +16,29 @@ import 'api.dart';
import 'html_tools.dart';
const List<String> specialElements = const [
- 'domain',
- 'feedback',
- 'object',
- 'refactorings',
- 'refactoring',
- 'type',
- 'types',
- 'request',
- 'notification',
- 'params',
- 'result',
- 'field',
- 'list',
- 'map',
- 'enum',
- 'key',
- 'value',
- 'options',
- 'ref',
- 'code',
- 'version',
- 'union'];
+ 'domain',
+ 'feedback',
+ 'object',
+ 'refactorings',
+ 'refactoring',
+ 'type',
+ 'types',
+ 'request',
+ 'notification',
+ 'params',
+ 'result',
+ 'field',
+ 'list',
+ 'map',
+ 'enum',
+ 'key',
+ 'value',
+ 'options',
+ 'ref',
+ 'code',
+ 'version',
+ 'union'
+];
/**
* Create an [Api] object from an HTML representation such as:
@@ -86,9 +87,9 @@ Api apiFromHtml(dom.Element html) {
* [requiredAttributes], possibly some of the attributes in
* [optionalAttributes], and no others.
*/
-void checkAttributes(dom.Element element, List<String> requiredAttributes,
- String context, {List<String> optionalAttributes: const [
- ]}) {
+void checkAttributes(
+ dom.Element element, List<String> requiredAttributes, String context,
+ {List<String> optionalAttributes: const []}) {
Set<String> attributesFound = new Set<String>();
element.attributes.forEach((String name, String value) {
if (!requiredAttributes.contains(name) &&
@@ -290,8 +291,8 @@ Api readApi() {
return apiFromHtml(document.firstChild);
}
-void recurse(dom.Element parent, String context, Map<String,
- ElementProcessor> elementProcessors) {
+void recurse(dom.Element parent, String context,
+ Map<String, ElementProcessor> elementProcessors) {
for (String key in elementProcessors.keys) {
if (!specialElements.contains(key)) {
throw new Exception('$context: $key is not a special element');
@@ -476,10 +477,7 @@ TypeObjectField typeObjectFieldFromHtml(dom.Element html, String context) {
String name = html.attributes['name'];
context = '$context.${name != null ? name : 'field'}';
checkAttributes(
- html,
- ['name'],
- context,
- optionalAttributes: ['optional', 'value']);
+ html, ['name'], context, optionalAttributes: ['optional', 'value']);
bool optional = false;
String optionalString = html.attributes['optional'];
if (optionalString != null) {
@@ -497,12 +495,8 @@ TypeObjectField typeObjectFieldFromHtml(dom.Element html, String context) {
}
String value = html.attributes['value'];
TypeDecl type = processContentsAsType(html, context);
- return new TypeObjectField(
- name,
- type,
- html,
- optional: optional,
- value: value);
+ return new TypeObjectField(name, type, html,
+ optional: optional, value: value);
}
/**
« no previous file with comments | « pkg/analysis_server/tool/spec/codegen_tools.dart ('k') | pkg/analysis_server/tool/spec/html_tools.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698