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

move_start_p in Lexing is wrong #5820

Closed
vicuna opened this issue Nov 11, 2012 · 3 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link

commented Nov 11, 2012

Original bug ID: 5820
Reporter: @bobzhang
Assigned to: @bobzhang
Status: closed (set by @xavierleroy on 2015-12-11T18:23:52Z)
Resolution: fixed
Priority: normal
Severity: minor
Target version: 4.01.1+dev
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues

Bug description

the move_start_p want to unrolling some characters, but it does not have any side effect actually.
given a string input
"*)" it can only generate tokens "SYMBOL *".

the ocamllex manual does not say it can do unrolling, but I have a hack that will do this
| ")"
{ warn Comment_not_end (FanLoc.of_lexbuf lexbuf) ;
(
move_start_p (-1) c; )
lexbuf.lex_curr_pos <- lexbuf.lex_curr_pos - 1;
SYMBOL "
" }

Will anyone verify this problem? the move_start_p should be removed and applied such hacks to unroll

@vicuna

This comment has been minimized.

Copy link
Author

commented Aug 14, 2013

Comment author: @damiendoligez

Evidence of the problem: this gives a warning with ocamlc, while camlp4o gives the warning, then a parse error (because the closing parenthesis has disappeared):

( *) 1;;

@vicuna

This comment has been minimized.

Copy link
Author

commented Aug 15, 2013

Comment author: @bobzhang

I thought I fixed the bug, it seems not, would get back to it later, thanks

@vicuna

This comment has been minimized.

Copy link
Author

commented Aug 18, 2013

Comment author: @bobzhang

Fixed in revision 14012.
This is a pretty safe fix, would you mind back port it to 4.01?

@vicuna vicuna closed this Dec 11, 2015

@vicuna vicuna added the camlp4 label Mar 14, 2019

@vicuna vicuna added this to the 4.01.1 milestone Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.