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

camlp4 removes empty precedence levels on delete_rule #3787

Closed
vicuna opened this issue Sep 12, 2005 · 1 comment
Closed

camlp4 removes empty precedence levels on delete_rule #3787

vicuna opened this issue Sep 12, 2005 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Sep 12, 2005

Original bug ID: 3787
Reporter: administrator
Status: closed (set by @diml on 2016-12-07T17:25:11Z)
Resolution: suspended
Priority: normal
Severity: minor
Target version: 4.00.1+dev
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues

Bug description

Full_Name: Stefano Zacchiroli
Version: 3.08.3
OS: GNU/Linux
Submission from: tsunami.mowgli.cs.unibo.it (130.136.129.199)

The camlp4 API permits, via "Grammar.extend" to create empty precedence level.
This is usefule since you can assign names to them and make assumptions on their
relative order in future extensions of the grammar.

If an empty level gets extended with a rule, the obtained level then contains
only one rule. When that rule is removed using "Gramext.delete_rule" the entire
precedence level is removed, making further extension of it failing with
something like:

No level labelled "10N" in entry "term"
Fatal error: exception Failure("Grammar.extend")

A work-around is to never have empty precedence level, always filling them with
a production on dummy tokens which are never generated by the lexer, ... but is
really a ugly hack.

TIA,
Cheers.

@vicuna
Copy link
Author

vicuna commented Sep 11, 2012

Comment author: @damiendoligez

This is about the old camlp4, which now lives as camlp5, and is not part of the core OCaml distribution.

@vicuna vicuna closed this as completed Dec 7, 2016
@vicuna vicuna added this to the 4.00.1 milestone Mar 14, 2019
@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
Projects
None yet
Development

No branches or pull requests

1 participant