neilsf / xc-basic3

A BASIC cross compiler for MOS 6502-based machines
MIT License
45 stars 5 forks source link

[3.1.6] Any error which is not a Syntax Error is said to be on line 1 #234

Closed JJFlash-IT closed 1 year ago

JJFlash-IT commented 1 year ago

XC=BASIC compiler version v3.1.6 (Jul 18 2023) (Windows 7/10, 64 bit)

First of all, thank you so much for fixing the NEXT-FOR problem and so quickly!

Unfortunately, there's still the "line 1" problem I had mentioned in my previous issue.

Again, for your convenience, I'm uploading the source code of Advent 101 here: Advent_101.zip

To reproduce the problem:

The same happens for any error which is not a Syntax Error.

My program INCLUDEs quite a few files, but it seems that INCLUDE does not interfere: I tried commenting out all the INCLUDEs at the beginning of advent101.bas, it still says "1.0".

I hope a solution can be found, as it can be quite frustrating not to know where a problem can be, while developing a medium if not large sized program.

neilsf commented 1 year ago

Hi @JJFlash-IT It looks like an issue on Windows only. I added a fix that I can't test right now, would you be able to check out the develop branch and run a quick test? Many thanks.

JJFlash-IT commented 1 year ago

Hey! Sorry for getting back to you so late, I was on a short vacation and also had to figure out how to use DMD on Windows (I'm totally clumsy with modern development tools and solutions) to compile the source on the "develop" branch.

I hope I did everything right, anyway the fix seems to work great: I tried a number of changes in the main advent101.bas file and also in a couple of the INCLUDEd files.

I even tried to use different newline sequences (I went from CRLF to LF only and then back) in the advent101.bas file, and also in the INCLUDEd files (mixing various combinations among the files), and the compiler always gave me the correct line number where I put errors on purpose.

I suppose I'll repeat those tests once this fix goes into the main branch / actual release, anyway the issue seems to be fixed. Thank you once again for quickly addressing it!

neilsf commented 1 year ago

Thanks for testing. Sorry I forgot that binaries are not auto compiled on the develop branch.

neilsf commented 1 year ago

Fixed in Version 3.1.7