A convenience routine to create a standalone SourceUnit on a String with defaults for almost everything that is configurable.
(String name, String source)
| 178 | * with defaults for almost everything that is configurable. |
| 179 | */ |
| 180 | public static SourceUnit create(String name, String source) { |
| 181 | CompilerConfiguration configuration = new CompilerConfiguration(); |
| 182 | configuration.setTolerance(1); |
| 183 | |
| 184 | return new SourceUnit(name, source, configuration, null, new ErrorCollector(configuration)); |
| 185 | } |
| 186 | |
| 187 | /** |
| 188 | * A convenience routine to create a standalone SourceUnit on a String |