зеркало из 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,18 +131,12 @@ class ValueArg(Arg):
|
|||
def getValue(self, args):
|
||||
abstract
|
||||
|
||||
def setValue(self, args, value):
|
||||
abstract
|
||||
|
||||
class PositionalArg(ValueArg):
|
||||
"""PositionalArg - A simple positional argument."""
|
||||
|
||||
def getValue(self, args):
|
||||
return args[self.index]
|
||||
|
||||
def setValue(self, args, value):
|
||||
args[self.index] = value
|
||||
|
||||
def render(self, args):
|
||||
return [args[self.index]]
|
||||
|
||||
|
@ -153,10 +147,6 @@ class JoinedValueArg(ValueArg):
|
|||
def getValue(self, args):
|
||||
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):
|
||||
return [self.opt.name + self.getValue(args)]
|
||||
|
||||
|
@ -167,9 +157,6 @@ class SeparateValueArg(ValueArg):
|
|||
def getValue(self, args):
|
||||
return args[self.index+1]
|
||||
|
||||
def setValue(self, args, value):
|
||||
args[self.index+1] = value
|
||||
|
||||
def render(self, args):
|
||||
return [self.opt.name, self.getValue(args)]
|
||||
|
||||
|
@ -182,10 +169,6 @@ class MultipleValuesArg(Arg):
|
|||
def getValues(self, args):
|
||||
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):
|
||||
return [self.opt.name] + self.getValues(args)
|
||||
|
||||
|
@ -226,9 +209,6 @@ class DerivedArg(ValueArg):
|
|||
def getValue(self, args):
|
||||
return self.value
|
||||
|
||||
def setValue(self, args, value):
|
||||
raise ValueError,"Cannot call setValue() on a DerivedArg."
|
||||
|
||||
def render(self, args):
|
||||
return [self.value]
|
||||
|
||||
|
@ -267,6 +247,8 @@ class ArgList:
|
|||
def getJoinedValue(self, arg):
|
||||
return arg.getJoinedValue(self.argv)
|
||||
|
||||
###
|
||||
|
||||
class OptionParser:
|
||||
def __init__(self):
|
||||
self.options = []
|
||||
|
|
Загрузка…
Ссылка в новой задаче