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

Add typeof #4037

Open
wants to merge 179 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
179 commits
Select commit Hold shift + click to select a range
6780500
First stab.
toots Jul 18, 2024
b60d940
Fix json export.
toots Jul 18, 2024
4a354ed
First test.
toots Jul 18, 2024
94d6c46
Include default env.
toots Jul 18, 2024
58918a6
Cleanup.
toots Jul 18, 2024
a881f15
Bump pre-commit.
toots Jul 18, 2024
b9731ef
Simplify.
toots Jul 19, 2024
ca01fa8
Merge remote-tracking branch 'origin/main' into typeof
toots Jul 19, 2024
f25e853
Merge remote-tracking branch 'origin/main' into typeof
toots Jul 19, 2024
c775891
Merge remote-tracking branch 'origin/main' into typeof
toots Jul 19, 2024
7f78f14
Merge branch 'main' into typeof
toots Aug 20, 2024
d05ed54
Add top-level insert_tag. (#4101)
toots Aug 20, 2024
8324350
Saturn upper bound.
toots Aug 24, 2024
da547e2
Make frame slice be really at most. (#4104)
toots Aug 24, 2024
2c1da6c
Improve normalize_url option.
toots Aug 25, 2024
eede683
Improve.
toots Aug 25, 2024
e9af0ee
Take encoding into account in `string` functions. (#4111)
toots Aug 25, 2024
4002b0b
Generate cache during package install (#4113)
toots Aug 26, 2024
04d7bfd
switch: don't select the same source twice. (#4108)
toots Aug 26, 2024
16e3d46
Add regression test for #4116 (#4120)
toots Sep 2, 2024
eaaddd3
fix typo habor -> harbor (#4121)
fetsorn Sep 4, 2024
ff1ffc3
Fix test.fail calls. (#4129)
toots Sep 12, 2024
588b312
Fix #4124 (#4132)
toots Sep 13, 2024
bfb4b98
Dynamic source tracks. (#4128)
toots Sep 13, 2024
065bb7e
Prioritize, use file decoders file extensions when computing request …
toots Sep 14, 2024
027f566
Expand HLS segment name metadata (#4135)
toots Sep 15, 2024
be06ea1
Add metadata.parse.amplify.
toots Sep 15, 2024
a1e31ca
Default to decibel values.
toots Sep 15, 2024
3a0dcc4
Update ROADMAP.md
toots Sep 20, 2024
da5892e
Format ROADMAP.md
toots Sep 21, 2024
18a3c8c
Build with vx.y.z-*
toots Sep 21, 2024
89dd891
Update to latest TLS API. (#4141)
toots Sep 24, 2024
6529d37
Keep builtins at runtime (#4142)
toots Sep 24, 2024
b17848d
Fix call to `string.length` (#4145)
toots Sep 27, 2024
e6d1cf4
Fix pre-commit.
toots Sep 27, 2024
94bd991
Change the default amplify behavior in autocue.
toots Sep 28, 2024
3490485
Initialize ffmpeg filter input clocks as passive clocks. (#4146)
toots Sep 28, 2024
73754f6
Move doc generation to liquidsoap package, add pandoc and pandoc-include
toots Sep 28, 2024
3d1efb5
bump number of queues.
toots Sep 29, 2024
e498aa8
Set thread names. (#4148)
toots Sep 30, 2024
86ea361
Cleanup thread name code. (#4150)
toots Sep 30, 2024
c31fd7c
Fix append operator. (#4152)
toots Oct 1, 2024
4a5f888
Add generic thread queues, use them to implement autocue-specific que…
toots Oct 2, 2024
1267230
Update threads.md
toots Oct 2, 2024
5e1bffa
Fix formatting.
toots Oct 2, 2024
37870b3
Add method to return the sequence's current queue.
toots Oct 3, 2024
c15b3c1
Log.
toots Oct 3, 2024
b3fce2f
Cleanup source.dynamic, fix `append` (#4156)
toots Oct 4, 2024
1bbd026
Add spinitron API functions. (#4158)
toots Oct 7, 2024
b1a3067
Disable logs when values are zero, treat them as explicit disabled
toots Oct 7, 2024
810da01
Print positions in this log.
toots Oct 7, 2024
bf25a0d
Fix `blank.strip` (#4164)
toots Oct 8, 2024
cd6da13
FFmpeg filters: keep value in TS unit, move time-based values to `_time`
toots Oct 8, 2024
fa6120d
Add warning about frame duration in autocue/ebur128 filter.
toots Oct 9, 2024
6ec7041
Add request.duration.<decoder>, use it to get a precise duration in
toots Oct 9, 2024
e3a313f
Reuse initial request.duration.
toots Oct 9, 2024
b51adac
Better log.
toots Oct 10, 2024
ed6b33e
Reset last metadata on new track by default (#4166)
toots Oct 10, 2024
ff197c7
Add macos_say. (#4167)
toots Oct 10, 2024
9f19af1
Fix append logic (#4169)
toots Oct 11, 2024
b2ce54f
Revert "FFmpeg filters: keep value in TS unit, move time-based values…
toots Oct 11, 2024
71dc78f
Make sure we test for reselection when `source.dynamic` callback retu…
toots Oct 12, 2024
8aaaac5
Make pulseaudio input and output resilient to errors. (#4174)
toots Oct 13, 2024
5aa7c5c
Update README.md
toots Oct 13, 2024
6ec8b85
Catch and report exceptions raised when removing inotify handlers.
toots Oct 13, 2024
f81ddf7
Add liq_disable_autocue to the list of metadata used to disable autocue.
toots Oct 13, 2024
b1ad9fb
Fix this.
toots Oct 13, 2024
936ba19
Allow nested static request (#4175)
toots Oct 14, 2024
ac07f75
Fix logic.
toots Oct 14, 2024
2ebece6
Also mark last try when closing on error.
toots Oct 14, 2024
15ed3c9
Add debugging log.
toots Oct 14, 2024
5acc01e
Better.
toots Oct 14, 2024
dab14b2
Check if before source is ready in crossfade before returning it. (#4…
toots Oct 15, 2024
8392d18
Pulseaudio IO: use stream to control latency, not device!
toots Oct 16, 2024
8507406
Don't run automatic autocue when override metadata is detected.
toots Oct 16, 2024
624a57a
Use gettimeofday.
toots Oct 16, 2024
d2028d3
Remove log.
toots Oct 16, 2024
ba752fa
Better logging and doc.
toots Oct 16, 2024
c8c6650
Introducing Liquidsoap Guru on Gurubase.io (#4178)
kursataktas Oct 18, 2024
adaf6f0
Better doc.
toots Oct 20, 2024
a59e5b2
Prevent initializing stereotool with two different libraries. (#4182)
toots Oct 20, 2024
e0d80bb
Force string type.
toots Oct 21, 2024
7387b07
Add missing deps.
toots Oct 21, 2024
0705edb
Backport autocue improvements from 2.2.x (#4184)
toots Oct 23, 2024
fadb211
Change default values for fade out type and autocue loudness target (…
RM-FM Oct 24, 2024
8063c40
Show error message once for native fonts. (#4191)
smimram Oct 25, 2024
e223a4f
Fix tracks runtime type check. (#4193)
toots Oct 26, 2024
1477db3
Cleanup inotify watch when garbage collected.
toots Oct 27, 2024
2502e48
Set ratio to 70x
toots Oct 28, 2024
461b404
No TODO here.
toots Oct 28, 2024
f906abe
Add global request timeout setting. (#4196)
toots Oct 29, 2024
0117201
Add LIQ_COMPACT_AFTER_TYPECHECK
toots Oct 29, 2024
cc5b179
Add init.compact_before_start.
toots Oct 29, 2024
cb27b12
Experimental NDI output (#4181)
toots Oct 30, 2024
ebb8f27
Restore memetrace build config.
toots Oct 31, 2024
c0022f4
Prevent error here.
toots Oct 31, 2024
8205fb4
Don't retain passive clocks at top-level (#4198)
toots Nov 1, 2024
28a1d7e
Single: always return a fresh source. (#4200)
toots Nov 3, 2024
c4f2cd2
Better source telnet commands. (#4206)
toots Nov 9, 2024
2128d4b
Factor out source.dump/source.drop (#4207)
toots Nov 9, 2024
1516a22
Force sleep.
toots Nov 9, 2024
f7100ca
Make it possible to disable command registration in playlist, switch
toots Nov 10, 2024
266fea4
Don't run flush_source if scheduler is not started.
toots Nov 11, 2024
8a69deb
Make set_thread_name future proof.
toots Nov 11, 2024
8d85011
Get rid of stdlib wrapper.
toots Nov 11, 2024
e2a0c13
Remove this.
toots Nov 15, 2024
f761e12
Revert "Remove this."
toots Nov 15, 2024
fc75ffe
Factor out Http auth parse logic, test it. (#4211)
toots Nov 18, 2024
80e1cdd
Fix override implementation logic.
toots Nov 18, 2024
7193d68
Strip implicit tracks when evaluating values. (#4212)
toots Nov 18, 2024
d1ecc38
Update log.
toots Nov 18, 2024
138851d
Add global meta setting to amplify. (#4213)
toots Nov 19, 2024
75197d5
Remove this.
toots Nov 19, 2024
aeb88ca
Better clock filter.
toots Nov 19, 2024
3efd6bb
Remove `source.{dump, drop}`, add `request.{dump, process}`. (#4216)
toots Nov 19, 2024
ddacc98
Cleanup single fallible case. (#4218)
toots Nov 22, 2024
f57753a
Bring back default telnet commands.
toots Nov 22, 2024
b4baf8e
Revert scheduler changes. (#4219)
toots Nov 23, 2024
0452d1f
Cleanup logic.
toots Nov 24, 2024
0a5c8de
Use String.split_on_char.
toots Nov 24, 2024
4911be5
Use String.trim. Fixes: #4223
toots Nov 24, 2024
884a5b4
Add entry for regexp in migration doc.
toots Nov 24, 2024
5a59bd5
Cleanup regexp usages (#4224)
toots Nov 25, 2024
ada2078
Use new images. (#4226)
toots Nov 25, 2024
e869bbe
Prepare for release.
toots Nov 26, 2024
7fdc31b
Try this.
toots Nov 26, 2024
f631b7d
Add this.
toots Nov 26, 2024
457c7f0
Update README.md
toots Nov 26, 2024
60a6e53
Here too.
toots Nov 26, 2024
ed3ce0e
Add NDI entry.
toots Nov 26, 2024
4312bc4
Add explanation.
toots Nov 27, 2024
98aeeaa
Update README.md
toots Nov 27, 2024
b46551a
Fix.
toots Nov 27, 2024
073598a
Bump menhir.
toots Nov 29, 2024
b986061
Effect is a keywork on OCaml 5.3.
toots Nov 30, 2024
e31ed92
Format.
toots Nov 30, 2024
246e105
Try this.
toots Nov 30, 2024
7d48b79
Revert "Try this."
toots Nov 30, 2024
962a50b
Switch to new windows build image. (#4234)
toots Nov 30, 2024
6d0e3f5
Bump version.
toots Dec 4, 2024
3b8eafe
Minor bump for now.
toots Dec 4, 2024
1148bb3
Add support for WAVE_FORMAT_EXTENSIBLE
toots Dec 4, 2024
1d1c7ff
Revert this.
toots Dec 4, 2024
8a5acd3
Proper versions
toots Dec 4, 2024
b320ae7
Bump mm dep.
toots Dec 5, 2024
2c5b510
Convert all icy metadata to utf8.
toots Dec 6, 2024
44e38bf
ALSA fixes (#4242)
toots Dec 7, 2024
2765737
Add issue.
toots Dec 7, 2024
596e08a
Improve song metadata handling in `input.harbor` (#4244)
toots Dec 7, 2024
5467bf0
Fix mutual recursion between autocue and replaygain metadata resolver…
toots Dec 8, 2024
9ad6996
Fix changes.
toots Dec 8, 2024
67d7153
Fix typo. prevent CI run on non-essential files.
toots Dec 8, 2024
ee2c59c
let go YAML's `not_found` exception (#4249)
martinkirch Dec 9, 2024
056e5f9
Add string.compare.
toots Dec 10, 2024
000c74f
Add support for type annotations for optional types with methods. (#4…
toots Dec 10, 2024
709c677
SRT cleanup.
toots Dec 11, 2024
37d0086
Add support for native xml parsing. (#4252)
toots Dec 12, 2024
96bfd47
Add source.drop.track_marks and source.drop.metadata_track_marks, update
toots Dec 13, 2024
ed56242
Reimplement audioscrobbler natively (#4250)
toots Dec 14, 2024
a42b158
Remove assert
toots Dec 14, 2024
1501770
Add migration doc for `source.dynamic`. Fixes: #4268
toots Dec 14, 2024
5c4957d
Fix this.
toots Dec 14, 2024
906f8e3
Remove name.
toots Dec 14, 2024
c6d59c6
Send last metadata when connecting to icecast. (#4270)
toots Dec 14, 2024
be56830
Update audioscrobbler.liq (#4271)
gAlleb Dec 15, 2024
4b7aec8
Bump saturn. (#4105)
toots Dec 15, 2024
397f73b
Fix typo
toots Dec 15, 2024
6b3eed2
Fix inotify GC cleanup removing the watch function (#4278)
toots Dec 21, 2024
27426b1
Try this.
toots Dec 28, 2024
2c1ffa5
Rerun on .git change
toots Dec 28, 2024
41ed163
Fix delay initial conditions. (#4289)
toots Dec 28, 2024
f30dc86
Add more strings to test for parsing.
toots Dec 28, 2024
12a4018
Adapt to new ogg API. (#4291)
toots Jan 1, 2025
3ee8506
Fix parsing of rolling-release version. (#4294)
smimram Jan 1, 2025
6eaefc2
Fix video.add_text.ffmpeg.
toots Jan 2, 2025
a6ed06a
Print SDL version.
toots Jan 2, 2025
eae4897
Fix delay initial conditions again. (#4296)
toots Jan 3, 2025
2f4ba0b
Cleanup preliminary to typeof changes.
toots Jan 3, 2025
ca07c9d
Merge remote-tracking branch 'origin/typeof-cleanup' into typeof
toots Jan 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lang/lexer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ let rec token lexbuf =
| '=' -> GETS
| "end" -> END
| "begin" -> BEGIN
| "typeof" -> TYPEOF
| "if" -> IF
| "then" -> THEN
| "else" -> ELSE
Expand Down
11 changes: 7 additions & 4 deletions src/lang/parser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ open Parser_helper
%token <Parsed_term.time_el> TIME
%token <Parsed_term.time_el * Parsed_term.time_el> INTERVAL
%token <string> ENCODER
%token TYPEOF
%token EOF
%token <Parser_helper.lexer_let_decoration> LET
%token <Parser_helper.lexer_let_decoration> LETLBRA
Expand Down Expand Up @@ -83,6 +84,7 @@ open Parser_helper
%nonassoc YIELDS (* fun x -> (x+x) *)
%right SET (* expr := (expr + expr), expr := (expr := expr) *)
%nonassoc QUESTION (* x ? y : z *)
%nonassoc TYPEOF (* typeof v? *)
%left AND (* ((x+(y*z))==3) or ((not a)==b) *)
%left OR
%nonassoc NOT
Expand Down Expand Up @@ -295,6 +297,7 @@ ty:
| ty QUESTION_DOT LCUR record_ty RCUR
{ `Method (`Nullable $1, $4) }
| ty DOT LCUR record_ty RCUR { `Method ($1, $4) }
| TYPEOF expr { `Typeof $2 }
| ty_source { `Source $1 }

record_ty:
Expand All @@ -303,15 +306,15 @@ record_ty:
| meth_ty COMMA record_ty { $1::$3 }

meth_ty:
| VAR COLON ty { { optional = false; name = $1; typ = $3; json_name = None } }
| VAR QUESTION COLON ty { { optional = true; name = $1; typ = $4; json_name = None } }
| VAR COLON ty { { optional_meth = false; name = $1; typ = $3; json_name = None } }
| VAR QUESTION COLON ty { { optional_meth = true; name = $1; typ = $4; json_name = None } }
| STRING VAR VAR COLON ty {
match $2 with
|"as" -> { optional = false; name = $3; typ = $5; json_name = Some (render_string ~pos:$loc $1) }
|"as" -> { optional_meth = false; name = $3; typ = $5; json_name = Some (render_string ~pos:$loc $1) }
| _ -> raise (Term_base.Parse_error ($loc, "Invalid type constructor")) }
| STRING VAR VAR QUESTION COLON ty {
match $2 with
|"as" -> { optional = true; name = $3; typ = $6; json_name = Some (render_string ~pos:$loc $1) }
|"as" -> { optional_meth = true; name = $3; typ = $6; json_name = Some (render_string ~pos:$loc $1) }
| _ -> raise (Term_base.Parse_error ($loc, "Invalid type constructor")) }

ty_source:
Expand Down
70 changes: 0 additions & 70 deletions src/lang/parser_helper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -104,76 +104,6 @@ let attach_comments term =
!pending_comments;
pending_comments := []

let mk_source_ty ?pos name args =
let fn = !Hooks.mk_source_ty in
fn ?pos name args

let mk_clock_ty ?pos () =
let fn = !Hooks.mk_clock_ty in
fn ?pos ()

let mk_named_ty ?pos = function
| "_" -> Type.var ?pos:(Option.map Pos.of_lexing_pos pos) ()
| "unit" -> Type.make ?pos:(Option.map Pos.of_lexing_pos pos) Type.unit
| "never" -> Type.make ?pos:(Option.map Pos.of_lexing_pos pos) Type.Never
| "bool" -> Type.make ?pos:(Option.map Pos.of_lexing_pos pos) Type.Bool
| "int" -> Type.make ?pos:(Option.map Pos.of_lexing_pos pos) Type.Int
| "float" -> Type.make ?pos:(Option.map Pos.of_lexing_pos pos) Type.Float
| "string" -> Type.make ?pos:(Option.map Pos.of_lexing_pos pos) Type.String
| "ref" -> Type.reference (Type.var ())
| "clock" -> mk_clock_ty ?pos ()
| "source" -> mk_source_ty ?pos "source" { extensible = true; tracks = [] }
| "source_methods" -> !Hooks.source_methods_t ()
| name -> (
match Type.find_opt_typ name with
| Some c -> c ()
| None ->
let pos =
Option.value ~default:(Lexing.dummy_pos, Lexing.dummy_pos) pos
in
raise
(Term_base.Parse_error
(pos, "Unknown type constructor: " ^ name ^ ".")))

let rec mk_ty ?pos = function
| `Named s -> mk_named_ty ?pos s
| `Nullable t -> Type.(make (Nullable (mk_ty ?pos t)))
| `List t -> Type.(make (List { t = mk_ty ?pos t; json_repr = `Tuple }))
| `Json_object t ->
Type.(
make
(List
{
t = mk_ty ?pos (`Tuple [`Named "string"; t]);
json_repr = `Object;
}))
| `Tuple l -> Type.(make (Tuple (List.map (mk_ty ?pos) l)))
| `Arrow (args, t) ->
Type.(
make
(Arrow
( List.map
(fun (optional, name, t) -> (optional, name, mk_ty ?pos t))
args,
mk_ty ?pos t )))
| `Record l -> List.fold_left (mk_meth_ty ?pos) Type.(make (Tuple [])) l
| `Method (t, l) -> List.fold_left (mk_meth_ty ?pos) (mk_ty ?pos t) l
| `Invoke (t, s) -> snd (Type.invoke (mk_ty ?pos t) s)
| `Source (s, p) -> mk_source_ty ?pos s p

and mk_meth_ty ?pos base { Term.name; optional; typ; json_name } =
Type.(
make
(Meth
( {
meth = name;
optional;
scheme = ([], mk_ty ?pos typ);
doc = "";
json_name;
},
base )))

let let_args ~decoration ~pat ?arglist ~def ?cast () =
{ decoration; pat; arglist; def; cast }

Expand Down
1 change: 0 additions & 1 deletion src/lang/parser_helper.mli
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ type let_opt_el = string * Term.t
val clear_comments : unit -> unit
val append_comment : pos:pos -> string -> unit
val attach_comments : Term.t -> unit
val mk_ty : ?pos:pos -> Parsed_term.type_annotation -> Type.t

val mk_let :
pos:pos ->
Expand Down
8 changes: 4 additions & 4 deletions src/lang/pos.ml
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,17 @@ let to_string ?(prefix = "at ") pos =
let string_of_pos = to_string

module Option = struct
type nonrec t = t option
type base = t
type t = base option

let to_string ?prefix : t -> string = function
| Some pos -> to_string ?prefix pos
| None -> "unknown position"
end

module List = struct
(** A list of positions, corresponding to a stack of calls. The toplevel one
is the external caller and the last one is the callee. *)
type nonrec t = t list
type base = t
type t = base list

(** The most relevant position in a call stack. *)
let rec to_pos = function
Expand Down
55 changes: 55 additions & 0 deletions src/lang/pos.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
(*****************************************************************************

Liquidsoap, a programmable stream generator.
Copyright 2003-2024 Savonet team

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details, fully stated in the COPYING
file at the root of the liquidsoap distribution.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

*****************************************************************************)

(** Operations on positions (in source files). *)

type t

type pos = {
fname : string;
lstart : int;
lstop : int;
cstart : int;
cstop : int;
}

val pack_offset : int
val pack : pos -> t
val unpack : t -> pos
val of_lexing_pos : Lexing.position * Lexing.position -> t
val to_string : ?prefix:string -> t -> string
val string_of_pos : ?prefix:string -> t -> string

module Option : sig
type base = t
type t = base option

val to_string : ?prefix:string -> t -> string
end

module List : sig
type base = t
type t = base list

val to_pos : t -> base
val to_string : ?newlines:bool -> ?prefix:string -> t -> string
end
1 change: 1 addition & 0 deletions src/lang/repr.ml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ let make ?(filter_out = fun _ -> false) ?(generalized = []) t : t =
`Arrow
( List.map (fun (opt, lbl, t) -> (opt, lbl, repr g t)) args,
repr g t )
| Var { contents = Typeof t } -> repr g (Lazy.force t)
| Var { contents = Free var } ->
if List.exists (Var.eq var) g then uvar g var else evar var
| Var { contents = Link (`Covariant, t) } when !debug || !debug_variance
Expand Down
6 changes: 6 additions & 0 deletions src/lang/runtime.ml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ let throw ?(formatter = Format.std_formatter) ?lexbuf () =
(Printexc.to_string e) bt;
raise Error

let () =
Term_reducer.typecheck :=
fun ?env tm ->
let throw = throw () in
Typechecking.check ?env ~throw tm

(* This is not great but it works for now. The problem being that we are relying on exception
raising and catching to transmit language error, translate them into human readable errors and
optionally ignore them with a warning. But, in some cases, we still want to return afterward
Expand Down
66 changes: 33 additions & 33 deletions src/lang/term/parsed_term.ml
Original file line number Diff line number Diff line change
Expand Up @@ -55,39 +55,6 @@ and pattern_entry =

and meth_term_default = [ `Nullable | `Pattern of pattern | `None ]

type meth_annotation = {
optional : bool;
name : string;
typ : type_annotation;
json_name : string option;
}

and source_track_annotation = {
track_name : string;
track_type : string;
track_params : track_annotation list;
}

and source_annotation = {
extensible : bool;
tracks : source_track_annotation list;
}

and argument = bool * string * type_annotation

and type_annotation =
[ `Named of string
| `Nullable of type_annotation
| `List of type_annotation
| `Json_object of type_annotation
| `Tuple of type_annotation list
| `Arrow of argument list * type_annotation
| `Record of meth_annotation list
| `Method of type_annotation * meth_annotation list
| `Invoke of type_annotation * string
| `Source of string * source_annotation ]
[@@deriving hash]

type _of = { only : string list; except : string list; source : string }
[@@deriving hash]

Expand Down Expand Up @@ -171,6 +138,39 @@ and time_el = {
seconds : int option;
}

and meth_annotation = {
optional_meth : bool;
name : string;
typ : type_annotation;
json_name : string option;
}

and source_track_annotation = {
track_name : string;
track_type : string;
track_params : track_annotation list;
}

and source_annotation = {
extensible : bool;
tracks : source_track_annotation list;
}

and argument = bool * string * type_annotation

and type_annotation =
[ `Named of string
| `Nullable of type_annotation
| `List of type_annotation
| `Json_object of type_annotation
| `Tuple of type_annotation list
| `Arrow of argument list * type_annotation
| `Record of meth_annotation list
| `Method of type_annotation * meth_annotation list
| `Invoke of type_annotation * string
| `Typeof of t
| `Source of string * source_annotation ]

(* These terms are reduced at runtime *)
and parsed_ast =
[ `If of _if
Expand Down
Loading
Loading