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

<:str_item< let $lid:id$ = $e$ >> in patterns #4602

Closed
vicuna opened this issue Aug 24, 2008 · 2 comments
Closed

<:str_item< let $lid:id$ = $e$ >> in patterns #4602

vicuna opened this issue Aug 24, 2008 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Aug 24, 2008

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

Bug description

When using the quotations in the original syntax, <:str_item< let x = 1 >> is transformed into

Camlp4.PreCast.Syntax.Ast.StSem (,
Camlp4.PreCast.Syntax.Ast.StVal (, Camlp4.PreCast.Syntax.Ast.BFalse,
Camlp4.PreCast.Syntax.Ast.BiEq (,
Camlp4.PreCast.Syntax.Ast.PaId (,
Camlp4.PreCast.Syntax.Ast.IdLid (, "x")),
Camlp4.PreCast.Syntax.Ast.ExInt (, "1"))),
Camlp4.PreCast.Syntax.Ast.StNil )

(which is fine). However, when used in a pattern, <:str_item< let $lid:id$ = $e$ >> should be transformed into

Ast.StVal (, Ast.BFalse,
(Ast.BiEq (
, (Ast.PaId (, (Ast.IdLid (, id)))), e)))

instead of the current

Ast.StSem (,
(Ast.StVal (
, Ast.BFalse,
(Ast.BiEq (, (Ast.PaId (, (Ast.IdLid (_, id)))), e)))),
(Ast.StNil _))

Indeed the latter will not match [let x = 1] in <:str_item< let x = 1 let y = 2 >>

@vicuna
Copy link
Author

vicuna commented Aug 22, 2012

Comment author: @bobzhang

Should this be closed? I can not reproduce it.

@vicuna
Copy link
Author

vicuna commented Sep 17, 2012

Comment author: @damiendoligez

I can't reproduce this either. Camlp4 now generates a StVal-rooted tree for both expression and pattern.

@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