LEFT | RIGHT |
1 // Copyright (C) 2008 Google Inc. | 1 // Copyright (C) 2008 Google Inc. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 originalSources.put(is, content); | 285 originalSources.put(is, content); |
286 } | 286 } |
287 return content; | 287 return content; |
288 } | 288 } |
289 | 289 |
290 private AncestorChain<?> parseInput(InputSource is, MessageQueue mq) | 290 private AncestorChain<?> parseInput(InputSource is, MessageQueue mq) |
291 throws IOException { | 291 throws IOException { |
292 CharProducer cp = CharProducer.Factory.create( | 292 CharProducer cp = CharProducer.Factory.create( |
293 new StringReader(getSourceContent(is)), is); | 293 new StringReader(getSourceContent(is)), is); |
294 try { | 294 try { |
295 return new AncestorChain<ParseTreeNode>( | 295 return AncestorChain.instance(PluginCompilerMain.parseInput(is, cp, mq)); |
296 PluginCompilerMain.parseInput(is, cp, mq)); | |
297 } catch (ParseException ex) { | 296 } catch (ParseException ex) { |
298 ex.toMessageQueue(mq); | 297 ex.toMessageQueue(mq); |
299 return null; | 298 return null; |
300 } | 299 } |
301 } | 300 } |
302 | 301 |
303 /** | 302 /** |
304 * Minifies inputs to output writing any messages to logger, returning true | 303 * Minifies inputs to output writing any messages to logger, returning true |
305 * iff the task passes. | 304 * iff the task passes. |
306 */ | 305 */ |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 } | 347 } |
349 } | 348 } |
350 outputWriter.close(); | 349 outputWriter.close(); |
351 return true; | 350 return true; |
352 } catch (IOException ex) { | 351 } catch (IOException ex) { |
353 logger.println("Innocent transform failed: " + ex); | 352 logger.println("Innocent transform failed: " + ex); |
354 return false; | 353 return false; |
355 } | 354 } |
356 } | 355 } |
357 } | 356 } |
LEFT | RIGHT |