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

compiler errors when loading a script #10

Closed
Ingo60 opened this issue Mar 17, 2014 · 4 comments · Fixed by Frege/frege-interpreter#10
Closed

compiler errors when loading a script #10

Ingo60 opened this issue Mar 17, 2014 · 4 comments · Fixed by Frege/frege-interpreter#10

Comments

@Ingo60
Copy link
Member

Ingo60 commented Mar 17, 2014

I am getting unexplainable compiler errors:

frege> :load https://raw.github.com/Frege/frege/master/frege/data/NanoParsec.fr
unexpected ';' while trying to parse declarations local to a
class, instance or type
unexpected ';' while trying to parse declarations local to a
class, instance or type
unexpected ';' while trying to parse declarations local to a
class, instance or type

With other modules, the :load works just fine, though. So I wonder where the problem may be? It looks like indentation is slightly changed somewhere, but where?

@mmhelloworld
Copy link
Member

It should atleast print the line number on the error messages. I will take
a look in the evening.

On Monday, March 17, 2014, Ingo Wechsung [email protected] wrote:

I am getting unexplainable compiler errors:

frege> :load https://raw.github.com/Frege/frege/master/frege/data/NanoParsec.fr
unexpected ';' while trying to parse declarations local to a
class, instance or type
unexpected ';' while trying to parse declarations local to a
class, instance or type
unexpected ';' while trying to parse declarations local to a
class, instance or type

With other modules, the :load works just fine, though. So I wonder where
the problem may be? It looks like indentation is slightly changed
somewhere, but where?

Reply to this email directly or view it on GitHubhttps://github.com//issues/10
.

@mmhelloworld
Copy link
Member

It looks like a where followed by --- is not correctly handled by the interpreter.

Here is the simplified version of the problem:

frege> :{
> module hello.Foo where
> --- Test
> bar = "bar"
> :}
2: unexpected ';' while trying to parse a package

But this works:

frege> :{
> module hello.Foo where
> -- Test
> bar = "bar"
> :}
Module hello.Foo

I have fixed the line numbers to be displayed on error messages in the REPL.
The errors from NanoParsec.fr are actually on lines 14, 45 and 49. if we change --- to -- on those lines then it works.

I also tried the same code in Eclipse where it doesn't have any problems so there is some difference between the REPL and the compiler code. I will look into this more tomorrow.

@Ingo60
Copy link
Member Author

Ingo60 commented Mar 18, 2014

I tried changing --- to {-- but it doesn't like that either.

By the way, this shows nicely that you need to reverse the error messages when you display them in the REPL. :)

mmhelloworld added a commit to Frege/frege-interpreter that referenced this issue Mar 19, 2014
mmhelloworld added a commit to Frege/frege-interpreter that referenced this issue Mar 19, 2014
@mmhelloworld
Copy link
Member

I have fixed this issue and deployed a new version of REPL. The error messages should also now appear in correct order.

This issue was closed.
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

Successfully merging a pull request may close this issue.

2 participants