Commit 040c6926 authored by POTTIER Francois's avatar POTTIER Francois

Import [Positions.position].

parent 69e4bdc1
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
(* *) (* *)
(******************************************************************************) (******************************************************************************)
let position = Positions.position
open Keyword open Keyword
open UnparameterizedSyntax open UnparameterizedSyntax
open ListMonad open ListMonad
...@@ -74,7 +75,7 @@ let check_no_producer_attributes producer = ...@@ -74,7 +75,7 @@ let check_no_producer_attributes producer =
() ()
| (id, _payload) :: _attributes -> | (id, _payload) :: _attributes ->
Error.error Error.error
[Positions.position id] [position id]
"the nonterminal symbol %s is declared %%inline.\n\ "the nonterminal symbol %s is declared %%inline.\n\
A use of it cannot carry an attribute." A use of it cannot carry an attribute."
(producer_symbol producer) (producer_symbol producer)
...@@ -191,7 +192,7 @@ let inline_branch caller (prefix, producer, suffix) (callee : branch) : branch = ...@@ -191,7 +192,7 @@ let inline_branch caller (prefix, producer, suffix) (callee : branch) : branch =
(* Check condition 1. *) (* Check condition 1. *)
if List.length suffix > 0 then begin if List.length suffix > 0 then begin
let nt = producer_symbol producer in let nt = producer_symbol producer in
Error.error [ Positions.position callee_prec; caller.branch_position ] Error.error [ position callee_prec; caller.branch_position ]
"this production carries a %%prec annotation,\n\ "this production carries a %%prec annotation,\n\
and the nonterminal symbol %s is marked %%inline.\n\ and the nonterminal symbol %s is marked %%inline.\n\
For this reason, %s can be used only in tail position." For this reason, %s can be used only in tail position."
...@@ -200,7 +201,7 @@ let inline_branch caller (prefix, producer, suffix) (callee : branch) : branch = ...@@ -200,7 +201,7 @@ let inline_branch caller (prefix, producer, suffix) (callee : branch) : branch =
(* Check condition 2. *) (* Check condition 2. *)
caller.branch_prec_annotation |> Option.iter (fun caller_prec -> caller.branch_prec_annotation |> Option.iter (fun caller_prec ->
let nt = producer_symbol producer in let nt = producer_symbol producer in
Error.error [ Positions.position callee_prec; Positions.position caller_prec ] Error.error [ position callee_prec; position caller_prec ]
"this production carries a %%prec annotation,\n\ "this production carries a %%prec annotation,\n\
and the nonterminal symbol %s is marked %%inline.\n\ and the nonterminal symbol %s is marked %%inline.\n\
For this reason, %s cannot be used in a production\n\ For this reason, %s cannot be used in a production\n\
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment