| OLD | NEW |
| 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.testing.html_factory; | 8 library engine.testing.html_factory; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/html.dart'; | 10 import 'package:analyzer/src/generated/html.dart'; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 | 26 |
| 27 static Token ltToken() { | 27 static Token ltToken() { |
| 28 return new Token.con1(TokenType.LT, 0); | 28 return new Token.con1(TokenType.LT, 0); |
| 29 } | 29 } |
| 30 | 30 |
| 31 static Token ltsToken() { | 31 static Token ltsToken() { |
| 32 return new Token.con1(TokenType.LT_SLASH, 0); | 32 return new Token.con1(TokenType.LT_SLASH, 0); |
| 33 } | 33 } |
| 34 | 34 |
| 35 static HtmlScriptTagNode scriptTag(List<XmlAttributeNode> attributes) { | 35 static HtmlScriptTagNode scriptTag([List<XmlAttributeNode> attributes = XmlAtt
ributeNode.EMPTY_LIST]) { |
| 36 return new HtmlScriptTagNode( | 36 return new HtmlScriptTagNode( |
| 37 ltToken(), | 37 ltToken(), |
| 38 stringToken("script"), | 38 stringToken("script"), |
| 39 attributes, | 39 attributes, |
| 40 sgtToken(), | 40 sgtToken(), |
| 41 null, | 41 null, |
| 42 null, | 42 null, |
| 43 null, | 43 null, |
| 44 null); | 44 null); |
| 45 } | 45 } |
| 46 | 46 |
| 47 static HtmlScriptTagNode scriptTagWithContent(String contents, | 47 static HtmlScriptTagNode scriptTagWithContent(String contents, |
| 48 List<XmlAttributeNode> attributes) { | 48 [List<XmlAttributeNode> attributes = XmlAttributeNode.EMPTY_LIST]) { |
| 49 Token attributeEnd = gtToken(); | 49 Token attributeEnd = gtToken(); |
| 50 Token contentToken = stringToken(contents); | 50 Token contentToken = stringToken(contents); |
| 51 attributeEnd.setNext(contentToken); | 51 attributeEnd.setNext(contentToken); |
| 52 Token contentEnd = ltsToken(); | 52 Token contentEnd = ltsToken(); |
| 53 contentToken.setNext(contentEnd); | 53 contentToken.setNext(contentEnd); |
| 54 return new HtmlScriptTagNode( | 54 return new HtmlScriptTagNode( |
| 55 ltToken(), | 55 ltToken(), |
| 56 stringToken("script"), | 56 stringToken("script"), |
| 57 attributes, | 57 attributes, |
| 58 attributeEnd, | 58 attributeEnd, |
| 59 null, | 59 null, |
| 60 contentEnd, | 60 contentEnd, |
| 61 stringToken("script"), | 61 stringToken("script"), |
| 62 gtToken()); | 62 gtToken()); |
| 63 } | 63 } |
| 64 | 64 |
| 65 static Token sgtToken() { | 65 static Token sgtToken() { |
| 66 return new Token.con1(TokenType.SLASH_GT, 0); | 66 return new Token.con1(TokenType.SLASH_GT, 0); |
| 67 } | 67 } |
| 68 | 68 |
| 69 static Token stringToken(String value) { | 69 static Token stringToken(String value) { |
| 70 return new Token.con2(TokenType.STRING, 0, value); | 70 return new Token.con2(TokenType.STRING, 0, value); |
| 71 } | 71 } |
| 72 | 72 |
| 73 static XmlTagNode tagNode(String name, List<XmlAttributeNode> attributes) { | 73 static XmlTagNode tagNode(String name, [List<XmlAttributeNode> attributes = Xm
lAttributeNode.EMPTY_LIST]) { |
| 74 return new XmlTagNode( | 74 return new XmlTagNode( |
| 75 ltToken(), | 75 ltToken(), |
| 76 stringToken(name), | 76 stringToken(name), |
| 77 attributes, | 77 attributes, |
| 78 sgtToken(), | 78 sgtToken(), |
| 79 null, | 79 null, |
| 80 null, | 80 null, |
| 81 null, | 81 null, |
| 82 null); | 82 null); |
| 83 } | 83 } |
| 84 } | 84 } |
| OLD | NEW |