Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class JavaScriptLexer(Lexer):
- def __init__(self, mgr):
- class PureJavaScriptStyleClassifier:
- def __init__(self):
- class UDLJavaScriptStyleClassifier:
- def __init__(self):
- class JavaScriptLangIntel(CitadelLangIntel,
- def cb_variable_data_from_elem(self, elem):
- def _functionCalltipTrigger(self, ac, jsClassifier, pos, DEBUG=False):
- def trg_from_pos(self, buf, pos, implicit=True,
- def preceding_trg_from_pos(self, buf, pos, curr_pos,
- def async_eval_at_trg(self, buf, trg, ctlr):
- def _expand_extra_dirs(self, env, extra_dirs):
- #def _extra_dirs_from_env(self, env):
- def _get_stdlibs_from_env(self, env=None):
- def libs_from_buf(self, buf):
- def _invalidate_cache(self, env, pref_name):
- def _invalidate_cache_and_rescan_extra_dirs(self, env, pref_name):
- def lpaths_from_blob(self, blob):
- def citdl_expr_from_trg(self, buf, trg):
- class JavaScriptBuffer(CitadelBuffer):
- def libs(self):
- def stdlib(self):
- def scoperef_from_blob_and_line(self, blob, line):
- class JavaScriptImportHandler(ImportHandler):
- def setCorePath(self, compiler=None, extra=None):
- def _findScannableFiles(self, (files, searchedDirs), dirname, names):
- def find_importables_in_dir(self, dir):
- class JavaScriptCILEDriver(CILEDriver):
- def scan_purelang(self, buf):
- def scan_multilang(self, buf, csl_cile_driver=None):
- def scan_csl_tokens(self, file_elem, blob_name, csl_tokens):
- class JSObject:
- def __init__(self, name, parent, lineno, depth, type=None,
- self._class = None # Used when part of a class
- # completions from the class itself, whereas local
- def setParent(self, parent):
- def getFullPath(self):
- def addAttribute(self, attr):
- def removeAttribute(self, attr):
- def hasChildren(self):
- def isAnonymous(self):
- def addClassRef(self, baseclass):
- str, unicode)), "baseclass %r is not a str" % (baseclass,)
- if baseclass not in self.classrefs:
- def _mergeVariables(self, existingvar, newvar):
- def addVariable(self, name, value=None, metadata=None):
- def addMemberVariable(self, name, value):
- def getReturnType(self):
- def __repr__(self):
- def outline(self, depth=0):
- def toElementTree(self, cixelement):
- # Add a "this" member for class functions
- for baseclass in self.classrefs:
- for baseclass in self.jsdoc.baseclasses:
- if baseclass not in self.classrefs:
- class JSVariable(JSObject):
- def __init__(self, name, parent, line, depth, vartype='', doc=None,
- class JSAlias(JSVariable):
- def __init__(self, *args, **kwargs):
- class JSArgument(JSVariable):
- def __init__(self, *args, **kwargs):
- def outline(self, depth=0):
- def toElementTree(self, *args, **kwargs):
- class JSFunction(JSObject):
- def __init__(self, funcname, parent, args, lineno, depth=0, doc=None,
- self._class = parent
- def addReturnType(self, rtype):
- def addCaller(self, caller, pos, line):
- def toElementTree(self, cixelement):
- class JSClass(JSObject):
- """A JavaScript class object (a function with a non-default .prototype)"""
- def __init__(self, name, parent, lineno, depth, doc=None, path=None):
- class JSFile:
- In JavaScript this is a one-to-one relationship, so this class represents both
- def __init__(self, path, mtime=None):
- def __repr__(self):
- def getFullPath(self):
- def isAnonymous(self):
- def outline(self):
- def hasChildren(self):
- def _findScopeWithName(self, name, scopeStack, type="variables"):
- def _lookupVariableType(self, varType, jsobject, scopeStack, depth=0):
- # Then look for a class members with this name
- # Then look for a class with this name
- # print "Found a class with this name"
- def _lookupVariableTypes(self, jstypelist, scopeStack):
- # Recursive lookup for the class variables
- def _updateClassConstructors(self, jsobject):
- """Recursively update the class constructor name of the given class
- def updateAllScopeNames(self):
- log.info("Updating all class constructor names")
- def addVariable(self, name, value=None, metadata=None):
- "VAR: %s on line %d, type:%r (class %r)", name, value.line,
- def convertToElementTreeModule(self, cixmodule):
- def convertToElementTreeFile(self, cixelement, file_lang, module_lang=None):
- class JavaScriptCiler:
- def __init__(self, mgr, path="", mtime=None, lang="JavaScript"):
- def setStyleValues(self, wordStyle=SCE_C_WORD,
- def _logVariables(self):
- def incBlock(self):
- def decBlock(self):
- log.debug("Currentclass now: %r", self.currentClass.name)
- log.debug("Currentclass now: %r", self.currentClass.name)
- log.debug("Currentclass now: %r", self.currentClass)
- log.debug("Currentclass now: %r", self.currentClass)
- # Update line number for the current class if it doesn't have one
- def _findInScope(self, name, attrlist=("variables", ), scope=None):
- def _resolveAlias(self, namelist, scope=None):
- def _locateScopeForName(self, namelist, attrlist=("variables", ), scope=None):
- # correstponding group for class scopes.
- def addFunction(self, namelist, args=None, doc=None, isLocal=False,
- jsclass = self._addClassPart(
- jsdoc_says_class = False
- jsdoc_says_class = True
- if not jsdoc_says_class and self.last_comment_and_jsdoc[0]:
- jsdoc_says_class = True
- # Ick, this is really a class constructor
- jsclass = self._convertFunctionToClass(fn)
- def _createAnonymousFunctionName(self):
- def addAnonymousFunction(self, args=None, doc=None, isHidden=False):
- def addClassFunction(self, namelist, args=None, doc=None):
- # See if it's a function, we'll convert it into a class then
- def _addClassPart(self, partName, addType, scopeNames=None, args=None, doc=None, path=None, varCtor=JSVariable):
- jsclass = None
- # Find the class to place this part into
- # jsclass = self._findClassWithNames(scopeNames)
- # Look for the class first, then if we don't find it look for
- jsclass = self._locateScopeForName(
- if jsclass is None or not isinstance(jsclass, JSClass):
- jsclass = self._locateScopeForName(scopeNames, attrlist=(
- jsclass = self._convertFunctionToClass(jsclass)
- jsclass = self.currentClass
- if not jsclass and scopeNames:
- jsclass = JSClass(
- fn._class = jsclass
- # a class part using prototype.name = function
- # def addClassPart(self):
- # a class using classname.prototype = { ... }
- def addClass(self, namelist, doc=None, path=None, varCtor=JSVariable):
- """Add a new class using scope.classname.prototype = {...}
- jsclass = self._addClassPart(namelist[
- def addAnonymousClass(self, namelist, doc=None):
- def addClassOrVariableMember(
- * If it's class function, then add as a member for the class.
- class and then add a member variable for the class.
- log.debug("Adding class prototype. class name: %r, variable: %r",
- # // Now we want ko.x to move into class ko.f1
- # Convert the function to class then
- # If the class name exists already, assign to that class
- jsclass = self._locateScopeForName(
- "Creating class %r, function %r now ctor", funcName, funcName)
- jsclass = self._convertFunctionToClass(func)
- # Update the function class information
- def addClassParent(self, namelist, typeNames):
- def addGetter(self, namelist, typeNames, scopeNames=None, doc=None):
- def addSetter(self, namelist, scopeNames=None, doc=None):
- def _convertFunctionToClassContructor(self, jsfunc, jsclass):
- "Converting function: %r into a class contructor for: %r",
- # Add to class and remove from the function
- "into the class instance", var.name)
- jsfunc._class = jsclass
- def _convertFunctionToClass(self, jsfunc):
- log.debug("Creating class %r, from function %r", funcName, funcName)
- jsclass = JSClass(
- for baseclass in jsfunc.jsdoc.baseclasses:
- def _convertFunctionToClosureVariable(self, jsfunc):
- def _findOrCreateScope(self, namelist, attrlist=("variables", ),
- def addVariable(self, namelist, typeNames, toScope=None, doc=None,
- # Adding to an existing class then
- # Create a class for it then
- log.debug("Creating class now: %r", namelist[:-2])
- def addObjectVariable(self, namelist, toScope=None, doc=None,
- # class for it
- def addReturnObject(self, doc=None):
- def addFunctionReturnType(self, typeNames, doc=None):
- def _getParenArguments(self, styles, text, p, paren=None):
- def _skipOverParenArguments(self, styles, text, p, paren="("):
- def _skipToEndOfVariableAssignment(self, styles, text, p):
- def _getArgumentsFromPos(self, styles, text, pos):
- def _getIdentifiersFromPos(self, styles, text, pos):
- def _getCitdlTypeInfo(self, styles, text, p):
- def _getVariableType(self, styles, text, p, assignmentChar="="):
- def _unquoteJsString(self, s):
- def _getVariableDetail(self, namelist, styles, text, p, assignmentChar="="):
- # Check for special class prototypes
- def _variableHandler(self, lineno, styles, text, p, namelist,
- "_variableHandler:: Line %d, class function: %r(%r)",
- "_variableHandler:: Line %d, class member variable: %r (%s=%r)",
- "_variableHandler:: Line %d, class object variable: %r", lineno,
- def createObjectArgument(self, styles, text):
- def _addCodePiece(self, styles, text, pos=0):
- def _chooseBestVariable(self, jsvar1, jsvar2):
- def _copyObjectToAnother(self, jsobject, jsother):
- jsobj._class = jsobj.parent
- def _handleDefineProperty(self, styles, text, p):
- def _handleYAHOOExtension(self, styles, text, p):
- # Add class parent reference
- jsclass = self._addClassPart(".".join(
- def _handleDojoExtension(self, type, styles, text, p):
- jsclass = JSClass(extendClassNamelist[
- jsclass = self._addClassPart(".".join(
- if arg == '{': # super class is null
- jsclass = self._locateScopeForName(extendClassNamelist, attrlist=(
- jsclass = self._convertFunctionToClass(jsclass)
- jsclass.functions[f]._class = jsclass
- f._class = jsclass
- # Change function constructor name to the class name so that it
- def _removeObjectFromScope(self, jsobject):
- def _handleFunctionApply(self, namelist=None):
- def _handleFunctionWithArguments(self):
- def _findScopeFromContext(self, styles, text):
- # We have a class prototype, find the class and return with that
- def _resetState(self, newstate=S_DEFAULT):
- def _popPreviousState(self, keep_style_and_text=False):
- def _pushAndSetState(self, newstate=S_DEFAULT):
- def _endOfScanReached(self):
- def token_next(self, style, text, start_column, start_line, **other_args):
- # with getters, setters and class prototypes.
- def scan_puretext(self, content, updateAllScopeNames=True):
- def convertToElementTreeFile(self, cixelement, file_lang, module_lang=None):
- def convertToElementTreeModule(self, cixmodule):
- class Utils(object):
- def unquoteJsString(s):
- def _isident(char):
- def _isdigit(char):
- def _walk_js_scopes(scope, lpath=None):
- def _walk_js_symbols(elem, _prefix=None):
- def register(mgr):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement