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 ltsToken() { | 27 static Token ltsToken() { |
28 return new Token.con1(TokenType.LT_SLASH, 0); | 28 return new Token.con1(TokenType.LT_SLASH, 0); |
29 } | 29 } |
30 | 30 |
31 static Token ltToken() { | 31 static Token ltToken() { |
32 return new Token.con1(TokenType.LT, 0); | 32 return new Token.con1(TokenType.LT, 0); |
33 } | 33 } |
34 | 34 |
35 static HtmlScriptTagNode scriptTag([List<XmlAttributeNode> attributes = | 35 static HtmlScriptTagNode scriptTag( |
36 XmlAttributeNode.EMPTY_LIST]) { | 36 [List<XmlAttributeNode> attributes = XmlAttributeNode.EMPTY_LIST]) { |
37 return new HtmlScriptTagNode( | 37 return new HtmlScriptTagNode(ltToken(), stringToken("script"), attributes, |
38 ltToken(), | 38 sgtToken(), null, null, null, null); |
39 stringToken("script"), | |
40 attributes, | |
41 sgtToken(), | |
42 null, | |
43 null, | |
44 null, | |
45 null); | |
46 } | 39 } |
47 | 40 |
48 static HtmlScriptTagNode scriptTagWithContent(String contents, | 41 static HtmlScriptTagNode scriptTagWithContent(String contents, |
49 [List<XmlAttributeNode> attributes = XmlAttributeNode.EMPTY_LIST]) { | 42 [List<XmlAttributeNode> attributes = XmlAttributeNode.EMPTY_LIST]) { |
50 Token attributeEnd = gtToken(); | 43 Token attributeEnd = gtToken(); |
51 Token contentToken = stringToken(contents); | 44 Token contentToken = stringToken(contents); |
52 attributeEnd.setNext(contentToken); | 45 attributeEnd.setNext(contentToken); |
53 Token contentEnd = ltsToken(); | 46 Token contentEnd = ltsToken(); |
54 contentToken.setNext(contentEnd); | 47 contentToken.setNext(contentEnd); |
55 return new HtmlScriptTagNode( | 48 return new HtmlScriptTagNode(ltToken(), stringToken("script"), attributes, |
56 ltToken(), | 49 attributeEnd, null, contentEnd, stringToken("script"), gtToken()); |
57 stringToken("script"), | |
58 attributes, | |
59 attributeEnd, | |
60 null, | |
61 contentEnd, | |
62 stringToken("script"), | |
63 gtToken()); | |
64 } | 50 } |
65 | 51 |
66 static Token sgtToken() { | 52 static Token sgtToken() { |
67 return new Token.con1(TokenType.SLASH_GT, 0); | 53 return new Token.con1(TokenType.SLASH_GT, 0); |
68 } | 54 } |
69 | 55 |
70 static Token stringToken(String value) { | 56 static Token stringToken(String value) { |
71 return new Token.con2(TokenType.STRING, 0, value); | 57 return new Token.con2(TokenType.STRING, 0, value); |
72 } | 58 } |
73 | 59 |
74 static XmlTagNode tagNode(String name, [List<XmlAttributeNode> attributes = | 60 static XmlTagNode tagNode(String name, |
75 XmlAttributeNode.EMPTY_LIST]) { | 61 [List<XmlAttributeNode> attributes = XmlAttributeNode.EMPTY_LIST]) { |
76 return new XmlTagNode( | 62 return new XmlTagNode(ltToken(), stringToken(name), attributes, sgtToken(), |
77 ltToken(), | 63 null, null, null, null); |
78 stringToken(name), | |
79 attributes, | |
80 sgtToken(), | |
81 null, | |
82 null, | |
83 null, | |
84 null); | |
85 } | 64 } |
86 } | 65 } |
OLD | NEW |