예제 #1
0
파일: ex.py 프로젝트: lcd047/vim-lint
def expand(excmd):
    global exaliases
    if not exaliases:
        for line in data.lines('excommands.txt'):
            line = line[1:].rstrip()
            if '[' not in line:
                exaliases[line] = line
            else:
                current, _, end = line.partition('[')
                complete = current + end.rstrip(']')
                for ch in list(end):
                    exaliases[current] = complete
                    current += ch

    return exaliases.get(excmd.lower(), None)
예제 #2
0
def expand(excmd):
    global exaliases
    if not exaliases:
        for line in data.lines('excommands.txt'):
            line = line[1:].rstrip()
            if '[' not in line:
                exaliases[line] = line
            else:
                current, _, end = line.partition('[')
                complete = current + end.rstrip(']')
                for ch in list(end):
                    exaliases[current] = complete
                    current += ch

    return exaliases.get(excmd.lower(), None)
예제 #3
0
import ex
import re
import data


variants = {}
types = {}


for line in data.lines('options.txt'):
    aliases, type = re.match('(\S+)\s(\S+)', line).groups()
    aliases = aliases.split(':')
    base = aliases[0]
    for alias in aliases:
        variants[alias] = base
    types[base] = type


def parse(optionstr):
    options = []
    option = ''
    skipnext = False
    quoted = None
    for ch in list(optionstr):
        if skipnext:
            option += ch
            skipnext = False
        elif ch == '\\':
            option += ch
            skipnext = True
        elif ch in list('\'"'):
예제 #4
0
import ex
import re
import data

variants = {}
types = {}

for line in data.lines('options.txt'):
    aliases, type = re.match('(\S+)\s(\S+)', line).groups()
    aliases = aliases.split(':')
    base = aliases[0]
    for alias in aliases:
        variants[alias] = base
    types[base] = type


def parse(optionstr):
    options = []
    option = ''
    skipnext = False
    quoted = None
    for ch in list(optionstr):
        if skipnext:
            option += ch
            skipnext = False
        elif ch == '\\':
            option += ch
            skipnext = True
        elif ch in list('\'"'):
            if quoted:
                if ch == quoted: