LEFT | RIGHT |
1 // Copyright 2009 Google Inc. All Rights Reserved. | 1 // Copyright 2009 Google Inc. All Rights Reserved. |
2 // Licensed under the Apache License, Version 2.0 (the "License"); | 2 // Licensed under the Apache License, Version 2.0 (the "License"); |
3 // you may not use this file except in compliance with the License. | 3 // you may not use this file except in compliance with the License. |
4 // You may obtain a copy of the License at | 4 // You may obtain a copy of the License at |
5 // | 5 // |
6 // http://www.apache.org/licenses/LICENSE-2.0 | 6 // http://www.apache.org/licenses/LICENSE-2.0 |
7 // | 7 // |
8 // Unless required by applicable law or agreed to in writing, software | 8 // Unless required by applicable law or agreed to in writing, software |
9 // distributed under the License is distributed on an "AS IS" BASIS, | 9 // distributed under the License is distributed on an "AS IS" BASIS, |
10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 try { | 149 try { |
150 DomParser p = new DomParser(new HtmlLexer(cp), is, mq); | 150 DomParser p = new DomParser(new HtmlLexer(cp), is, mq); |
151 if (p.getTokenQueue().isEmpty()) { okToContinue = false; } | 151 if (p.getTokenQueue().isEmpty()) { okToContinue = false; } |
152 | 152 |
153 Document doc = DomParser.makeDocument(null, null); | 153 Document doc = DomParser.makeDocument(null, null); |
154 ParseTreeNode html = new Dom(p.parseFragment(doc)); | 154 ParseTreeNode html = new Dom(p.parseFragment(doc)); |
155 p.getTokenQueue().expectEmpty(); | 155 p.getTokenQueue().expectEmpty(); |
156 | 156 |
157 PluginCompiler compiler = new PluginCompiler(buildInfo, meta, mq); | 157 PluginCompiler compiler = new PluginCompiler(buildInfo, meta, mq); |
158 | 158 |
159 compiler.addInput(new AncestorChain<ParseTreeNode>(html)); | 159 compiler.addInput(AncestorChain.instance(html)); |
160 if (okToContinue) { | 160 if (okToContinue) { |
161 okToContinue &= compiler.run(); | 161 okToContinue &= compiler.run(); |
162 } | 162 } |
163 if (okToContinue) { | 163 if (okToContinue) { |
164 Node staticHtml = compiler.getStaticHtml(); | 164 Node staticHtml = compiler.getStaticHtml(); |
165 if (staticHtml != null) { | 165 if (staticHtml != null) { |
166 output.append(Nodes.render(staticHtml)); | 166 output.append(Nodes.render(staticHtml)); |
167 } | 167 } |
168 CajoledModule js = compiler.getJavascript(); | 168 CajoledModule js = compiler.getJavascript(); |
169 if (js != null) { | 169 if (js != null) { |
(...skipping 15 matching lines...) Expand all Loading... |
185 } | 185 } |
186 } catch (ParseException e) { | 186 } catch (ParseException e) { |
187 throw new UnsupportedContentTypeException(); | 187 throw new UnsupportedContentTypeException(); |
188 } catch (IllegalArgumentException e) { | 188 } catch (IllegalArgumentException e) { |
189 throw new UnsupportedContentTypeException(); | 189 throw new UnsupportedContentTypeException(); |
190 } catch (IOException e) { | 190 } catch (IOException e) { |
191 throw new UnsupportedContentTypeException(); | 191 throw new UnsupportedContentTypeException(); |
192 } | 192 } |
193 } | 193 } |
194 } | 194 } |
LEFT | RIGHT |