diff options
author | Emilio Jesus Gallego Arias <e+git@x80.org> | 2017-12-10 09:26:25 +0100 |
---|---|---|
committer | Emilio Jesus Gallego Arias <e+git@x80.org> | 2018-02-22 00:44:33 +0100 |
commit | 9bebbb96e58b3c1b0f7f88ba2af45462eae69b0f (patch) | |
tree | 24e8de17078242c1ea39e31ecfe55a1c024d0eff /parsing/g_prim.ml4 | |
parent | 0c5f0afffd37582787f79267d9841259095b7edc (diff) |
[ast] Improve precision of Ast location recognition in serialization.
We follow the suggestions in #402 and turn uses of `Loc.located` in
`vernac` into `CAst.t`. The impact should be low as this change mostly
affects top-level vernaculars.
With this change, we are even closer to automatically map a text
document to its AST in a programmatic way.
Diffstat (limited to 'parsing/g_prim.ml4')
-rw-r--r-- | parsing/g_prim.ml4 | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/parsing/g_prim.ml4 b/parsing/g_prim.ml4 index 891c232ee..0b7efe739 100644 --- a/parsing/g_prim.ml4 +++ b/parsing/g_prim.ml4 @@ -43,13 +43,13 @@ GEXTEND Gram [ [ LEFTQMARK; id = ident -> id ] ] ; pattern_identref: - [ [ id = pattern_ident -> Loc.tag ~loc:!@loc id ] ] + [ [ id = pattern_ident -> CAst.make ~loc:!@loc id ] ] ; var: (* as identref, but interpret as a term identifier in ltac *) - [ [ id = ident -> Loc.tag ~loc:!@loc id ] ] + [ [ id = ident -> CAst.make ~loc:!@loc id ] ] ; identref: - [ [ id = ident -> Loc.tag ~loc:!@loc id ] ] + [ [ id = ident -> CAst.make ~loc:!@loc id ] ] ; field: [ [ s = FIELD -> Id.of_string s ] ] @@ -70,8 +70,8 @@ GEXTEND Gram ] ] ; name: - [ [ IDENT "_" -> Loc.tag ~loc:!@loc Anonymous - | id = ident -> Loc.tag ~loc:!@loc @@ Name id ] ] + [ [ IDENT "_" -> CAst.make ~loc:!@loc Anonymous + | id = ident -> CAst.make ~loc:!@loc @@ Name id ] ] ; reference: [ [ id = ident; (l,id') = fields -> @@ -95,7 +95,7 @@ GEXTEND Gram ] ] ; ne_lstring: - [ [ s = ne_string -> Loc.tag ~loc:!@loc s ] ] + [ [ s = ne_string -> CAst.make ~loc:!@loc s ] ] ; dirpath: [ [ id = ident; l = LIST0 field -> @@ -105,7 +105,7 @@ GEXTEND Gram [ [ s = STRING -> s ] ] ; lstring: - [ [ s = string -> (Loc.tag ~loc:!@loc s) ] ] + [ [ s = string -> (CAst.make ~loc:!@loc s) ] ] ; integer: [ [ i = INT -> my_int_of_string (!@loc) i |