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

?? probably isn't a keyword #8025

Closed
vicuna opened this issue Feb 22, 2003 · 3 comments
Closed

?? probably isn't a keyword #8025

vicuna opened this issue Feb 22, 2003 · 3 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Feb 22, 2003

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

Bug description

At http://caml.inria.fr/ocaml/htmlman/manual009.html, under "Keywords", the
keyword "??" is listed.

So far as I can tell, this keyword appears nowhere in the grammar and
is not a possible output from the lexer.

Also, this keyword also matches the lexical syntax for prefix-symbol
as described in "Prefix and infix symbols", so having "??" as a
keyword makes the lexical grammar ambiguous.

Therefore, I think the document is in error and does not describe the
implemented language. I can't figure out what was intended, though.

Tim Freeman
tim@fungible.com
GPG public key fingerprint ECDF 46F8 3B80 BB9E 575D 7180 76DF FE00 34B1 5C78

@vicuna
Copy link
Author

vicuna commented Feb 23, 2003

Comment author: administrator

At http://caml.inria.fr/ocaml/htmlman/manual009.html, under "Keywords", the
keyword "??" is listed.

So far as I can tell, this keyword appears nowhere in the grammar and
is not a possible output from the lexer.

You haven't looked in the right grammar...
"??", like "[<" and ">]" is a keyword of the syntax extensions for streams,
which is implemented in the camlp4 preprocessor.

Also, this keyword also matches the lexical syntax for prefix-symbol
as described in "Prefix and infix symbols", so having "??" as a
keyword makes the lexical grammar ambiguous.

Many keywords are reserved, that also match one of the lexical
conventions for identifiers (for example, all alphabetical keywords).
That doesn't introduce any ambiguity: ?? is a keyword, not an identifier.

Therefore, I think the document is in error and does not describe the
implemented language. I can't figure out what was intended, though.

Actually, we have a bug here, because the normal compiler accepts ?? as
an identifier, but camlp4o cannot compile programs that use it (because
it does recognise ?? as a keyword). The implementation needs to be fixed.

-- Damien

@vicuna
Copy link
Author

vicuna commented Feb 23, 2003

Comment author: administrator

Need to make ?? a keyword in parsing/lexer.mll.

@vicuna
Copy link
Author

vicuna commented Feb 23, 2003

Comment author: administrator

You haven't looked in the right grammar...
"??", like "[<" and ">]" is a keyword of the syntax extensions for streams,
which is implemented in the camlp4 preprocessor.

Makes sense. Thanks.

Tim Freeman
tim@fungible.com
GPG public key fingerprint ECDF 46F8 3B80 BB9E 575D 7180 76DF FE00 34B1 5C78

@vicuna vicuna closed this as completed Mar 5, 2003
@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