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

Odd reporting/spurious errors on compile #34

Open
ELadner opened this issue Sep 11, 2022 · 1 comment
Open

Odd reporting/spurious errors on compile #34

ELadner opened this issue Sep 11, 2022 · 1 comment

Comments

@ELadner
Copy link

ELadner commented Sep 11, 2022

Latest nwnsc from github (version 1.1.3 - built Apr 2 2022 00:59:24) and latest NWN from Steam.

./nwserver-linux -v
Neverwinter Nights Server
Build: 8193.34.1 [b8d939f8]
Copyright BioWare Corp 1998-2004
Registering crash signal handlers.

Server: Loading...
Working Directory For Game Install Is: /home/eladner/.local/share/Steam/steamapps/common/Neverwinter Nights
Working Directory For Your Resources Is: /home/eladner/.local/share/Neverwinter Nights

Compile a small test file with an intentional error (output compressed and truncated for space and my comments in parens):

$ ~/.local/bin/nwnsc -h "~/.local/share/Neverwinter Nights" -n "~/.local/share/Steam/steamapps/common/Neverwinter Nights" test.nss
Loading base game resources...
Compiling: test.nss
test.nss(5): Error: NSC1040: Syntax error at "J"    (note there's not even a "J" in the file).
test.nss(6): Error: NSC1040: Syntax error at "�"  (this special character shows up as "fe" in a hex dump)
test.nss(7): Error: NSC1040: Syntax error at "�"
test.nss(8): Error: NSC1040: Syntax error at "�"
test.nss(9): Error: NSC1040: Syntax error at "�"
test.nss(10): Error: NSC1040: Syntax error at "�"
...
test.nss(103): Error: NSC1040: Syntax error at "�"
test.nss(104): Error: NSC1040: Syntax error at "�"
test.nss(104): Error: NSC1041: Compiler has reached the limit of 100 errors, aborting
Compilation aborted with errors.
Processing aborted.
Total Execution time = 0.0450 seconds  

File contains no special characters and WAY less than 100 lines and one obvious bug (missing semicolon after PrintString line)

$ file test.nss
test.nss: ASCII text
$ cat -vT test.nss
void main(){
 if (TRUE) PrintString("A")
}
$ od -xc test.nss
0000000    6f76    6469    6d20    6961    286e    7b29    200a    6669
          v   o   i   d       m   a   i   n   (   )   {  \n       i   f
0000020    2820    5254    4555    2029    7250    6e69    5374    7274
              (   T   R   U   E   )       P   r   i   n   t   S   t   r
0000040    6e69    2867    4122    2922    7d0a    000a
          i   n   g   (   "   A   "   )  \n   }  \n
0000053

Also tried unix2dos on the file to see if it was a CR vs CR/LF issue. Same results as above.

@meaglyn
Copy link
Contributor

meaglyn commented Sep 14, 2022

I have a fix for this in my tree. I'll try to make a PR for it. Fwiw, this is due to bogus compatibility with bison 3+.

Edit: Well, almost. It works for bison 3.0.4 but doesn't on 3.6. I'll see if I can make that work too.

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

No branches or pull requests

2 participants