From 848728858cf4bf313af5935cf9f35b743bbfb62e Mon Sep 17 00:00:00 2001 From: Gregory Becker Date: Tue, 12 Jan 2016 18:34:26 -0800 Subject: [PATCH] Removed extra plus signs from command line syntax. Did not yet remove them from printed format --- lib/spack/spack/concretize.py | 2 +- lib/spack/spack/spec.py | 46 ++++++++++++++++++++++++----------- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py index 6631a1afce..d2498ec64d 100644 --- a/lib/spack/spack/concretize.py +++ b/lib/spack/spack/concretize.py @@ -182,7 +182,7 @@ def concretize_compiler_flags(self, spec): Default specs set at the compiler level will still be added later. """ ret = False - for flag in Compiler.valid_compiler_flags(): + for flag in spack.spec.FlagMap.valid_compiler_flags(): # if flag in spec.compiler_flags: # continue try: diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 4a589d4cdf..4dfc315c90 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -1801,7 +1801,7 @@ def __init__(self): class SpecParser(spack.parse.Parser): def __init__(self): super(SpecParser, self).__init__(SpecLexer()) - + self.previous = None def do_parse(self): specs = [] @@ -1809,13 +1809,23 @@ def do_parse(self): try: while self.next: if self.accept(ID): - specs.append(self.spec(self.token.value)) - + self.previous = self.token + if self.accept(EQ): + if not specs: + specs.append(self.spec('')) + if self.accept(QT): + self.token.value = self.token.value[1:-1] + else: + self.expect(ID) + specs[-1]._add_flag(self.previous.value, self.token.value) + else: + specs.append(self.spec(self.previous.value)) elif self.accept(HASH): specs.append(self.spec_by_hash()) elif self.accept(DEP): if not specs: + self.previous = self.token specs.append(self.spec('')) if self.accept(HASH): specs[-1]._add_dependency(self.spec_by_hash()) @@ -1887,6 +1897,13 @@ def spec(self, name, check_valid_token = False): # unspecified or not. added_version = False + if self.previous.value == DEP: + if self.accept(HASH): + spec.add_dependency(self.spec_by_hash()) + else: + self.expect(ID) + spec.add_dependency(self.spec(self.token.value)) + while self.next: if self.accept(AT): vlist = self.version_list() @@ -1896,17 +1913,18 @@ def spec(self, name, check_valid_token = False): check_valid_token = False elif self.accept(ON): - self.expect(ID) - self.check_identifier() - option = self.token.value - if self.accept(EQ): - if self.accept(QT): - self.token.value = self.token.value[1:-1] - else: - self.expect(ID) - spec._add_flag(option,self.token.value) - else: - spec._add_variant(self.variant(option),True) +# self.expect(ID) +# self.check_identifier() +# option = self.token.value +# if self.accept(EQ): +# if self.accept(QT): +# self.token.value = self.token.value[1:-1] +# else: +# self.expect(ID) +# spec._add_flag(option,self.token.value) +# else: +# spec._add_variant(self.variant(option),True) + spec._add_variant(self.variatn(), True) check_valid_token = False elif self.accept(OFF):