Discussion:
[ragel-users] "scanner error"
Josh Haberman
2014-06-28 08:40:22 UTC
Permalink
I was trying out Ragel for the first time today and run into the
somewhat perplexing error message "scanner error".

Since the code contains a comment questioning whether this error is
reachable, I wanted to give you a repro that reaches it -- here's my
reduced test case:

%%machine m;
%%write
%%write

$ ragel -C -o test.out test.rl
test.rl:2:10: scanner error

This repro is for 6.8 (git appears to be 6.7 -- source repo is older?)

Josh
thurston
2014-06-28 13:46:27 UTC
Permalink
Hi Josh, those are unterminated write statements. Two percents begin ragel code.


-------- Original message --------
From: Josh Haberman <jhaberman at gmail.com>
Date:06-28-2014 4:40 AM (GMT-05:00)
To: ragel-users at complang.org
Subject: [ragel-users] "scanner error"

I was trying out Ragel for the first time today and run into the
somewhat perplexing error message "scanner error".

Since the code contains a comment questioning whether this error is
reachable, I wanted to give you a repro that reaches it -- here's my
reduced test case:

%%machine m;
%%write
%%write

$ ragel -C -o test.out test.rl
test.rl:2:10: scanner error

This repro is for 6.8 (git appears to be 6.7 -- source repo is older?)

Josh

_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.complang.org/pipermail/ragel-users/attachments/20140628/179e55eb/attachment.html>
Josh Haberman
2014-06-28 15:47:33 UTC
Permalink
HI Adrian,

I wasn't meaning to suggest that my test case was valid Ragel input. I
sent the repro because the Ragel source contains this comment where
this error message is generated:

/* Machine failed before finding a token. I'm not yet sure if this
* is reachable. */
scan_error() << "scanner error" << endl;
exit(1);

Since you weren't sure whether this error is reachable, I thought it
would be useful to you to know that it is indeed reachable, and to
have a repro for how it can be reached.

Also, the error message "scanner error" isn't a very useful
diagnostic; I was hoping that a repro would make it easier to emit an
error message that helps the user know what they did wrong.

It also refers to a source location that doesn't actually exist
(test.rl:2:10) -- in my test input, line 2 only has 7 columns.

Hope this is helpful,
Josh
Post by thurston
Hi Josh, those are unterminated write statements. Two percents begin ragel code.
-------- Original message --------
From: Josh Haberman
Date:06-28-2014 4:40 AM (GMT-05:00)
To: ragel-users at complang.org
Subject: [ragel-users] "scanner error"
I was trying out Ragel for the first time today and run into the
somewhat perplexing error message "scanner error".
Since the code contains a comment questioning whether this error is
reachable, I wanted to give you a repro that reaches it -- here's my
%%machine m;
%%write
%%write
$ ragel -C -o test.out test.rl
test.rl:2:10: scanner error
This repro is for 6.8 (git appears to be 6.7 -- source repo is older?)
Josh
_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users
_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users
Adrian Thurston
2014-06-28 16:43:24 UTC
Permalink
Oh sorry I misunderstood. I get it now. Thanks for the report.

-Adrian
Post by Josh Haberman
HI Adrian,
I wasn't meaning to suggest that my test case was valid Ragel input. I
sent the repro because the Ragel source contains this comment where
/* Machine failed before finding a token. I'm not yet sure if this
* is reachable. */
scan_error() << "scanner error" << endl;
exit(1);
Since you weren't sure whether this error is reachable, I thought it
would be useful to you to know that it is indeed reachable, and to
have a repro for how it can be reached.
Also, the error message "scanner error" isn't a very useful
diagnostic; I was hoping that a repro would make it easier to emit an
error message that helps the user know what they did wrong.
It also refers to a source location that doesn't actually exist
(test.rl:2:10) -- in my test input, line 2 only has 7 columns.
Hope this is helpful,
Josh
Post by thurston
Hi Josh, those are unterminated write statements. Two percents begin ragel code.
-------- Original message --------
From: Josh Haberman
Date:06-28-2014 4:40 AM (GMT-05:00)
To: ragel-users at complang.org
Subject: [ragel-users] "scanner error"
I was trying out Ragel for the first time today and run into the
somewhat perplexing error message "scanner error".
Since the code contains a comment questioning whether this error is
reachable, I wanted to give you a repro that reaches it -- here's my
%%machine m;
%%write
%%write
$ ragel -C -o test.out test.rl
test.rl:2:10: scanner error
This repro is for 6.8 (git appears to be 6.7 -- source repo is older?)
Josh
_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users
_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users
_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users
Continue reading on narkive:
Loading...