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

Syntax errors from included files not reported correctly #2775

Closed
xorinzor opened this issue Dec 5, 2022 · 2 comments
Closed

Syntax errors from included files not reported correctly #2775

xorinzor opened this issue Dec 5, 2022 · 2 comments

Comments

@xorinzor
Copy link

xorinzor commented Dec 5, 2022

Describe the bug
When there is a syntax error in a file included via %include, the parser will fail on the %include and just say Parse Error rather then telling about the syntax error in the nested code.

To Reproduce
have 2 files:
main.liq

%include "test.liq"
-- any other code --

test.liq (notice the double . in the parameter)

def test(~test=1..) =
    test
end

This will return something along the lines of:

At main.liq, line 1, char 0-20:
%include "test.liq"

Error 2: Parse error

Expected behavior
It should report on the syntax error in test.liq

Additional details
interestingly enough, if the content of test.liq is set to something like:

invalid content

The parser error will say:

At test.liq, line 1, char 0-7:
invalid content

Error 4: Undefined variable invalid

Version details

  • OS: Ubuntu 22.10
  • Version 2.1.3 (docker container)

Install method
Docker

@toots
Copy link
Member

toots commented Feb 23, 2023

Thanks for reporting. I'm happy to report that the upcoming rolling release seems to have this fixed already!

@toots toots closed this as completed Feb 23, 2023
toots added a commit that referenced this issue Feb 23, 2023
@togir2
Copy link

togir2 commented Feb 27, 2023

Hi @toots ,
I just tested it with the rolling release liquidsoap-5c4daae_2.1.4-debian-bullseye-1_amd64.deb which should(?) include this fix.
It seems to me the fix did not work.

main.liq
%include "test.liq" print("hi") -- any other code --

test.liq
def test(~test=1..) = test end

`liquidsoap --verbose -c main.liq
INFO: Loading Sdl_ttf, Target = linux
INFO: Loading Sdl_image, Target = linux
At main.liq, line 1, char 0-19:
%include "test.liq"

Error 2: Parse error
`

I do have the version:
liquidsoap 'print(liquidsoap.version)' "2.1.4+git@5c4daae3d".{at_least = <fun>}

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

3 participants