From a13a4a0741d4c8dcc56f4191451a7b98ed863b14 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Sun, 6 Dec 2020 16:46:56 +0100 Subject: [PATCH] Fixed AR with ninja --- pip/setup.py | 4 ++-- src/ninja.py | 4 ++-- src/variables.py | 6 ++++++ src/version.py | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/pip/setup.py b/pip/setup.py index 5dcaa0c..631a598 100644 --- a/pip/setup.py +++ b/pip/setup.py @@ -7,7 +7,7 @@ with open("README.md", "r") as fh: setuptools.setup( name = 'irpf90', - version = '2.0.2', + version = '2.0.3', scripts = ["irpf90", "irpman", "irpf90_indent"], author = 'Anthony Scemama', author_email = 'scemama@irsamc.ups-tlse.fr', @@ -15,7 +15,7 @@ setuptools.setup( long_description=long_description, long_description_content_type="text/markdown", url="https://irpf90.ups-tlse.fr", - download_url = 'https://gitlab.com/scemama/irpf90/-/archive/v2.0.2/irpf90-v2.0.2.tar.gz', + download_url = 'https://gitlab.com/scemama/irpf90/-/archive/v2.0.3/irpf90-v2.0.3.tar.gz', packages=setuptools.find_packages(), classifiers=[ "Programming Language :: Python :: 3", diff --git a/src/ninja.py b/src/ninja.py index 41c5895..53624ef 100644 --- a/src/ninja.py +++ b/src/ninja.py @@ -272,7 +272,7 @@ def run(): except KeyError: FC="gfortran -ffree-line-length-none" try: AR = os.environ["AR"] - except KeyError: AR="ar" + except KeyError: AR="ar crs" try: CC = os.environ["CC"] except KeyError: CC="gcc" @@ -329,7 +329,7 @@ def run(): " description = C++ : $short_in -> $short_out", "", "rule link_lib_{id}", - " command = {AR} crf $out $in" , + " command = {AR} $out $in" , " description = Link: $short_out", "", "rule link_{id}", diff --git a/src/variables.py b/src/variables.py index 7c8f073..083eb8d 100644 --- a/src/variables.py +++ b/src/variables.py @@ -29,6 +29,9 @@ from variable import * from irpf90_t import * from command_line import command_line from util import * +import error + +forbidden_names = ["type", "double precision", "integer", "use", "character", "real"] ###################################################################### def create_variables(): @@ -52,6 +55,9 @@ def create_variables(): print("- ", v.line.filename[0], " line ", v.line.i) print("- ", result[v.name].line.filename[0], " line ", result[v.name].line.i) print("Choosing first version") + print (v.name) + if v.name in forbidden_names: + error.fail(line,"A variable can't be named %s"%(v.name)) result[v.name] = v for other in v.others: if other in result: diff --git a/src/version.py b/src/version.py index b72bed1..079fe43 100644 --- a/src/version.py +++ b/src/version.py @@ -1 +1 @@ -version = "2.0.2" +version = "2.0.3"