Реализовал парсер очистки и построения решения
This commit is contained in:
parent
6e1ec01a13
commit
5f3edd5f00
|
|
@ -0,0 +1,31 @@
|
|||
from parser.LineParser import LineParser
|
||||
import re
|
||||
|
||||
class CleanBuildParser(LineParser):
|
||||
def __init__(self, commandToken):
|
||||
assert commandToken is not None
|
||||
|
||||
self.__commandToken = commandToken
|
||||
|
||||
def parseLine(self, line):
|
||||
assert line is not None
|
||||
|
||||
filePathRegexp = r"'(?P<path>[./ a-zA-Z]+\.sln)'"
|
||||
slnConfigRegexp = r"'(?P<config>[a-zA-Z|]+)'$"
|
||||
|
||||
regexpSource = self.startsWithKeywordToken(self.__commandToken) + filePathRegexp + self.keywordToken('for') + slnConfigRegexp
|
||||
regexp = re.compile(regexpSource, re.UNICODE)
|
||||
|
||||
match = regexp.match(line)
|
||||
self._guardMatch(match, line, regexpSource)
|
||||
|
||||
path = match.group('path')
|
||||
slnConfig = match.group('config')
|
||||
|
||||
return (path, slnConfig)
|
||||
|
||||
def isValidLine(self, line):
|
||||
assert line is not None
|
||||
|
||||
isValid = line.startswith(self.__commandToken)
|
||||
return isValid
|
||||
|
|
@ -0,0 +1 @@
|
|||
__author__ = 'rzaitov'
|
||||
Loading…
Reference in New Issue