зеркало из https://github.com/microsoft/clang-1.git
ccc: Remove ValueArg::setValue, this is no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61794 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
ba6e323fd6
Коммит
1dd2adabee
|
@ -131,17 +131,11 @@ class ValueArg(Arg):
|
||||||
def getValue(self, args):
|
def getValue(self, args):
|
||||||
abstract
|
abstract
|
||||||
|
|
||||||
def setValue(self, args, value):
|
|
||||||
abstract
|
|
||||||
|
|
||||||
class PositionalArg(ValueArg):
|
class PositionalArg(ValueArg):
|
||||||
"""PositionalArg - A simple positional argument."""
|
"""PositionalArg - A simple positional argument."""
|
||||||
|
|
||||||
def getValue(self, args):
|
def getValue(self, args):
|
||||||
return args[self.index]
|
return args[self.index]
|
||||||
|
|
||||||
def setValue(self, args, value):
|
|
||||||
args[self.index] = value
|
|
||||||
|
|
||||||
def render(self, args):
|
def render(self, args):
|
||||||
return [args[self.index]]
|
return [args[self.index]]
|
||||||
|
@ -153,10 +147,6 @@ class JoinedValueArg(ValueArg):
|
||||||
def getValue(self, args):
|
def getValue(self, args):
|
||||||
return args[self.index][len(self.opt.name):]
|
return args[self.index][len(self.opt.name):]
|
||||||
|
|
||||||
def setValue(self, args, value):
|
|
||||||
assert self.opt.name == args[self.index][:len(self.opt.name)]
|
|
||||||
args[self.index] = self.opt.name + value
|
|
||||||
|
|
||||||
def render(self, args):
|
def render(self, args):
|
||||||
return [self.opt.name + self.getValue(args)]
|
return [self.opt.name + self.getValue(args)]
|
||||||
|
|
||||||
|
@ -167,9 +157,6 @@ class SeparateValueArg(ValueArg):
|
||||||
def getValue(self, args):
|
def getValue(self, args):
|
||||||
return args[self.index+1]
|
return args[self.index+1]
|
||||||
|
|
||||||
def setValue(self, args, value):
|
|
||||||
args[self.index+1] = value
|
|
||||||
|
|
||||||
def render(self, args):
|
def render(self, args):
|
||||||
return [self.opt.name, self.getValue(args)]
|
return [self.opt.name, self.getValue(args)]
|
||||||
|
|
||||||
|
@ -182,10 +169,6 @@ class MultipleValuesArg(Arg):
|
||||||
def getValues(self, args):
|
def getValues(self, args):
|
||||||
return args[self.index + 1:self.index + 1 + self.opt.numArgs]
|
return args[self.index + 1:self.index + 1 + self.opt.numArgs]
|
||||||
|
|
||||||
def setValues(self, args, value):
|
|
||||||
assert self.opt.numArgs == len(value)
|
|
||||||
args[self.index + 1:self.index + 1 + self.opt.numArgs] = value
|
|
||||||
|
|
||||||
def render(self, args):
|
def render(self, args):
|
||||||
return [self.opt.name] + self.getValues(args)
|
return [self.opt.name] + self.getValues(args)
|
||||||
|
|
||||||
|
@ -226,9 +209,6 @@ class DerivedArg(ValueArg):
|
||||||
def getValue(self, args):
|
def getValue(self, args):
|
||||||
return self.value
|
return self.value
|
||||||
|
|
||||||
def setValue(self, args, value):
|
|
||||||
raise ValueError,"Cannot call setValue() on a DerivedArg."
|
|
||||||
|
|
||||||
def render(self, args):
|
def render(self, args):
|
||||||
return [self.value]
|
return [self.value]
|
||||||
|
|
||||||
|
@ -266,6 +246,8 @@ class ArgList:
|
||||||
|
|
||||||
def getJoinedValue(self, arg):
|
def getJoinedValue(self, arg):
|
||||||
return arg.getJoinedValue(self.argv)
|
return arg.getJoinedValue(self.argv)
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
class OptionParser:
|
class OptionParser:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
Загрузка…
Ссылка в новой задаче