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

Side by Side Diff: pkg/analyzer/lib/src/generated/html.dart

Issue 680863002: Remove JavaStringBuilder (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.html; 8 library engine.html;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 } 1494 }
1495 // This will create ArrayList for exactly given number of elements. 1495 // This will create ArrayList for exactly given number of elements.
1496 return new List.from(children); 1496 return new List.from(children);
1497 } 1497 }
1498 return children; 1498 return children;
1499 } 1499 }
1500 1500
1501 /** 1501 /**
1502 * This method exists for debugging purposes only. 1502 * This method exists for debugging purposes only.
1503 */ 1503 */
1504 void _appendIdentifier(JavaStringBuilder builder, XmlNode node) { 1504 void _appendIdentifier(StringBuffer buffer, XmlNode node) {
1505 if (node is XmlTagNode) { 1505 if (node is XmlTagNode) {
1506 builder.append(node.tag); 1506 buffer.write(node.tag);
1507 } else if (node is XmlAttributeNode) { 1507 } else if (node is XmlAttributeNode) {
1508 builder.append(node.name); 1508 buffer.write(node.name);
1509 } else { 1509 } else {
1510 builder.append("htmlUnit"); 1510 buffer.write("htmlUnit");
1511 } 1511 }
1512 } 1512 }
1513 1513
1514 /** 1514 /**
1515 * This method exists for debugging purposes only. 1515 * This method exists for debugging purposes only.
1516 */ 1516 */
1517 String _buildRecursiveStructureMessage(XmlNode newParent) { 1517 String _buildRecursiveStructureMessage(XmlNode newParent) {
1518 JavaStringBuilder builder = new JavaStringBuilder(); 1518 StringBuffer buffer = new StringBuffer();
1519 builder.append("Attempt to create recursive structure: "); 1519 buffer.write("Attempt to create recursive structure: ");
1520 XmlNode current = newParent; 1520 XmlNode current = newParent;
1521 while (current != null) { 1521 while (current != null) {
1522 if (!identical(current, newParent)) { 1522 if (!identical(current, newParent)) {
1523 builder.append(" -> "); 1523 buffer.write(" -> ");
1524 } 1524 }
1525 if (identical(current, this)) { 1525 if (identical(current, this)) {
1526 builder.appendChar(0x2A); 1526 buffer.writeCharCode(0x2A);
1527 _appendIdentifier(builder, current); 1527 _appendIdentifier(buffer, current);
1528 builder.appendChar(0x2A); 1528 buffer.writeCharCode(0x2A);
1529 } else { 1529 } else {
1530 _appendIdentifier(builder, current); 1530 _appendIdentifier(buffer, current);
1531 } 1531 }
1532 current = current.parent; 1532 current = current.parent;
1533 } 1533 }
1534 return builder.toString(); 1534 return buffer.toString();
1535 } 1535 }
1536 1536
1537 /** 1537 /**
1538 * Set the parent of this node to the given node. 1538 * Set the parent of this node to the given node.
1539 * 1539 *
1540 * @param newParent the node that is to be made the parent of this node 1540 * @param newParent the node that is to be made the parent of this node
1541 */ 1541 */
1542 void set parent(XmlNode newParent) { 1542 void set parent(XmlNode newParent) {
1543 XmlNode current = newParent; 1543 XmlNode current = newParent;
1544 while (current != null) { 1544 while (current != null) {
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1945 */ 1945 */
1946 String getAttributeText(String name) { 1946 String getAttributeText(String name) {
1947 XmlAttributeNode attribute = getAttribute(name); 1947 XmlAttributeNode attribute = getAttribute(name);
1948 return attribute != null ? attribute.text : null; 1948 return attribute != null ? attribute.text : null;
1949 } 1949 }
1950 1950
1951 @override 1951 @override
1952 Token get beginToken => nodeStart; 1952 Token get beginToken => nodeStart;
1953 1953
1954 /** 1954 /**
1955 * Answer a string representing the content contained in the receiver. This in cludes the textual 1955 * Return a string representing the content contained in the receiver. This
1956 * representation of any child tag nodes ([getTagNodes]). Whitespace between ' <', 1956 * includes the textual representation of any child tag nodes ([getTagNodes]).
1957 * '</', and '>', '/>' is discarded, but all other whitespace is preserved. 1957 * Whitespace between '<', '</', and '>', '/>' is discarded, but all
1958 * 1958 * other whitespace is preserved.
1959 * @return the content (not `null`)
1960 */ 1959 */
1961 String get content { 1960 String get content {
1962 Token token = attributeEnd.next; 1961 Token token = attributeEnd.next;
1963 if (identical(token, contentEnd)) { 1962 if (identical(token, contentEnd)) {
1964 return ""; 1963 return "";
1965 } 1964 }
1966 //TODO (danrubel): handle CDATA and replace HTML character encodings with th e actual characters 1965 // TODO(danrubel) Handle CDATA and replace HTML character encodings with
1966 // the actual characters.
1967 String content = token.lexeme; 1967 String content = token.lexeme;
1968 token = token.next; 1968 token = token.next;
1969 if (identical(token, contentEnd)) { 1969 if (identical(token, contentEnd)) {
1970 return content; 1970 return content;
1971 } 1971 }
1972 JavaStringBuilder buffer = new JavaStringBuilder(); 1972 StringBuffer buffer = new StringBuffer();
1973 buffer.append(content); 1973 buffer.write(content);
1974 while (!identical(token, contentEnd)) { 1974 while (!identical(token, contentEnd)) {
1975 buffer.append(token.lexeme); 1975 buffer.write(token.lexeme);
1976 token = token.next; 1976 token = token.next;
1977 } 1977 }
1978 return buffer.toString(); 1978 return buffer.toString();
1979 } 1979 }
1980 1980
1981 @override 1981 @override
1982 Token get endToken { 1982 Token get endToken {
1983 if (nodeEnd != null) { 1983 if (nodeEnd != null) {
1984 return nodeEnd; 1984 return nodeEnd;
1985 } 1985 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
2040 */ 2040 */
2041 abstract class XmlVisitor<R> { 2041 abstract class XmlVisitor<R> {
2042 R visitHtmlScriptTagNode(HtmlScriptTagNode node); 2042 R visitHtmlScriptTagNode(HtmlScriptTagNode node);
2043 2043
2044 R visitHtmlUnit(HtmlUnit htmlUnit); 2044 R visitHtmlUnit(HtmlUnit htmlUnit);
2045 2045
2046 R visitXmlAttributeNode(XmlAttributeNode xmlAttributeNode); 2046 R visitXmlAttributeNode(XmlAttributeNode xmlAttributeNode);
2047 2047
2048 R visitXmlTagNode(XmlTagNode xmlTagNode); 2048 R visitXmlTagNode(XmlTagNode xmlTagNode);
2049 } 2049 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698