def expand(string, start, end): expand_stack = [] result = javascript.expand(string, start, end) if result: return result expand_stack.append("line_no_indent") result = expand_line_without_indent(string, start, end) if result: result["expand_stack"] = expand_stack return result expand_stack.append("line_continuation") result = expand_over_line_continuation(string, start, end) if result: return result expand_stack.append("py_block_start") result = expand_python_block_from_start(string, start, end) if result: result["expand_stack"] = expand_stack return result expand_stack.append("py_indent") result = expand_to_indent.py_expand_to_indent(string, start, end) if result: result["expand_stack"] = expand_stack return result
def expand(string, start, end, extension="", settings=None): if(re.compile("html|ejs|php|htm|xml").search(extension)): result = html.expand(string, start, end) elif(re.compile("css|less|scss").search(extension)): result = css.expand(string, start, end) # No match seletor if result == None: result = javascript.expand(string, start, end) else: result = javascript.expand(string, start, end) if (result != None and settings): expand_region_settings = settings.get("expand_region_settings") newSettingsJson = add_to_stack(expand_region_settings, string.encode('utf-8'), result.get("start"), result.get("end"), start, end) print(newSettingsJson) settings.set("expand_region_settings", newSettingsJson) return result;
def expand(string, start, end, language="", settings=None): if language == "html": result = html.expand(string, start, end) elif language == "latex": result = latex.expand(string, start, end) elif language == "python": result = python.expand(string, start, end) else: result = javascript.expand(string, start, end) if (result != None and settings): expand_region_settings = settings.get("expand_region_settings") newSettingsJson = add_to_stack(expand_region_settings, string.encode('utf-8'), result.get("start"), result.get("end"), start, end) print(newSettingsJson) settings.set("expand_region_settings", newSettingsJson) return result;
def expand(string, start, end, extension=None): if(re.compile("html|htm|xml").search(extension)): return html.expand(string, start, end) return javascript.expand(string, start, end)