Use syntax extension for parsing stanza
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
parent
bac0a35785
commit
655c10164d
|
@ -1,7 +1,6 @@
|
||||||
type stanza = Stanza.t = ..
|
type stanza = Stanza.t = ..
|
||||||
|
|
||||||
module Stanza = struct
|
module Stanza = struct
|
||||||
open Import
|
|
||||||
open Stanza.Of_sexp
|
open Stanza.Of_sexp
|
||||||
|
|
||||||
let field_oslu name = Ordered_set_lang.Unexpanded.field name
|
let field_oslu name = Ordered_set_lang.Unexpanded.field name
|
||||||
|
@ -38,9 +37,10 @@ module Stanza = struct
|
||||||
(pat, configs))
|
(pat, configs))
|
||||||
|
|
||||||
let t =
|
let t =
|
||||||
Syntax.since Stanza.syntax (1, 0) >>= fun () ->
|
let%map () = Syntax.since Stanza.syntax (1, 0)
|
||||||
loc >>= fun loc ->
|
and loc = loc
|
||||||
repeat rule >>| fun rules ->
|
and rules = repeat rule
|
||||||
|
in
|
||||||
{ loc; rules }
|
{ loc; rules }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1592,7 +1592,9 @@ module Stanzas = struct
|
||||||
(let%map () = Syntax.since Stanza.syntax (1, 0)
|
(let%map () = Syntax.since Stanza.syntax (1, 0)
|
||||||
and t = Tests.single in
|
and t = Tests.single in
|
||||||
[Tests t])
|
[Tests t])
|
||||||
; "env", Dune_env.Stanza.t >>| fun x -> [Dune_env.T x]
|
; "env",
|
||||||
|
(let%map x = Dune_env.Stanza.t in
|
||||||
|
[Dune_env.T x])
|
||||||
]
|
]
|
||||||
|
|
||||||
let jbuild_parser =
|
let jbuild_parser =
|
||||||
|
|
Loading…
Reference in New Issue