/** * Returns AST as JSON compatible string. This is used to * implement "parse" function in resources/parse.js script. * * @param code code to be parsed * @param name name of the code source (used for location) * @param includeLoc tells whether to include location information for nodes or not * @return JSON string representation of AST of the supplied code */ public static String parse(final String code, final String name, final boolean includeLoc) { return JSONWriter.parse(Context.getContextTrusted(), code, name, includeLoc); }
/** * Returns AST as JSON compatible string. This is used to * implement "parse" function in resources/parse.js script. * * @param code code to be parsed * @param name name of the code source (used for location) * @param includeLoc tells whether to include location information for nodes or not * @return JSON string representation of AST of the supplied code */ public static String parse(final String code, final String name, final boolean includeLoc) { return JSONWriter.parse(Context.getContextTrusted().getEnv(), code, name, includeLoc); }