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

Support camlp5 by using Toploop.parse_toplevel_phrase instead of Parse.toplevel_phrase #486

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aqjune
Copy link

@aqjune aqjune commented Apr 23, 2024

This resolves issue #485 (and the equivalent issue discussed in this thread) by fixing the definition of parse_toplevel_phrase_default of UTop to use !Toploop.parse_toplevel_phrase instead of Parse.toplevel_phrase.

Note that !Toploop.parse_toplevel_phrase is equal to Parse.toplevel_phrase when utop was just initiated: https://github.com/ocaml/ocaml/blob/trunk/toplevel/topcommon.ml#L29

However, a user may add its preprocessor to Toploop.parse_toplevel_phrase later using camlp5, making !Toploop.parse_toplevel_phrase and Parse.toplevel_phrase unequal.

This patch simply replaces Parse.toplevel_phrase with !Toploop.parse_toplevel_phrase so that the preprocessor can do its work.

@aqjune aqjune requested a review from rgrinberg as a code owner April 23, 2024 04:17
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 this pull request may close these issues.

None yet

1 participant