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

Bug in Parsing library? #3521

Closed
vicuna opened this issue Aug 9, 2002 · 2 comments
Closed

Bug in Parsing library? #3521

vicuna opened this issue Aug 9, 2002 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Aug 9, 2002

Original bug ID: 1314
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

When entering parsing the second time in the same program run and calling
the symbol_start function at the first rule it returns the last symbol_end
position from the previous run through the parser (altough I expected it to
return 0).

Is it supposed to work only once, or is there something I'm missing?

Maybe it should clear the whole Parsing.env when calling clear_parser?

  • Kimmo
@vicuna
Copy link
Author

vicuna commented Aug 19, 2002

Comment author: administrator

When entering parsing the second time in the same program run and calling
the symbol_start function at the first rule it returns the last symbol_end
position from the previous run through the parser (altough I expected it to
return 0).
Is it supposed to work only once, or is there something I'm missing?

Location information (Parsing.symbol_start) is derived from the
location information contained in lexing buffers (Lexing.lexbuf).
If you reuse the same lexing buffer across several calls to a parser,
locations keep increasing. If this behavior is inadequate, use a
fresh lexbuf to start again from 0.

Maybe it should clear the whole Parsing.env when calling clear_parser?

This will have no effect on location information.

Hope this helps,

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Aug 19, 2002

Comment author: administrator

Normal behavior if lexbuf is reused.

@vicuna vicuna closed this as completed Aug 19, 2002
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant