OpenTTD / nml

NewGRF Meta Language
GNU General Public License v2.0
42 stars 36 forks source link

Bug: `const` keyword not working #332

Open WenSimEHRP opened 3 weeks ago

WenSimEHRP commented 3 weeks ago

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 commented 3 weeks ago

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