Skip to content
This repository was archived by the owner on Aug 6, 2023. It is now read-only.

BUG: profileNameSpace in variable create error #59

Open
vincentBenet opened this issue May 4, 2020 · 0 comments
Open

BUG: profileNameSpace in variable create error #59

vincentBenet opened this issue May 4, 2020 · 0 comments

Comments

@vincentBenet
Copy link

vincentBenet commented May 4, 2020

Hello

On running the linter on this line:
private _profileNameSpace = profileNameSpace;

I get this error: (It works perfectly when I comment the line.)

Traceback (most recent call last):
File "D:\git\global_linter\source\sqf\goliat.py", line 12, in main
exceptions = sqf.analyzer.analyze(result).exceptions

File "C:\Users\vince\AppData\Local\Programs\Python\Python38-32\lib\site-packages\sqf\analyzer.py", line 545, in analyze
analyzer.execute_code(file, extra_scope={'_this': arg})

File "C:\Users\vince\AppData\Local\Programs\Python\Python38-32\lib\site-packages\sqf\analyzer.py", line 197, in execute_code
outcome = super().execute_code(code, extra_scope, namespace_name)

File "C:\Users\vince\AppData\Local\Programs\Python\Python38-32\lib\site-packages\sqf\base_interpreter.py", line 177, in execute_code
token = self.execute_token(statement)

File "C:\Users\vince\AppData\Local\Programs\Python\Python38-32\lib\site-packages\sqf\analyzer.py", line 150, in execute_token
result = self.execute_single(statement=token)

File "C:\Users\vince\AppData\Local\Programs\Python\Python38-32\lib\site-packages\sqf\analyzer.py", line 341, in execute_single
self.assign(lhs, rhs_v)

File "C:\Users\vince\AppData\Local\Programs\Python\Python38-32\lib\site-packages\sqf\analyzer.py", line 265, in assign
scope[lhs_name] = rhs_t()

TypeError: __init__() missing 1 required positional argument: 'token'`

Here is how I run it:

import sqf.parser
import sqf.analyzer
import sqf.exceptions

def main(f, path, settings):  # f is my script as a string
    problems = []
    fl = [""] + f.split("\n")
    print(path)
    try:
        result = sqf.parser.parse(f)
        exceptions = sqf.analyzer.analyze(result).exceptions
        for exception in exceptions:
            problems.append(execption_to_problem(exception, path))
    except sqf.exceptions.SQFParserError as e:
        problems.append(execption_to_problem(e, path))
    return


def execption_to_problem(e, path):
    line_number = e.position[0]
    column_number = e.position[1] - 1
    type_problem = e.message.split(":")[0]
    message_problem = "".join(e.message.split(":")[1:])
    return [path, line_number, column_number, type_problem, message_problem]

My pip freeze:

aiohttp==3.5.4
alabaster==0.7.12
apipkg==1.5
async-timeout==3.0.1
atomicwrites==1.3.0
attrs==19.3.0
Babel==2.8.0
certifi==2019.11.28
chardet==3.0.4
colorama==0.4.3
coverage==5.0.3
coverage-badge==1.0.1
cycler==0.10.0
discord.py==1.2.5
dnspython==1.16.0
docutils==0.15.2
execnet==1.7.1
fusepy==3.0.1
get==2019.4.13
idna==2.8
imagesize==1.2.0
Jinja2==2.10.3
kiwisolver==1.2.0
MarkupSafe==1.1.1
matplotlib==3.2.1
more-itertools==8.2.0
multidict==4.6.1
mysql-connector-python==8.0.19
numpy==1.18.1
opencv-contrib-python==4.1.2.30
opencv-python==4.1.2.30
packaging==20.0
pluggy==0.13.1
post==2019.4.13
protobuf==3.6.1
public==2019.4.13
py==1.8.1
Pygments==2.5.2
pyparsing==2.4.6
pytest==5.3.5
pytest-cov==2.8.1
pytest-forked==1.1.3
pytest-xdist==1.31.0
python-dateutil==2.8.1
pytz==2019.3
query-string==2019.4.13
request==2019.4.13
requests==2.22.0
six==1.13.0
snowballstemmer==2.0.0
Sphinx==2.3.1
sphinx-rtd-theme==0.4.3
sphinxcontrib-applehelp==1.0.1
sphinxcontrib-devhelp==1.0.1
sphinxcontrib-htmlhelp==1.0.2
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.2
sphinxcontrib-serializinghtml==1.1.3
sqflint==0.3.2
style==1.1.0
update==0.0.1
urllib3==1.25.7
wcwidth==0.1.8
websockets==6.0
yarl==1.4.2
@vincentBenet vincentBenet changed the title profileNameSpace in variable create error BUG: profileNameSpace in variable create error May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant