Repository navigation
Conversation
zeroflag0
commented
Jan 23, 2024
|
For context, can you show an example of a meson.build that triggers this issue? Also: please apply fixups to previous commits using |
I think I had a malformed meson.build file with "invisible characters" that tripped up the lexer - and then this follow-up-exception occured in vscode. |
|
My feeling is that the bad character should be detected sooner, at the Lexer level. |
|
Exactly. I'd still like to see an actual example meson.build file that reproduces the problem with sufficient fidelity that it can be checked into the repository as a test case -- not "a malformed file that tripped up the lexer". :) (In fact we should have a test case regardless of whether we fix it in the AST interpreter or the lexer.) |
I just recently figured out why python (in general, not just meson) had so much trouble on my machine.
steps to reproduce:
Python will try to open the file with utf-8 by default and fail to parse the BOM-"header"(?), tripping up the lexer and then the errors cascade from there. expected behavior:
|
|
Opening build files using |
|
As an aside, I'm reworking some of the state handling in the Interpreter, and I've changed the ast to use a dummy Also, Either using |
Can you add a new test case: containing this issue? That way the testsuite will detect this case and make sure it does not regress. You can see how it is done in for inspiration, but we want to check meson.build instead of meson_options.txt this time. |
Some text editors on Windows may use utf8bom encoding by default. Prevent crash by stripping the bom before trying to interpret the build files. Fixing this at the Lexer level allows to do it at one place. Another solution would be to open the build files with `utf-8-sig` encoding, but that would require to do it at each places build files are opened. Fixes mesonbuild#12766.
Some text editors on Windows may use utf8bom encoding by default. Prevent crash and properly report misencoded files. Fixes mesonbuild#12766.
Some text editors on Windows may use utf8bom encoding by default. Prevent crash and properly report misencoded files. Fixes #12766.
Some text editors on Windows may use utf8bom encoding by default. Prevent crash and properly report misencoded files. Fixes mesonbuild#12766.
Some text editors on Windows may use utf8bom encoding by default. Prevent crash and properly report misencoded files. Fixes mesonbuild#12766.