def __init__(self, filename, logger=None): self.filename = filename content = filetool.read(filename) self.tree = treegenerator.createSyntaxTree(tokenizer.parseStream(content)) self.script = Script(self.tree, self.filename) if not logger: self.logger = ConsoleLogger() else: self.logger = logger
def __init__(self, filename, logger=None): self.filename = filename content = filetool.read(filename) self.tree = treegenerator.createSyntaxTree( tokenizer.parseStream(content)) self.script = Script(self.tree, self.filename) if not logger: self.logger = ConsoleLogger() else: self.logger = logger
def compileString(jsString, uniqueId=""): """ Compile a string containing a JavaScript fragment into a syntax tree. """ return treegenerator.createSyntaxTree( tokenizer.parseStream(jsString, uniqueId)).getFirstChild()
def compileString(jsString, uniqueId=""): """ Compile a string containing a JavaScript fragment into a syntax tree. """ return treegenerator.createSyntaxTree(tokenizer.parseStream(jsString, uniqueId)).getFirstChild()