Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: const keyword not working #332

Open
WenSimEHRP opened this issue Jul 11, 2024 · 3 comments · May be fixed by #342
Open

Bug: const keyword not working #332

WenSimEHRP opened this issue Jul 11, 2024 · 3 comments · May be fixed by #342

Comments

@WenSimEHRP
Copy link

030_house.nml
log:

Running test 029_base_graphics
Running test 030_house
 nmlc ERROR: "030_house.nml", line 53: Syntax error, unexpected token "const"
Traceback (most recent call last):
  File "D:\Data\Documents\GitHub\__Developing\jppluswins\nml\nmlc", line 6, in <module>
    main.run()
  File "D:\Data\Documents\GitHub\__Developing\jppluswins\nml\nml\main.py", line 639, in run
    main(sys.argv[1:])
  File "D:\Data\Documents\GitHub\__Developing\jppluswins\nml\nml\main.py", line 346, in main
    ret = nml(
          ^^^^
  File "D:\Data\Documents\GitHub\__Developing\jppluswins\nml\nml\main.py", line 434, in nml
    result = nml_parser.parse(script, input_filename)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Data\Documents\GitHub\__Developing\jppluswins\nml\nml\parser.py", line 84, in parse
    return self.parser.parse(None, lexer=self.lexer.lexer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jerry\scoop\apps\python\current\Lib\site-packages\ply\yacc.py", line 333, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jerry\scoop\apps\python\current\Lib\site-packages\ply\yacc.py", line 1201, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jerry\scoop\apps\python\current\Lib\site-packages\ply\yacc.py", line 192, in call_errorfunc
    r = errorfunc(token)
        ^^^^^^^^^^^^^^^^
  File "D:\Data\Documents\GitHub\__Developing\jppluswins\nml\nml\parser.py", line 106, in p_error
    raise generic.ScriptError('Syntax error, unexpected token "{}"'.format(t.value), t.lineno)
nml.generic.ScriptError: "030_house.nml", line 53: Syntax error, unexpected token "const"
make[1]: *** [Makefile:21: 030_house] Error 1
make[1]: Leaving directory 'D:/Data/Documents/GitHub/__Developing/jppluswins/nml/regression'
make: *** [Makefile:8: regression] Error 2
@glx22
Copy link
Contributor

glx22 commented Jul 11, 2024

Parser needs to be rebuilt, use -R for at least one nmlc run.

@LordAro
Copy link
Member

LordAro commented Oct 7, 2024

Is there any particular reason why nmlc can't detect this itself?

@glx22
Copy link
Contributor

glx22 commented Oct 7, 2024

Nobody implemented the detection.
Anyway looking at ply changelog, it seems they stopped distribution with pip 2 years ago in favour of vendoring, and latest version removed parser/lexer caching.
So maybe we should just vendor latest version and drop the generated tables.

@glx22 glx22 linked a pull request Oct 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants