| Anonymous | Login | Signup for a new account | 2013-06-19 23:25 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
| 0005114 | OCaml | Camlp4 | public | 2010-07-25 14:40 | 2012-09-18 13:01 | ||||||
| Reporter | Hendrik Tews | ||||||||||
| Assigned To | xclerc | ||||||||||
| Priority | high | Severity | minor | Reproducibility | always | ||||||
| Status | assigned | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | 3.12.0+beta1 or 3.12.0+rc1 | ||||||||||
| Target Version | 4.00.2+dev | Fixed in Version | |||||||||
| Summary | 0005114: wrong location inside alias patterns | ||||||||||
| Description | For "let (a8, a9) as a10 = (9,10)" camlp4o gives the identifier a10 the same location as the whole alias pattern "(a8, a9) as a10". When I dump the camlp4 ast I see StVal (["test/c.ml": 1:0-28 1:28], ... PaAli (["test/c.ml": 1:4-19 1:19], ... PaId (["test/c.ml": 1:4-19 1:19], IdLid (["test/c.ml": 1:4-19 1:19], "a10"))), ...) The problem is present in 3.11.2 and in the release candidate. | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Notes |
|
|
(0005622) Hendrik Tews (reporter) 2010-07-26 22:02 |
Same problem for "exception A of int". Here "A" gets the location of "A of int". |
|
(0005623) Hendrik Tews (reporter) 2010-07-27 16:44 |
Same for "exception A of int" in interfaces or signatures. |
|
(0005660) Hendrik Tews (reporter) 2010-09-16 16:29 |
Same for "type t = { a : int }". Here "a" gets the location of "a : int". If the field is "mutable a : int" then the location of "a" covers "mutable as well. Happens in interfaces and implementations. |
|
(0005661) Hendrik Tews (reporter) 2010-09-16 16:50 |
Same for "class type virtual ['a] t = ... Here the location for t starts with "virtual". Happens also in interfaces for class types and classes. |
|
(0005662) Hendrik Tews (reporter) 2010-09-16 17:13 |
Same for "class virtual ['a] t = ... in structures. Here the location of "t" starts with virtual. |
|
(0005663) Hendrik Tews (reporter) 2010-09-16 17:25 |
Same for infix operators: for "let ( *** ) ..." the location for "***" contains the parenthesis'. |
|
(0006852) Hendrik Tews (reporter) 2012-01-30 22:03 |
Hi, I added a first patch that fixes the locations inside exceptions. I would invest some more time to fix the other issues as well, however, I would like to have some feedback before I proceed. The uploaded patch is a diff against the distributed version ocaml-3.12.1. However, the version 3.12.1 is not distributed with a fully bootstraped camlp4. Therefore, before applying the patch you first have to bootstrap camlp4 until the fixpoint is reached. Hendrik |
|
(0007785) Hendrik Tews (reporter) 2012-07-20 11:07 |
I uploaded a new patch (against 4.00 branch) that fixes the problem for exceptions in structures and signatures (notes 5622 and 5623). This patch only contains the diff for the real parser sources and not for the generated code in camlp4/boot. |
|
(0008103) doligez (manager) 2012-09-18 11:45 |
For infix operators, I think this is on purpose. The standard parser also does that, and more generally if an expression is enclosed in parentheses, its location includes the parentheses. We could discuss whether that is a good thing, but for the moment you might want to keep camlp4 as close as possible to the standard parser. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2010-07-25 14:40 | Hendrik Tews | New Issue | |
| 2010-07-25 14:40 | Hendrik Tews | Status | new => assigned |
| 2010-07-25 14:40 | Hendrik Tews | Assigned To | => ertai |
| 2010-07-26 22:02 | Hendrik Tews | Note Added: 0005622 | |
| 2010-07-27 16:44 | Hendrik Tews | Note Added: 0005623 | |
| 2010-09-16 16:29 | Hendrik Tews | Note Added: 0005660 | |
| 2010-09-16 16:50 | Hendrik Tews | Note Added: 0005661 | |
| 2010-09-16 17:13 | Hendrik Tews | Note Added: 0005662 | |
| 2010-09-16 17:25 | Hendrik Tews | Note Added: 0005663 | |
| 2011-10-26 08:38 | ertai | Assigned To | ertai => xclerc |
| 2012-01-30 21:49 | Hendrik Tews | File Added: patch | |
| 2012-01-30 22:03 | Hendrik Tews | Note Added: 0006852 | |
| 2012-07-10 20:00 | doligez | Target Version | => 4.01.0+dev |
| 2012-07-20 11:04 | Hendrik Tews | File Added: new-patch | |
| 2012-07-20 11:07 | Hendrik Tews | Note Added: 0007785 | |
| 2012-07-31 13:36 | doligez | Target Version | 4.01.0+dev => 4.00.1+dev |
| 2012-09-18 11:45 | doligez | Note Added: 0008103 | |
| 2012-09-18 13:01 | doligez | Priority | normal => high |
| 2012-09-18 13:01 | doligez | Target Version | 4.00.1+dev => 4.00.2+dev |
| Copyright © 2000 - 2011 MantisBT Group |