diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index bafe8b06a4..1535702b1f 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -7,6 +7,7 @@ on: branches: - main - jane + - jane-fuzz pull_request: workflow_dispatch: @@ -37,6 +38,9 @@ jobs: - name: Opam dependencies run: opam install --deps-only -t . + - name: Install ocamlgrammarfuzzer + run: opam pin add ocamlgrammarfuzzer https://github.com/shogan-ai/ocamlgrammarfuzzer.git#v0.1 -y + - name: Self-formatting test run: opam exec -- dune build @fmt @@ -48,5 +52,8 @@ jobs: - name: Runtest run: opam exec -- dune runtest + - name: Running fuzzer + run: WITH_FUZZER=true opam exec -- dune build @fuzzer-update-state + - name: Check manpages run: opam exec -- dune build @gen_manpage --auto-promote diff --git a/HACKING.jst.md b/HACKING.jst.md index 2da4c599c1..eb6651f2f7 100644 --- a/HACKING.jst.md +++ b/HACKING.jst.md @@ -196,3 +196,104 @@ sequence of commits and it's all ready to merge, just run `git rebase --signoff`, where `` is the commit before any of your edits. You can often say something like `origin/jane` or `HEAD~4` or similar. + +Fuzzing +------- + +The continuous integration (CI) process uses +[OCamlgrammarfuzzer](https://github.com/shogan-ai/ocamlgrammarfuzzer.git) to +prevent regressions in syntax coverage. + +### Fuzzing Locally + +To fuzz `ocamlformat` locally, you must first install **`ocamlgrammarfuzzer`**. +It's recommended to use the same version as the CI (v0.1) to ensure reproducible +results: + +```bash +opam pin add ocamlgrammarfuzzer https://github.com/shogan-ai/ocamlgrammarfuzzer.git#v0.1 +``` + +The fuzzer is integrated into the Makefile's **`fuzz`** target: + +```bash +make fuzz +``` + +This target will build `ocamlformat`, run the fuzzer, display statistics, and +generate two key report files: + +* [build/default/test/fuzzer/report.md](build/default/test/fuzzer/report.md): + classifies failures in the current version of `ocamlformat`. +* [build/default/test/fuzzer/regressions_report.md](build/default/test/fuzzer/regressions_report.md): + classifies regressions in the current version compared to the previously saved + state. + +If there were no regressions, it update the state file. +This logic is implemented in [`test/fuzzer/run.sh`](test/fuzzer/run.sh). + +### Updating Coverage State + +Regression detection is performed by comparing the latest fuzzing run against a +previous run, saved in `test/fuzzer/state.dat`. + +To set a new baseline (reference state) for comparison, this file must be +updated using the `fuzz-update-state` target: + +```bash +make fuzz-update-state +``` + +The beginning of the `state.dat` file contains metadata that summarizes the run: + +``` +version: OCAMLGRAMMARFUZZER0 +hash: 1f9752ec82afce3e0946465b84a6e5f2 +sentences: 490799 +valid sentences: 391730 +syntax errors: 59851 +comment errors: 8552 +comments dropped: 8638 +internal errors: 32723 +--- +... +``` + +The initial lines (`version: ...`, `hash: ...`, `sentences: ...`) identify +the **fuzzer version** and the sentence set being tested, to ensure consistency. +The subsequent lines summarize `ocamlformat`'s behavior against the generated +sentences by counting the number of successes and failures per error class. + +When reviewing a pull request that updates the state, a quick look at these +lines can help visually confirm the absence of regressions. The remainder of the +file is fuzzer-specific data. + +### Updating Grammar + +The fuzzer operates against a fixed grammar saved in +[`test/fuzzer/parser.mly`](test/fuzzer/parser.mly). + +To update this fixed grammar file from the source +([`vendor/parser-jane/for-parser-standard/parser.mly`](vendor/parser-jane/for-parser-standard/parser.mly)), +use the **`fuzz-update-grammar`** target: + +```bash +make fuzz-update-grammar +``` + +This should be run **after** any upstream changes to the parser. + +### Dune Aliases + +The [`test/fuzzer/dune`](test/fuzzer/dune) file defines several aliases for +accessing the fuzzer through `dune`: + +* `WITH_FUZZER=true dune build @fuzzer` runs the fuzzer and generates the report files. +* `WITH_FUZZER=true dune build @fuzzer-no-regression` provides a summary and exits with a + **non-zero code** if any regressions are detected. +* `WITH_FUZZER=true dune build @fuzzer-update-state` checks if the current fuzzer state is + up-to-date. If a new state is generated, you must run `WITH_FUZZER=true dune promote` to apply + the changes to `test/fuzzer/state.dat`. + +Note: the rules related to fuzzing are enabled only if `WITH_FUZZER=true` to +prevent dune from executing them in default builds (e.g. `dune build`). diff --git a/Makefile b/Makefile index 5e690620d8..66192c2fbd 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,15 @@ coverage: echo "Coverage report generated in _coverage/" echo " => open _coverage/index.html" +fuzz: + @sh test/fuzzer/run.sh + +fuzz-update-grammar: + cp -f vendor/parser-jane/for-parser-standard/parser.mly test/fuzzer/parser.mly + +fuzz-update-state: + @WITH_FUZZER=true dune build @fuzzer-update-state || WITH_FUZZER=true dune promote + .PHONY: bench bench: @dune build bench/test/source_bench.ml diff --git a/lib/Eol_compat.ml b/lib/Eol_compat.ml index be2f00f510..40a58b95e2 100644 --- a/lib/Eol_compat.ml +++ b/lib/Eol_compat.ml @@ -34,8 +34,10 @@ let normalize_eol ?(exclude_locs = []) ~line_endings s = normalize_segment ~seen_cr:0 i (String.length s) ; Buffer.contents buf | (start, stop) :: xs -> - normalize_segment ~seen_cr:0 i start ; - Buffer.add_substring buf s ~pos:start ~len:(stop - start) ; - loop xs stop + if i < stop then ( + if i < start then normalize_segment ~seen_cr:0 i start ; + Buffer.add_substring buf s ~pos:start ~len:(stop - start) ; + loop xs stop ) + else loop xs i in loop exclude_locs 0 diff --git a/test/fuzzer/dune b/test/fuzzer/dune new file mode 100644 index 0000000000..585b757da3 --- /dev/null +++ b/test/fuzzer/dune @@ -0,0 +1,58 @@ +(rule + (enabled_if %{env:WITH_FUZZER=false}) + (targets parser.cmly parser.ml parser.mli) + (deps parser.mly) + (action + (run menhir --unused-tokens --table --cmly --lalr parser.mly))) + +(rule + (enabled_if %{env:WITH_FUZZER=false}) + (deps parser.cmly state.dat) + (targets state_new.dat report.md regressions_report.md) + (action + (run + %{bin:ocamlgrammarfuzzer} + --ocamlformat-check + --cmly + parser.cmly + --entrypoint + implementation + --entrypoint + interface + --exhaust + --comments + --ocamlformat + %{exe:../../bin/ocamlformat/main.exe} + --regressions-not-fatal + --track-regressions-from + state.dat + --track-regressions-to + state_new.dat + --save-report-to + report.md + --regressions-report-to + regressions_report.md))) + +(rule + (enabled_if %{env:WITH_FUZZER=false}) + (alias fuzzer) + (action + (progn + (run sh -c "echo Check:") + (run sh -c "echo '- '$PWD'/%{dep:report.md} for all errors'") + (run + sh + -c + "if test -s %{dep:regressions_report.md}; then echo '- '$PWD'/%{dep:regressions_report.md} for regressions'; fi")))) + +(rule + (enabled_if %{env:WITH_FUZZER=false}) + (alias fuzzer-no-regression) + (action + (run test ! -s %{dep:regressions_report.md}))) + +(rule + (enabled_if %{env:WITH_FUZZER=false}) + (alias fuzzer-update-state) + (action + (cmp state.dat state_new.dat))) diff --git a/test/fuzzer/parser.mly b/test/fuzzer/parser.mly new file mode 100644 index 0000000000..1469d741f5 --- /dev/null +++ b/test/fuzzer/parser.mly @@ -0,0 +1,5364 @@ +/**************************************************************************/ +/* */ +/* OCaml */ +/* */ +/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ +/* */ +/* Copyright 1996 Institut National de Recherche en Informatique et */ +/* en Automatique. */ +/* */ +/* All rights reserved. This file is distributed under the terms of */ +/* the GNU Lesser General Public License version 2.1, with the */ +/* special exception on linking described in the file LICENSE. */ +/* */ +/**************************************************************************/ + +/* The parser definition */ + +/* The commands [make list-parse-errors] and [make generate-parse-errors] + run Menhir on a modified copy of the parser where every block of + text comprised between the markers [BEGIN AVOID] and ----------- + [END AVOID] has been removed. This file should be formatted in + such a way that this results in a clean removal of certain + symbols, productions, or declarations. */ + +%{ + +[@@@ocaml.warning "-60"] module Str = Ast_helper.Str (* For ocamldep *) +[@@@ocaml.warning "+60"] + +open Asttypes +open Longident +open Parsetree +open Ast_helper +open Docstrings +open Docstrings.WithMenhir +open Parser_types + +let mkloc = Location.mkloc +let mknoloc = Location.mknoloc + +let make_loc (startpos, endpos) = { + Location.loc_start = startpos; + Location.loc_end = endpos; + Location.loc_ghost = false; +} + +let ghost_loc (startpos, endpos) = { + Location.loc_start = startpos; + Location.loc_end = endpos; + Location.loc_ghost = true; +} + +let mktyp ~loc ?attrs d = Typ.mk ~loc:(make_loc loc) ?attrs d +let mkpat ~loc ?attrs d = Pat.mk ~loc:(make_loc loc) ?attrs d +let mkexp ~loc ?attrs d = Exp.mk ~loc:(make_loc loc) ?attrs d +let mkmty ~loc ?attrs d = Mty.mk ~loc:(make_loc loc) ?attrs d +let mksig ~loc d = Sig.mk ~loc:(make_loc loc) d +let mkmod ~loc ?attrs d = Mod.mk ~loc:(make_loc loc) ?attrs d +let mkstr ~loc d = Str.mk ~loc:(make_loc loc) d +let mkclass ~loc ?attrs d = Cl.mk ~loc:(make_loc loc) ?attrs d +let mkcty ~loc ?attrs d = Cty.mk ~loc:(make_loc loc) ?attrs d + +let pstr_typext (te, ext) = + (Pstr_typext te, ext) +let pstr_primitive (vd, ext) = + (Pstr_primitive vd, ext) +let pstr_type ((nr, ext), tys) = + (Pstr_type (nr, tys), ext) +let pstr_exception (te, ext) = + (Pstr_exception te, ext) +let pstr_recmodule (ext, bindings) = + (Pstr_recmodule bindings, ext) + +let psig_typext (te, ext) = + (Psig_typext te, ext) +let psig_value (vd, ext) = + (Psig_value vd, ext) +let psig_type ((nr, ext), tys) = + (Psig_type (nr, tys), ext) +let psig_typesubst ((nr, ext), tys) = + assert (nr = Recursive); (* see [no_nonrec_flag] *) + (Psig_typesubst tys, ext) +let psig_exception (te, ext) = + (Psig_exception te, ext) + +let mkctf ~loc ?attrs ?docs d = + Ctf.mk ~loc:(make_loc loc) ?attrs ?docs d +let mkcf ~loc ?attrs ?docs d = + Cf.mk ~loc:(make_loc loc) ?attrs ?docs d + +let mkrhs rhs loc = mkloc rhs (make_loc loc) +let ghrhs rhs loc = mkloc rhs (ghost_loc loc) + +let push_loc x acc = + if x.Location.loc_ghost + then acc + else x :: acc + +let reloc_pat ~loc x = + { x with ppat_loc = make_loc loc; + ppat_loc_stack = push_loc x.ppat_loc x.ppat_loc_stack } +let reloc_exp ~loc x = + { x with pexp_loc = make_loc loc; + pexp_loc_stack = push_loc x.pexp_loc x.pexp_loc_stack } +let reloc_typ ~loc x = + { x with ptyp_loc = make_loc loc; + ptyp_loc_stack = push_loc x.ptyp_loc x.ptyp_loc_stack } + +let mkexpvar ~loc (name : string) = + mkexp ~loc (Pexp_ident(mkrhs (Lident name) loc)) + +let mkoperator = + mkexpvar + +let mkpatvar ~loc name = + mkpat ~loc (Ppat_var (mkrhs name loc)) + +(* See commentary about ghost locations at the declaration of Location.t *) +let ghexp ~loc d = Exp.mk ~loc:(ghost_loc loc) d +let ghpat ~loc d = Pat.mk ~loc:(ghost_loc loc) d +let ghtyp ~loc ?attrs d = Typ.mk ~loc:(ghost_loc loc) ?attrs d +let ghloc ~loc d = { txt = d; loc = ghost_loc loc } +let ghstr ~loc d = Str.mk ~loc:(ghost_loc loc) d +let ghsig ~loc d = Sig.mk ~loc:(ghost_loc loc) d + +let ghexpvar ~loc name = + ghexp ~loc (Pexp_ident (ghrhs (Lident name) loc)) + +let mkinfix arg1 op arg2 = + Pexp_apply(op, [Nolabel, arg1; Nolabel, arg2]) + +let neg_string f = + if String.length f > 0 && f.[0] = '-' + then String.sub f 1 (String.length f - 1) + else "-" ^ f + +let mkuminus ~oploc name arg = + let result = + match arg.pexp_desc with + | Pexp_constant const -> begin + match name, const with + | "-", Pconst_integer (n, m) -> + Some (Pconst_integer (neg_string n, m)) + | "-", Pconst_unboxed_integer (n, m) -> + Some (Pconst_unboxed_integer (neg_string n, m)) + | ("-" | "-."), Pconst_float (f, m) -> + Some (Pconst_float (neg_string f, m)) + | ("-" | "-."), Pconst_unboxed_float (f, m) -> + Some (Pconst_unboxed_float (neg_string f, m)) + | _, _ -> None + end + | _ -> None + in + match result with + | Some desc -> Pexp_constant desc, arg.pexp_attributes + | None -> + Pexp_apply (mkoperator ~loc:oploc ("~" ^ name), [Nolabel, arg]), [] + +let mkuplus ~oploc name arg = + let desc = arg.pexp_desc in + match name, desc with + | "+", Pexp_constant (Pconst_integer _ | Pconst_unboxed_integer _) + | ("+" | "+."), Pexp_constant (Pconst_float _ | Pconst_unboxed_float _) -> + desc, arg.pexp_attributes + | _ -> + Pexp_apply (mkoperator ~loc:oploc ("~" ^ name), [Nolabel, arg]), [] + +let mk_attr ~loc name payload = + Builtin_attributes.(register_attr Parser name); + Attr.mk ~loc name payload + +let mkpat_with_modes ~loc ~pat ~cty ~modes = + match pat.ppat_desc with + | Ppat_constraint (pat', cty', modes') -> + begin match cty, cty' with + | Some _, None -> + { pat with + ppat_desc = Ppat_constraint (pat', cty, modes @ modes'); + ppat_loc = make_loc loc + } + | None, _ -> + { pat with + ppat_desc = Ppat_constraint (pat', cty', modes @ modes'); + ppat_loc = make_loc loc + } + | _ -> + mkpat ~loc (Ppat_constraint (pat, cty, modes)) + end + | _ -> + begin match cty, modes with + | None, [] -> pat + | cty, modes -> mkpat ~loc (Ppat_constraint (pat, cty, modes)) + end + +let ghpat_with_modes ~loc ~pat ~cty ~modes = + let pat = mkpat_with_modes ~loc ~pat ~cty ~modes in + { pat with ppat_loc = { pat.ppat_loc with loc_ghost = true }} + +let mkexp_constraint ~loc ~exp ~cty ~modes = + match exp.pexp_desc with + | Pexp_constraint (exp', cty', modes') -> + begin match cty, cty' with + | cty, None | None, cty -> + { exp with + pexp_desc = Pexp_constraint (exp', cty, modes @ modes'); + pexp_loc = make_loc loc + } + | _ -> + mkexp ~loc (Pexp_constraint (exp, cty, modes)) + end + | _ -> + begin match cty, modes with + | None, [] -> exp + | cty, modes -> mkexp ~loc (Pexp_constraint (exp, cty, modes)) + end + +let ghexp_constraint ~loc ~exp ~cty ~modes = + let exp = mkexp_constraint ~loc ~exp ~cty ~modes in + { exp with pexp_loc = { exp.pexp_loc with loc_ghost = true }} + +let exclave_ext_loc loc = mkloc "extension.exclave" loc + +let exclave_extension loc = + Exp.mk ~loc:Location.none + (Pexp_extension(exclave_ext_loc loc, PStr [])) + +let mkexp_exclave ~loc ~kwd_loc exp = + ghexp ~loc (Pexp_apply(exclave_extension (make_loc kwd_loc), [Nolabel, exp])) + +let mktyp_curry typ loc = + {typ with ptyp_attributes = + Builtin_attributes.curry_attr loc :: typ.ptyp_attributes} + +let maybe_curry_typ typ loc = + match typ.ptyp_desc with + | Ptyp_arrow _ -> + if Builtin_attributes.has_curry typ.ptyp_attributes then typ + else mktyp_curry typ (make_loc loc) + | _ -> typ + +(* TODO define an abstraction boundary between locations-as-pairs + and locations-as-Location.t; it should be clear when we move from + one world to the other *) + +let mkexp_cons_desc consloc args = + Pexp_construct(mkrhs (Lident "::") consloc, Some args) +let mkexp_cons ~loc consloc args = + mkexp ~loc (mkexp_cons_desc consloc args) + +let mkpat_cons_desc consloc args = + Ppat_construct(mkrhs (Lident "::") consloc, Some ([], args)) +let mkpat_cons ~loc consloc args = + mkpat ~loc (mkpat_cons_desc consloc args) + +let ghexp_cons_desc consloc args = + Pexp_construct(ghrhs (Lident "::") consloc, Some args) +let ghpat_cons_desc consloc args = + Ppat_construct(ghrhs (Lident "::") consloc, Some ([], args)) + +let rec mktailexp nilloc = let open Location in function + [] -> + let nil = ghloc ~loc:nilloc (Lident "[]") in + Pexp_construct (nil, None), nilloc + | e1 :: el -> + let exp_el, el_loc = mktailexp nilloc el in + let loc = (e1.pexp_loc.loc_start, snd el_loc) in + let arg = ghexp ~loc (Pexp_tuple [None, e1; None, ghexp ~loc:el_loc exp_el]) in + ghexp_cons_desc loc arg, loc + +let rec mktailpat nilloc = let open Location in function + [] -> + let nil = ghloc ~loc:nilloc (Lident "[]") in + Ppat_construct (nil, None), nilloc + | p1 :: pl -> + let pat_pl, el_loc = mktailpat nilloc pl in + let loc = (p1.ppat_loc.loc_start, snd el_loc) in + let arg = ghpat ~loc (Ppat_tuple ([None, p1; None, ghpat ~loc:el_loc pat_pl], Closed)) in + ghpat_cons_desc loc arg, loc + +let mkstrexp e attrs = + { pstr_desc = Pstr_eval (e, attrs); pstr_loc = e.pexp_loc } + +let syntax_error () = + raise Syntaxerr.Escape_error + +let unclosed opening_name opening_loc closing_name closing_loc = + raise(Syntaxerr.Error(Syntaxerr.Unclosed(make_loc opening_loc, opening_name, + make_loc closing_loc, closing_name))) + +let quotation_reserved name loc = + raise(Syntaxerr.Error(Syntaxerr.Quotation_reserved(make_loc loc, name))) + +(* Normal mutable arrays and immutable arrays are parsed identically, just with + different delimiters. The parsing is done by the [array_exprs] rule, and the + [Generic_array] module provides (1) a type representing the possible results, + and (2) a function for going from that type to an AST fragment representing + an array. *) +module Generic_array = struct + (** The possible ways of parsing an array (writing [[? ... ?]] for either + [[| ... |]] or [[: ... :]]). The set of available constructs differs + between expressions and patterns. + *) + + module Simple = struct + type 'a t = + | Literal of 'a list + (** A plain array literal/pattern, [[? x; y; z ?]] *) + | Unclosed of (Lexing.position * Lexing.position) * + (Lexing.position * Lexing.position) + (** Parse error: an unclosed array literal, [\[? x; y; z] with no closing + [?\]]. *) + + let to_ast (open_ : string) (close : string) array t = + match t with + | Literal elts -> array elts + | Unclosed (startpos, endpos) -> unclosed open_ startpos close endpos + end + + + module Expression = struct + type t = + | Simple of expression Simple.t + | Opened_literal of open_declaration * + Lexing.position * + Lexing.position * + expression list + (** An array literal with a local open, [Module.[? x; y; z ?]] (only valid + in expressions) *) + + let to_desc (open_ : string) (close : string) mut t = + let array elts = Pexp_array (mut, elts) in + match t with + | Simple x -> Simple.to_ast open_ close array x + | Opened_literal (od, startpos, endpos, elts) -> + Pexp_open (od, mkexp ~loc:(startpos, endpos) (array elts)) + + let to_expression (open_ : string) (close : string) mut ~loc t = + let array ~loc elts = mkexp ~loc (Pexp_array (mut, elts)) in + match t with + | Simple x -> Simple.to_ast open_ close (array ~loc) x + | Opened_literal (od, startpos, endpos, elts) -> + mkexp ~loc (Pexp_open (od, array ~loc:(startpos, endpos) elts)) + end + + module Pattern = struct + type t = pattern Simple.t + let to_ast open_ close mut (t : t) = + Simple.to_ast open_ close (fun elts -> Ppat_array (mut, elts)) t + end +end + +let expecting_loc (loc : Location.t) (nonterm : string) = + raise Syntaxerr.(Error(Expecting(loc, nonterm))) +let expecting (loc : Lexing.position * Lexing.position) nonterm = + expecting_loc (make_loc loc) nonterm + +let removed_string_set loc = + raise(Syntaxerr.Error(Syntaxerr.Removed_string_set(make_loc loc))) + +(* Using the function [not_expecting] in a semantic action means that this + syntactic form is recognized by the parser but is in fact incorrect. This + idiom is used in a few places to produce ad hoc syntax error messages. *) + +(* This idiom should be used as little as possible, because it confuses the + analyses performed by Menhir. Because Menhir views the semantic action as + opaque, it believes that this syntactic form is correct. This can lead + [make generate-parse-errors] to produce sentences that cause an early + (unexpected) syntax error and do not achieve the desired effect. This could + also lead a completion system to propose completions which in fact are + incorrect. In order to avoid these problems, the productions that use + [not_expecting] should be marked with AVOID. *) + +let not_expecting loc nonterm = + raise Syntaxerr.(Error(Not_expecting(make_loc loc, nonterm))) + +let mkexp_type_constraint_with_modes ?(ghost=false) ~loc ~modes e t = + match t with + | Pconstraint t -> + let mk = if ghost then ghexp_constraint else mkexp_constraint in + mk ~loc ~exp:e ~cty:(Some t) ~modes + | Pcoerce(t1, t2) -> + match modes with + | [] -> + let mk = if ghost then ghexp else mkexp ?attrs:None in + mk ~loc (Pexp_coerce(e, t1, t2)) + | _ :: _ -> not_expecting loc "mode annotations" + +let mkexp_opt_type_constraint_with_modes ?ghost ~loc ~modes e = function + | None -> e + | Some c -> mkexp_type_constraint_with_modes ?ghost ~loc ~modes e c + +(* Helper functions for desugaring array indexing operators *) +type paren_kind = Paren | Brace | Bracket + +(* We classify the dimension of indices: Bigarray distinguishes + indices of dimension 1,2,3, or more. Similarly, user-defined + indexing operator behave differently for indices of dimension 1 + or more. +*) +type index_dim = + | One + | Two + | Three + | Many +type ('dot,'index) array_family = { + + name: + Lexing.position * Lexing.position -> 'dot -> assign:bool -> paren_kind + -> index_dim -> Longident.t Location.loc + (* + This functions computes the name of the explicit indexing operator + associated with a sugared array indexing expression. + + For instance, for builtin arrays, if Clflags.unsafe is set, + * [ a.[index] ] => [String.unsafe_get] + * [ a.{x,y} <- 1 ] => [ Bigarray.Array2.unsafe_set] + + User-defined indexing operator follows a more local convention: + * [ a .%(index)] => [ (.%()) ] + * [ a.![1;2] <- 0 ] => [(.![;..]<-)] + * [ a.My.Map.?(0) => [My.Map.(.?())] + *); + + index: + Lexing.position * Lexing.position -> paren_kind -> 'index + -> index_dim * (arg_label * expression) list + (* + [index (start,stop) paren index] computes the dimension of the + index argument and how it should be desugared when transformed + to a list of arguments for the indexing operator. + In particular, in both the Bigarray case and the user-defined case, + beyond a certain dimension, multiple indices are packed into a single + array argument: + * [ a.(x) ] => [ [One, [Nolabel, <>] ] + * [ a.{1,2} ] => [ [Two, [Nolabel, <<1>>; Nolabel, <<2>>] ] + * [ a.{1,2,3,4} ] => [ [Many, [Nolabel, <<[|1;2;3;4|]>>] ] ] + *); + +} + +let bigarray_untuplify exp = + match exp.pexp_desc with + | Pexp_tuple explist when + List.for_all (function None, _ -> true | _ -> false) explist -> + List.map (fun (_, e) -> e) explist + | _ -> [exp] + +(* Immutable array indexing is a regular operator, so it doesn't need a special + case here *) +let builtin_arraylike_name loc _ ~assign paren_kind n = + let opname = if assign then "set" else "get" in + let opname = if !Clflags.unsafe then "unsafe_" ^ opname else opname in + let prefix = match paren_kind with + | Paren -> Lident "Array" + | Bracket -> + if assign then removed_string_set loc + else Lident "String" + | Brace -> + let submodule_name = match n with + | One -> "Array1" + | Two -> "Array2" + | Three -> "Array3" + | Many -> "Genarray" in + Ldot(Lident "Bigarray", submodule_name) in + ghloc ~loc (Ldot(prefix,opname)) + +let builtin_arraylike_index loc paren_kind index = match paren_kind with + | Paren | Bracket -> One, [Nolabel, index] + | Brace -> + (* Multi-indices for bigarray are comma-separated ([a.{1,2,3,4}]) *) + match bigarray_untuplify index with + | [x] -> One, [Nolabel, x] + | [x;y] -> Two, [Nolabel, x; Nolabel, y] + | [x;y;z] -> Three, [Nolabel, x; Nolabel, y; Nolabel, z] + | coords -> Many, [Nolabel, ghexp ~loc (Pexp_array (Mutable, coords))] + +let builtin_indexing_operators : (unit, expression) array_family = + { index = builtin_arraylike_index; name = builtin_arraylike_name } + +let paren_to_strings = function + | Paren -> "(", ")" + | Bracket -> "[", "]" + | Brace -> "{", "}" + +let user_indexing_operator_name loc (prefix,ext) ~assign paren_kind n = + let name = + let assign = if assign then "<-" else "" in + let mid = match n with + | Many | Three | Two -> ";.." + | One -> "" in + let left, right = paren_to_strings paren_kind in + String.concat "" ["."; ext; left; mid; right; assign] in + let lid = match prefix with + | None -> Lident name + | Some p -> Ldot(p,name) in + ghloc ~loc lid + +let user_index loc _ index = + (* Multi-indices for user-defined operators are semicolon-separated + ([a.%[1;2;3;4]]) *) + match index with + | [a] -> One, [Nolabel, a] + | l -> Many, [Nolabel, mkexp ~loc (Pexp_array (Mutable, l))] + +let user_indexing_operators: + (Longident.t option * string, expression list) array_family + = { index = user_index; name = user_indexing_operator_name } + +let mk_indexop_expr array_indexing_operator ~loc + (array,dot,paren,index,set_expr) = + let assign = match set_expr with None -> false | Some _ -> true in + let n, index = array_indexing_operator.index loc paren index in + let fn = array_indexing_operator.name loc dot ~assign paren n in + let set_arg = match set_expr with + | None -> [] + | Some expr -> [Nolabel, expr] in + let args = (Nolabel,array) :: index @ set_arg in + mkexp ~loc (Pexp_apply(ghexp ~loc (Pexp_ident fn), args)) + +let indexop_unclosed_error loc_s s loc_e = + let left, right = paren_to_strings s in + unclosed left loc_s right loc_e + +let lapply ~loc p1 p2 = + if !Clflags.applicative_functors + then Lapply(p1, p2) + else raise (Syntaxerr.Error( + Syntaxerr.Applicative_path (make_loc loc))) + +let make_ghost x = + if x.loc.loc_ghost + then x (* Save an allocation *) + else { x with loc = Location.ghostify x.loc } + +let loc_last (id : Longident.t Location.loc) : string Location.loc = + Location.map Longident.last id + +let loc_lident (id : string Location.loc) : Longident.t Location.loc = + Location.map (fun x -> Lident x) id + +let exp_of_longident lid = + let lid = Location.map (fun id -> Lident (Longident.last id)) lid in + Exp.mk ~loc:lid.loc (Pexp_ident lid) + +let exp_of_label lbl = + Exp.mk ~loc:lbl.loc (Pexp_ident (loc_lident lbl)) + +let pat_of_label lbl = + Pat.mk ~loc:lbl.loc (Ppat_var (loc_last lbl)) + +let mk_newtypes ~loc newtypes exp = + let mk_one (name, jkind) exp = + ghexp ~loc (Pexp_newtype (name, jkind, exp)) + in + let exp = List.fold_right mk_one newtypes exp in + (* outermost expression should have non-ghost location *) + { exp with pexp_loc = make_loc loc } + +(* The [typloc] argument is used to adjust a location for something we're + parsing a bit differently than upstream. See comment about [Pvc_constraint] + in [let_binding_body_no_punning]. *) +let wrap_type_annotation ~loc ?(typloc=loc) ~modes newtypes core_type body = + let mk_newtypes = mk_newtypes ~loc in + let exp = mkexp_constraint ~loc ~exp:body ~cty:(Some core_type) ~modes in + let exp = mk_newtypes newtypes exp in + let inner_type = Typ.varify_constructors (List.map fst newtypes) core_type in + (exp, ghtyp ~loc:typloc (Ptyp_poly (newtypes, inner_type))) + +let wrap_exp_attrs ~loc body (ext, attrs) = + let ghexp = ghexp ~loc in + (* todo: keep exact location for the entire attribute *) + let body = {body with pexp_attributes = attrs @ body.pexp_attributes} in + match ext with + | None -> body + | Some id -> ghexp(Pexp_extension (id, PStr [mkstrexp body []])) + +let mkexp_attrs ~loc d ext_attrs = + wrap_exp_attrs ~loc (mkexp ~loc d) ext_attrs + +let wrap_typ_attrs ~loc typ (ext, attrs) = + (* todo: keep exact location for the entire attribute *) + let typ = {typ with ptyp_attributes = attrs @ typ.ptyp_attributes} in + match ext with + | None -> typ + | Some id -> ghtyp ~loc (Ptyp_extension (id, PTyp typ)) + +let wrap_pat_attrs ~loc pat (ext, attrs) = + (* todo: keep exact location for the entire attribute *) + let pat = {pat with ppat_attributes = attrs @ pat.ppat_attributes} in + match ext with + | None -> pat + | Some id -> ghpat ~loc (Ppat_extension (id, PPat (pat, None))) + +let mkpat_attrs ~loc d attrs = + wrap_pat_attrs ~loc (mkpat ~loc d) attrs + +let wrap_class_attrs ~loc:_ body attrs = + {body with pcl_attributes = attrs @ body.pcl_attributes} +let wrap_mod_attrs ~loc:_ attrs body = + {body with pmod_attributes = attrs @ body.pmod_attributes} +let wrap_mty_attrs ~loc:_ attrs body = + {body with pmty_attributes = attrs @ body.pmty_attributes} + +let wrap_str_ext ~loc body ext = + match ext with + | None -> body + | Some id -> ghstr ~loc (Pstr_extension ((id, PStr [body]), [])) + +let wrap_mkstr_ext ~loc (item, ext) = + wrap_str_ext ~loc (mkstr ~loc item) ext + +let wrap_sig_ext ~loc body ext = + match ext with + | None -> body + | Some id -> + ghsig ~loc (Psig_extension ((id, PSig {psg_items=[body]; + psg_modalities=[]; psg_loc=make_loc loc}), [])) + +let wrap_mksig_ext ~loc (item, ext) = + wrap_sig_ext ~loc (mksig ~loc item) ext + +let mk_quotedext ~loc (id, idloc, str, strloc, delim) = + let exp_id = mkloc id idloc in + let e = ghexp ~loc (Pexp_constant (Pconst_string (str, strloc, delim))) in + (exp_id, PStr [mkstrexp e []]) + +let text_str pos = Str.text (rhs_text pos) +let text_sig pos = Sig.text (rhs_text pos) +let text_cstr pos = Cf.text (rhs_text pos) +let text_csig pos = Ctf.text (rhs_text pos) +let text_def pos = + List.map (fun def -> Ptop_def [def]) (Str.text (rhs_text pos)) + +let extra_text startpos endpos text items = + match items with + | [] -> + let post = rhs_post_text endpos in + let post_extras = rhs_post_extra_text endpos in + text post @ text post_extras + | _ :: _ -> + let pre_extras = rhs_pre_extra_text startpos in + let post_extras = rhs_post_extra_text endpos in + text pre_extras @ items @ text post_extras + +let extra_str p1 p2 items = extra_text p1 p2 Str.text items +let extra_sig p1 p2 items = extra_text p1 p2 Sig.text items +let extra_cstr p1 p2 items = extra_text p1 p2 Cf.text items +let extra_csig p1 p2 items = extra_text p1 p2 Ctf.text items +let extra_def p1 p2 items = + extra_text p1 p2 + (fun txt -> List.map (fun def -> Ptop_def [def]) (Str.text txt)) + items + +let extra_rhs_core_type ct ~pos = + let docs = rhs_info pos in + { ct with ptyp_attributes = add_info_attrs docs ct.ptyp_attributes } + +let mklb first ~loc (p, e, typ, modes, is_pun) attrs = + { + lb_pattern = p; + lb_expression = e; + lb_constraint=typ; + lb_is_pun = is_pun; + lb_modes = modes; + lb_attributes = attrs; + lb_docs = symbol_docs_lazy loc; + lb_text = (if first then empty_text_lazy + else symbol_text_lazy (fst loc)); + lb_loc = make_loc loc; + } + +let addlb lbs lb = + if lb.lb_is_pun && lbs.lbs_extension = None then syntax_error (); + { lbs with lbs_bindings = lb :: lbs.lbs_bindings } + +let mklbs ext mf rf lb = + let lbs = { + lbs_bindings = []; + lbs_mutable = mf; + lbs_rec = rf; + lbs_extension = ext; + } in + addlb lbs lb + +let val_of_let_bindings ~loc lbs = + let bindings = + List.map + (fun lb -> + Vb.mk ~loc:lb.lb_loc ~attrs:lb.lb_attributes + ~modes:lb.lb_modes + ~docs:(Lazy.force lb.lb_docs) + ~text:(Lazy.force lb.lb_text) + ?value_constraint:lb.lb_constraint lb.lb_pattern lb.lb_expression) + lbs.lbs_bindings + in + match lbs.lbs_mutable with + | Mutable -> + raise (Syntaxerr.Error + (Syntaxerr.Let_mutable_not_allowed_at_structure_level (make_loc loc))) + | Immutable -> + let str = mkstr ~loc (Pstr_value(lbs.lbs_rec, List.rev bindings)) in + match lbs.lbs_extension with + | None -> str + | Some id -> ghstr ~loc (Pstr_extension((id, PStr [str]), [])) + + +(* Find the location of the first binding in [bindings] that contains a ghost + * function expression. This is used to disallow [let mutable f x y = ..]. *) +let ghost_fun_binding_loc bindings = + List.find_opt (fun binding -> + match binding.lb_expression.pexp_loc.loc_ghost, + binding.lb_expression.pexp_desc + with + | true, Pexp_function _ -> true | _ -> false) + bindings + |> Option.map (fun binding -> binding.lb_loc) + +let expr_of_let_bindings ~loc lbs body = + let bindings = + List.map + (fun lb -> + Vb.mk ~loc:lb.lb_loc ~attrs:lb.lb_attributes + ~modes:lb.lb_modes + ?value_constraint:lb.lb_constraint lb.lb_pattern lb.lb_expression) + lbs.lbs_bindings + in + (* Disallow [let mutable f x y = ..] but still allow + * [let mutable f = fun x y -> ..]. *) + match lbs.lbs_mutable, ghost_fun_binding_loc lbs.lbs_bindings with + | Mutable, Some loc -> + raise (Syntaxerr.Error + (Syntaxerr.Let_mutable_not_allowed_with_function_bindings loc)) + | _ -> + mkexp_attrs ~loc + (Pexp_let(lbs.lbs_mutable, lbs.lbs_rec, List.rev bindings, body)) + (lbs.lbs_extension, []) + +let class_of_let_bindings ~loc lbs body = + let bindings = + List.map + (fun lb -> + Vb.mk ~loc:lb.lb_loc ~attrs:lb.lb_attributes + ~modes:lb.lb_modes + ?value_constraint:lb.lb_constraint lb.lb_pattern lb.lb_expression) + lbs.lbs_bindings + in + match lbs.lbs_mutable with + | Mutable -> + raise (Syntaxerr.Error + (Syntaxerr.Let_mutable_not_allowed_in_class_definition (make_loc loc))) + | Immutable -> + (* Our use of let_bindings(no_ext) guarantees the following: *) + assert (lbs.lbs_extension = None); + mkclass ~loc (Pcl_let (lbs.lbs_rec, List.rev bindings, body)) + +(* If all the parameters are [Pparam_newtype x], then return [Some xs] where + [xs] is the corresponding list of values [x]. This function is optimized for + the common case, where a list of parameters contains at least one value + parameter. +*) +let all_params_as_newtypes = + let is_newtype { pparam_desc; _ } = + match pparam_desc with + | Pparam_newtype _ -> true + | Pparam_val _ -> false + in + let as_newtype { pparam_desc; _ } = + match pparam_desc with + | Pparam_newtype (x, jkind) -> Some (x, jkind) + | Pparam_val _ -> None + in + fun params -> + if List.for_all is_newtype params + then Some (List.filter_map as_newtype params) + else None + +let empty_body_constraint = + { ret_type_constraint = None; mode_annotations = []; ret_mode_annotations = []} + +(* Given a construct [fun (type a b c) : t -> e], we construct + [Pexp_newtype(a, Pexp_newtype(b, Pexp_newtype(c, Pexp_constraint(e, t))))] + rather than a [Pexp_function]. +*) +let mkghost_newtype_function_body newtypes body_constraint body ~loc = + let wrapped_body = + let { ret_type_constraint; mode_annotations; ret_mode_annotations } = + body_constraint + in + let modes = mode_annotations @ ret_mode_annotations in + let {Location.loc_start; loc_end} = body.pexp_loc in + let loc = loc_start, loc_end in + mkexp_opt_type_constraint_with_modes ~ghost:true ~loc ~modes body ret_type_constraint + in + mk_newtypes ~loc newtypes wrapped_body + +let mkfunction ~loc ~attrs params body_constraint body = + match body with + | Pfunction_cases _ -> + mkexp_attrs (Pexp_function (params, body_constraint, body)) attrs ~loc + | Pfunction_body body_exp -> begin + (* If all the params are newtypes, then we don't create a function node; + we create nested newtype nodes. *) + match all_params_as_newtypes params with + | None -> + mkexp_attrs (Pexp_function (params, body_constraint, body)) attrs ~loc + | Some newtypes -> + wrap_exp_attrs + ~loc + (mkghost_newtype_function_body newtypes body_constraint body_exp + ~loc) + attrs + end + +let mk_functor_typ args mty_mm = + let mty, _ = + List.fold_left (fun (mty, mm) (startpos, arg) -> + let mty = + mkmty ~loc:(startpos, mty.pmty_loc.loc_end) (Pmty_functor (arg, mty, mm)) + in + let mm = [] in + mty, mm) + mty_mm args + in + mty + +(* Alternatively, we could keep the generic module type in the Parsetree + and extract the package type during type-checking. In that case, + the assertions below should be turned into explicit checks. *) +let package_type_of_module_type pmty = + let err loc s = + raise (Syntaxerr.Error (Syntaxerr.Invalid_package_type (loc, s))) + in + let map_cstr = function + | Pwith_type (lid, ptyp) -> + let loc = ptyp.ptype_loc in + if ptyp.ptype_params <> [] then + err loc Syntaxerr.Parameterized_types; + if ptyp.ptype_cstrs <> [] then + err loc Syntaxerr.Constrained_types; + if ptyp.ptype_private <> Public then + err loc Syntaxerr.Private_types; + + (* restrictions below are checked by the 'with_constraint' rule *) + assert (ptyp.ptype_kind = Ptype_abstract); + assert (ptyp.ptype_attributes = []); + let ty = + match ptyp.ptype_manifest with + | Some ty -> ty + | None -> assert false + in + (lid, ty) + | _ -> + err pmty.pmty_loc Not_with_type + in + match pmty with + | {pmty_desc = Pmty_ident lid} -> (lid, [], pmty.pmty_attributes) + | {pmty_desc = Pmty_with({pmty_desc = Pmty_ident lid; pmty_attributes = inner_attributes}, cstrs)} -> + begin match inner_attributes with + | [] -> () + | attr :: _ -> + err attr.attr_loc Syntaxerr.Misplaced_attribute + end; + (lid, List.map map_cstr cstrs, pmty.pmty_attributes) + | _ -> + err pmty.pmty_loc Neither_identifier_nor_with_type + +(* There's no dedicated syntax for module instances. Functor application + syntax is translated into a module instance expression. +*) +let pmod_instance : module_expr -> module_expr_desc = + let raise_malformed_instance loc = + raise (Syntaxerr.Error (Malformed_instance_identifier loc)) + in + let head_of_ident (lid : Longident.t Location.loc) = + match lid with + | { txt = Lident s; loc = _ } -> s + | { txt = _; loc } -> raise_malformed_instance loc + in + let gather_args mexpr = + let rec loop mexpr acc = + match mexpr with + | { pmod_desc = Pmod_apply (f, v); _ } -> + (match f.pmod_desc with + | Pmod_apply (f, n) -> loop f ((n, v) :: acc) + | _ -> raise_malformed_instance f.pmod_loc) + | head -> head, acc + in + loop mexpr [] + in + let string_of_module_expr mexpr = + match mexpr.pmod_desc with + | Pmod_ident i -> head_of_ident i + | _ -> raise_malformed_instance mexpr.pmod_loc + in + let rec instance_of_module_expr mexpr = + match gather_args mexpr with + | { pmod_desc = Pmod_ident i; _ }, args -> + let head = head_of_ident i in + let args = List.map instances_of_arg_pair args in + { pmod_instance_head = head; pmod_instance_args = args } + | { pmod_loc; _ }, _ -> raise_malformed_instance pmod_loc + and instances_of_arg_pair (n, v) = + string_of_module_expr n, instance_of_module_expr v + in + fun mexpr -> Pmod_instance (instance_of_module_expr mexpr) +;; + +let mk_directive_arg ~loc k = + { pdira_desc = k; + pdira_loc = make_loc loc; + } + +let mk_directive ~loc name arg = + Ptop_dir { + pdir_name = name; + pdir_arg = arg; + pdir_loc = make_loc loc; + } + +(* Unboxed literals *) + +(* CR layouts v2.5: The [unboxed_*] functions will both be improved and lose + their explicit assert once we have real unboxed literals in Jane syntax; they + may also get re-inlined at that point *) +let unboxed_literals_extension = Language_extension.Layouts + +type sign = Positive | Negative + +let with_sign sign num = + match sign with + | Positive -> num + | Negative -> "-" ^ num + +let unboxed_int sloc int_loc sign (n, m) = + match m with + | Some m -> Pconst_unboxed_integer (with_sign sign n, m) + | None -> + if Language_extension.is_enabled unboxed_literals_extension then + raise + Syntaxerr.(Error(Missing_unboxed_literal_suffix (make_loc int_loc))) + else + not_expecting sloc "line number directive" + +let unboxed_float sign (f, m) = Pconst_unboxed_float (with_sign sign f, m) + +(* Invariant: [lident] must end with an [Lident] that ends with a ["#"]. *) +let unboxed_type sloc lident tys = + let loc = make_loc sloc in + Ptyp_constr (mkloc lident loc, tys) + +let maybe_pmod_constraint mode expr = + match mode with + | [] -> expr + | _ :: _ -> Mod.constraint_ None mode expr +%} + +/* Tokens */ + +/* The alias that follows each token is used by Menhir when it needs to + produce a sentence (that is, a sequence of tokens) in concrete syntax. */ + +/* Some tokens represent multiple concrete strings. In most cases, an + arbitrary concrete string can be chosen. In a few cases, one must + be careful: e.g., in PREFIXOP and INFIXOP2, one must choose a concrete + string that will not trigger a syntax error; see how [not_expecting] + is used in the definition of [type_variance]. */ + +%token AMPERAMPER "&&" +%token AMPERSAND "&" +%token AND "and" +%token AS "as" +%token ASSERT "assert" +%token BACKQUOTE "`" +%token BANG "!" +%token BAR "|" +%token BARBAR "||" +%token BARRBRACKET "|]" +%token BEGIN "begin" +%token CHAR "'a'" (* just an example *) +%token CLASS "class" +%token COLON ":" +%token COLONCOLON "::" +%token COLONEQUAL ":=" +%token COLONGREATER ":>" +%token COLONRBRACKET ":]" +%token COMMA "," +%token CONSTRAINT "constraint" +%token DO "do" +%token DOLLAR "$" +%token DONE "done" +%token DOT "." +%token DOTDOT ".." +%token DOTHASH ".#" +%token DOWNTO "downto" +%token ELSE "else" +%token END "end" +%token EOF "" +%token EQUAL "=" +%token EXCEPTION "exception" +%token EXCLAVE "exclave_" +%token EXTERNAL "external" +%token FALSE "false" +%token FLOAT "42.0" (* just an example *) +%token HASH_FLOAT "#42.0" (* just an example *) +%token FOR "for" +%token FUN "fun" +%token FUNCTION "function" +%token FUNCTOR "functor" +%token GLOBAL "global_" +%token GREATER ">" +%token GREATERRBRACE ">}" +%token GREATERRBRACKET ">]" +%token HASHLPAREN "#(" +%token HASHLBRACE "#{" +%token IF "if" +%token IN "in" +%token INCLUDE "include" +%token INFIXOP0 "!=" (* just an example *) +%token AT "@" (* mode expression *) +%token ATAT "@@" (* mode expression *) +%token INFIXOP1 "^" (* just an example *) +%token INFIXOP2 "+!" (* chosen with care; see above *) +%token INFIXOP3 "land" (* just an example *) +%token INFIXOP4 "**" (* just an example *) +%token DOTOP ".+" +%token LETOP "let*" (* just an example *) +%token ANDOP "and*" (* just an example *) +%token INHERIT "inherit" +%token INITIALIZER "initializer" +%token INT "42" (* just an example *) +%token HASH_INT "#42l" (* just an example *) +%token KIND_ABBREV "kind_abbrev_" +%token KIND_OF "kind_of_" +%token LABEL "~label:" (* just an example *) +%token LAZY "lazy" +%token LBRACE "{" +%token LBRACELESS "{<" +%token LBRACKET "[" +%token LBRACKETBAR "[|" +%token LBRACKETCOLON "[:" +%token LBRACKETLESS "[<" +%token LBRACKETGREATER "[>" +%token LBRACKETPERCENT "[%" +%token LBRACKETPERCENTPERCENT "[%%" +%token LESS "<" +%token LESSLBRACKET "<[" +%token LESSMINUS "<-" +%token LET "let" +%token LIDENT "lident" (* just an example *) +%token LOCAL "local_" +%token LPAREN "(" +%token LBRACKETAT "[@" +%token LBRACKETATAT "[@@" +%token LBRACKETATATAT "[@@@" +%token MATCH "match" +%token METHOD "method" +%token MINUS "-" +%token MINUSDOT "-." +%token MINUSGREATER "->" +%token MOD "mod" +%token MODULE "module" +%token MUTABLE "mutable" +%token NEW "new" +%token NONREC "nonrec" +%token OBJECT "object" +%token OF "of" +%token ONCE "once_" +%token OPEN "open" +%token OPTLABEL "?label:" (* just an example *) +%token OR "or" +%token OVERWRITE "overwrite_" +/* %token PARSER "parser" */ +%token PERCENT "%" +%token PLUS "+" +%token PLUSDOT "+." +%token PLUSEQ "+=" +%token PREFIXOP "!+" (* chosen with care; see above *) +%token PRIVATE "private" +%token QUESTION "?" +%token QUOTE "'" +%token RBRACE "}" +%token RBRACKET "]" +%token RBRACKETGREATER "]>" +%token REC "rec" +%token RPAREN ")" +%token SEMI ";" +%token SEMISEMI ";;" +%token HASH "#" +%token HASH_SUFFIX "# " +%token HASHOP "##" (* just an example *) +%token SIG "sig" +%token STACK "stack_" +%token STAR "*" +%token + STRING "\"hello\"" (* just an example *) +%token + QUOTED_STRING_EXPR "{%hello|world|}" (* just an example *) +%token + QUOTED_STRING_ITEM "{%%hello|world|}" (* just an example *) +%token STRUCT "struct" +%token THEN "then" +%token TILDE "~" +%token TO "to" +%token TRUE "true" +%token TRY "try" +%token TYPE "type" +%token UIDENT "UIdent" (* just an example *) +%token UNDERSCORE "_" +%token UNIQUE "unique_" +%token VAL "val" +%token VIRTUAL "virtual" +%token WHEN "when" +%token WHILE "while" +%token WITH "with" +%token COMMENT "(* comment *)" +%token DOCSTRING "(** documentation *)" + +%token EOL "\\n" (* not great, but EOL is unused *) + +/* Precedences and associativities. + +Tokens and rules have precedences. A reduce/reduce conflict is resolved +in favor of the first rule (in source file order). A shift/reduce conflict +is resolved by comparing the precedence and associativity of the token to +be shifted with those of the rule to be reduced. + +By default, a rule has the precedence of its rightmost terminal (if any). + +When there is a shift/reduce conflict between a rule and a token that +have the same precedence, it is resolved using the associativity: +if the token is left-associative, the parser will reduce; if +right-associative, the parser will shift; if non-associative, +the parser will declare a syntax error. + +We will only use associativities with operators of the kind x * x -> x +for example, in the rules of the form expr: expr BINOP expr +in all other cases, we define two precedences if needed to resolve +conflicts. + +The precedences must be listed from low to high. +*/ + +%nonassoc IN +%nonassoc below_SEMI +%nonassoc SEMI /* below EQUAL ({lbl=...; lbl=...}) */ +%nonassoc LET FOR /* above SEMI ( ...; let ... in ...) */ +%nonassoc below_WITH +%nonassoc FUNCTION WITH /* below BAR (match ... with ...) */ +%nonassoc AND /* above WITH (module rec A: SIG with ... and ...) */ +%nonassoc THEN /* below ELSE (if ... then ...) */ +%nonassoc ELSE /* (if ... then ... else ...) */ +%nonassoc LESSMINUS /* below COLONEQUAL (lbl <- x := e) */ +%right COLONEQUAL /* expr (e := e := e) */ +%nonassoc AS +%left BAR /* pattern (p|p|p) */ +%nonassoc below_COMMA +%left COMMA /* expr/labeled_tuple (e,e,e) */ +%nonassoc below_FUNCTOR /* include M */ +%nonassoc FUNCTOR /* include functor M */ +%right MINUSGREATER /* function_type (t -> t -> t) */ +%right OR BARBAR /* expr (e || e || e) */ +%nonassoc below_AMPERSAND +%right AMPERSAND AMPERAMPER /* expr (e && e && e) */ +%nonassoc below_EQUAL +%left INFIXOP0 EQUAL LESS GREATER /* expr (e OP e OP e) */ +%right ATAT AT INFIXOP1 /* expr (e OP e OP e) */ +%nonassoc below_LBRACKETAT +%nonassoc LBRACKETAT +%right COLONCOLON /* expr (e :: e :: e) */ +%left INFIXOP2 PLUS PLUSDOT MINUS MINUSDOT PLUSEQ /* expr (e OP e OP e) */ +%left PERCENT INFIXOP3 MOD STAR /* expr (e OP e OP e) */ +%right INFIXOP4 /* expr (e OP e OP e) */ +%nonassoc prec_unboxed_product_kind +%nonassoc prec_unary_minus prec_unary_plus /* unary - */ +%nonassoc prec_constant_constructor /* cf. simple_expr (C versus C x) */ +%nonassoc prec_constr_appl /* above AS BAR COLONCOLON COMMA */ +%nonassoc below_HASH +%nonassoc HASH HASH_SUFFIX /* simple_expr/toplevel_directive */ +%left HASHOP +%nonassoc below_DOT +%nonassoc DOT DOTHASH DOTOP +/* Finally, the first tokens of simple_expr are above everything else. */ +%nonassoc BACKQUOTE BANG BEGIN CHAR FALSE FLOAT HASH_FLOAT INT HASH_INT OBJECT + LBRACE LBRACELESS LBRACKET LBRACKETBAR LBRACKETCOLON LIDENT LPAREN + NEW PREFIXOP STRING TRUE UIDENT LESSLBRACKET DOLLAR + LBRACKETPERCENT QUOTED_STRING_EXPR HASHLBRACE HASHLPAREN + +/* Entry points */ + +/* Several start symbols are marked with AVOID so that they are not used by + [make generate-parse-errors]. The three start symbols that we keep are + [implementation], [use_file], and [toplevel_phrase]. The latter two are + of marginal importance; only [implementation] really matters, since most + states in the automaton are reachable from it. */ + +%start implementation /* for implementation files */ +%type implementation +/* BEGIN AVOID */ +%start interface /* for interface files */ +%type interface +/* END AVOID */ +%start toplevel_phrase /* for interactive use */ +%type toplevel_phrase +%start use_file /* for the #use directive */ +%type use_file +/* BEGIN AVOID */ +%start parse_module_type +%type parse_module_type +%start parse_module_expr +%type parse_module_expr +%start parse_core_type +%type parse_core_type +%start parse_expression +%type parse_expression +%start parse_pattern +%type parse_pattern +%start parse_constr_longident +%type parse_constr_longident +%start parse_val_longident +%type parse_val_longident +%start parse_mty_longident +%type parse_mty_longident +%start parse_mod_ext_longident +%type parse_mod_ext_longident +%start parse_mod_longident +%type parse_mod_longident +%start parse_any_longident +%type parse_any_longident +/* END AVOID */ + +%% + +/* macros */ +%inline extra_str(symb): symb { extra_str $startpos $endpos $1 }; +%inline extra_sig(symb): symb { extra_sig $startpos $endpos $1 }; +%inline extra_cstr(symb): symb { extra_cstr $startpos $endpos $1 }; +%inline extra_csig(symb): symb { extra_csig $startpos $endpos $1 }; +%inline extra_def(symb): symb { extra_def $startpos $endpos $1 }; +%inline extra_text(symb): symb { extra_text $startpos $endpos $1 }; +%inline extra_rhs(symb): symb { extra_rhs_core_type $1 ~pos:$endpos($1) }; +%inline mkrhs(symb): symb + { mkrhs $1 $sloc } +; + +%inline text_str(symb): symb + { text_str $startpos @ [$1] } +%inline text_str_SEMISEMI: SEMISEMI + { text_str $startpos } +%inline text_sig(symb): symb + { text_sig $startpos @ [$1] } +%inline text_sig_SEMISEMI: SEMISEMI + { text_sig $startpos } +%inline text_def(symb): symb + { text_def $startpos @ [$1] } +%inline top_def(symb): symb + { Ptop_def [$1] } +%inline text_cstr(symb): symb + { text_cstr $startpos @ [$1] } +%inline text_csig(symb): symb + { text_csig $startpos @ [$1] } + +(* Using this %inline definition means that we do not control precisely + when [mark_rhs_docs] is called, but I don't think this matters. *) +%inline mark_rhs_docs(symb): symb + { mark_rhs_docs $startpos $endpos; + $1 } + +%inline op(symb): symb + { mkoperator ~loc:$sloc $1 } + +%inline mkloc(symb): symb + { mkloc $1 (make_loc $sloc) } + +%inline mkexp(symb): symb + { mkexp ~loc:$sloc $1 } +%inline mkpat(symb): symb + { mkpat ~loc:$sloc $1 } +%inline mktyp(symb): symb + { mktyp ~loc:$sloc $1 } +%inline mkstr(symb): symb + { mkstr ~loc:$sloc $1 } +%inline mksig(symb): symb + { mksig ~loc:$sloc $1 } +%inline mkmod(symb): symb + { mkmod ~loc:$sloc $1 } +%inline mkmty(symb): symb + { mkmty ~loc:$sloc $1 } +%inline mkcty(symb): symb + { mkcty ~loc:$sloc $1 } +%inline mkctf(symb): symb + { mkctf ~loc:$sloc $1 } +%inline mkcf(symb): symb + { mkcf ~loc:$sloc $1 } +%inline mkclass(symb): symb + { mkclass ~loc:$sloc $1 } + +%inline wrap_mkstr_ext(symb): symb + { wrap_mkstr_ext ~loc:$sloc $1 } +%inline wrap_mksig_ext(symb): symb + { wrap_mksig_ext ~loc:$sloc $1 } + +%inline mk_directive_arg(symb): symb + { mk_directive_arg ~loc:$sloc $1 } + +/* Generic definitions */ + +(* [iloption(X)] recognizes either nothing or [X]. Assuming [X] produces + an OCaml list, it produces an OCaml list, too. *) + +%inline iloption(X): + /* nothing */ + { [] } +| x = X + { x } + +(* [llist(X)] recognizes a possibly empty list of [X]s. It is left-recursive. *) + +reversed_llist(X): + /* empty */ + { [] } +| xs = reversed_llist(X) x = X + { x :: xs } + +%inline llist(X): + xs = rev(reversed_llist(X)) + { xs } + +(* [reversed_nonempty_llist(X)] recognizes a nonempty list of [X]s, and produces + an OCaml list in reverse order -- that is, the last element in the input text + appears first in this list. Its definition is left-recursive. *) + +reversed_nonempty_llist(X): + x = X + { [ x ] } +| xs = reversed_nonempty_llist(X) x = X + { x :: xs } + +(* [nonempty_llist(X)] recognizes a nonempty list of [X]s, and produces an OCaml + list in direct order -- that is, the first element in the input text appears + first in this list. *) + +%inline nonempty_llist(X): + xs = rev(reversed_nonempty_llist(X)) + { xs } + +(* [reversed_nonempty_concat(X)] recognizes a nonempty sequence of [X]s (each of + which is a list), and produces an OCaml list of their concatenation in + reverse order -- that is, the last element of the last list in the input text + appears first in the list. +*) +reversed_nonempty_concat(X): + x = X + { List.rev x } +| xs = reversed_nonempty_concat(X) x = X + { List.rev_append x xs } + +(* [nonempty_concat(X)] recognizes a nonempty sequence of [X]s + (each of which is a list), and produces an OCaml list of their concatenation + in direct order -- that is, the first element of the first list in the input + text appears first in the list. +*) +%inline nonempty_concat(X): + xs = rev(reversed_nonempty_concat(X)) + { xs } + +(* [reversed_separated_nonempty_llist(separator, X)] recognizes a nonempty list + of [X]s, separated with [separator]s, and produces an OCaml list in reverse + order -- that is, the last element in the input text appears first in this + list. Its definition is left-recursive. *) + +(* [inline_reversed_separated_nonempty_llist(separator, X)] is semantically + equivalent to [reversed_separated_nonempty_llist(separator, X)], but is + marked %inline, which means that the case of a list of length one and + the case of a list of length more than one will be distinguished at the + use site, and will give rise there to two productions. This can be used + to avoid certain conflicts. *) + +%inline inline_reversed_separated_nonempty_llist(separator, X): + x = X + { [ x ] } +| xs = reversed_separated_nonempty_llist(separator, X) + separator + x = X + { x :: xs } + +reversed_separated_nonempty_llist(separator, X): + xs = inline_reversed_separated_nonempty_llist(separator, X) + { xs } + +(* [separated_nonempty_llist(separator, X)] recognizes a nonempty list of [X]s, + separated with [separator]s, and produces an OCaml list in direct order -- + that is, the first element in the input text appears first in this list. *) + +%inline separated_nonempty_llist(separator, X): + xs = rev(reversed_separated_nonempty_llist(separator, X)) + { xs } + +%inline inline_separated_nonempty_llist(separator, X): + xs = rev(inline_reversed_separated_nonempty_llist(separator, X)) + { xs } + +(* [reversed_separated_nontrivial_llist(separator, X)] recognizes a list of at + least two [X]s, separated with [separator]s, and produces an OCaml list in + reverse order -- that is, the last element in the input text appears first + in this list. Its definition is left-recursive. *) + +reversed_separated_nontrivial_llist(separator, X): + xs = reversed_separated_nontrivial_llist(separator, X) + separator + x = X + { x :: xs } +| x1 = X + separator + x2 = X + { [ x2; x1 ] } + +(* [separated_nontrivial_llist(separator, X)] recognizes a list of at least + two [X]s, separated with [separator]s, and produces an OCaml list in direct + order -- that is, the first element in the input text appears first in this + list. *) + +%inline separated_nontrivial_llist(separator, X): + xs = rev(reversed_separated_nontrivial_llist(separator, X)) + { xs } + +(* [separated_or_terminated_nonempty_list(delimiter, X)] recognizes a nonempty + list of [X]s, separated with [delimiter]s, and optionally terminated with a + final [delimiter]. Its definition is right-recursive. *) + +separated_or_terminated_nonempty_list(delimiter, X): + x = X ioption(delimiter) + { [x] } +| x = X + delimiter + xs = separated_or_terminated_nonempty_list(delimiter, X) + { x :: xs } + +(* [reversed_preceded_or_separated_nonempty_llist(delimiter, X)] recognizes a + nonempty list of [X]s, separated with [delimiter]s, and optionally preceded + with a leading [delimiter]. It produces an OCaml list in reverse order. Its + definition is left-recursive. *) + +reversed_preceded_or_separated_nonempty_llist(delimiter, X): + ioption(delimiter) x = X + { [x] } +| xs = reversed_preceded_or_separated_nonempty_llist(delimiter, X) + delimiter + x = X + { x :: xs } + +(* [preceded_or_separated_nonempty_llist(delimiter, X)] recognizes a nonempty + list of [X]s, separated with [delimiter]s, and optionally preceded with a + leading [delimiter]. It produces an OCaml list in direct order. *) + +%inline preceded_or_separated_nonempty_llist(delimiter, X): + xs = rev(reversed_preceded_or_separated_nonempty_llist(delimiter, X)) + { xs } + +(* [bar_llist(X)] recognizes a nonempty list of [X]'s, separated with BARs, + with an optional leading BAR. We assume that [X] is itself parameterized + with an opening symbol, which can be [epsilon] or [BAR]. *) + +(* This construction may seem needlessly complicated: one might think that + using [preceded_or_separated_nonempty_llist(BAR, X)], where [X] is *not* + itself parameterized, would be sufficient. Indeed, this simpler approach + would recognize the same language. However, the two approaches differ in + the footprint of [X]. We want the start location of [X] to include [BAR] + when present. In the future, we might consider switching to the simpler + definition, at the cost of producing slightly different locations. TODO *) + +reversed_bar_llist(X): + (* An [X] without a leading BAR. *) + x = X(epsilon) + { [x] } + | (* An [X] with a leading BAR. *) + x = X(BAR) + { [x] } + | (* An initial list, followed with a BAR and an [X]. *) + xs = reversed_bar_llist(X) + x = X(BAR) + { x :: xs } + +%inline bar_llist(X): + xs = reversed_bar_llist(X) + { List.rev xs } + +(* [xlist(A, B)] recognizes [AB*]. We assume that the semantic value for [A] + is a pair [x, b], while the semantic value for [B*] is a list [bs]. + We return the pair [x, b :: bs]. *) + +%inline xlist(A, B): + a = A bs = B* + { let (x, b) = a in x, b :: bs } + +(* [listx(delimiter, X, Y)] recognizes a nonempty list of [X]s, optionally + followed with a [Y], separated-or-terminated with [delimiter]s. The + semantic value is a pair of a list of [X]s and an optional [Y]. *) + +listx(delimiter, X, Y): +| x = X ioption(delimiter) + { [x], None } +| x = X delimiter y = Y delimiter? + { [x], Some y } +| x = X + delimiter + tail = listx(delimiter, X, Y) + { let xs, y = tail in + x :: xs, y } + +(* -------------------------------------------------------------------------- *) + +(* Entry points. *) + +(* An .ml file. *) +implementation: + structure EOF + { $1 } +; + +/* BEGIN AVOID */ +(* An .mli file. *) +interface: + signature EOF + { $1 } +; +/* END AVOID */ + +(* A toplevel phrase. *) +toplevel_phrase: + (* An expression with attributes, ended by a double semicolon. *) + extra_str(text_str(str_exp)) + SEMISEMI + { Ptop_def $1 } +| (* A list of structure items, ended by a double semicolon. *) + extra_str(flatten(text_str(structure_item)*)) + SEMISEMI + { Ptop_def $1 } +| (* A directive, ended by a double semicolon. *) + toplevel_directive + SEMISEMI + { $1 } +| (* End of input. *) + EOF + { raise End_of_file } +; + +(* An .ml file that is read by #use. *) +use_file: + (* An optional standalone expression, + followed with a series of elements, + followed with EOF. *) + extra_def(append( + optional_use_file_standalone_expression, + flatten(use_file_element*) + )) + EOF + { $1 } +; + +(* An optional standalone expression is just an expression with attributes + (str_exp), with extra wrapping. *) +%inline optional_use_file_standalone_expression: + iloption(text_def(top_def(str_exp))) + { $1 } +; + +(* An element in a #used file is one of the following: + - a double semicolon followed with an optional standalone expression; + - a structure item; + - a toplevel directive. + *) +%inline use_file_element: + preceded(SEMISEMI, optional_use_file_standalone_expression) +| text_def(top_def(structure_item)) +| text_def(mark_rhs_docs(toplevel_directive)) + { $1 } +; + +/* BEGIN AVOID */ +parse_module_type: + module_type EOF + { $1 } +; + +parse_module_expr: + module_expr EOF + { $1 } +; + +parse_core_type: + core_type EOF + { $1 } +; + +parse_expression: + seq_expr EOF + { $1 } +; + +parse_pattern: + pattern EOF + { $1 } +; + +parse_mty_longident: + mty_longident EOF + { $1 } +; + +parse_val_longident: + val_longident EOF + { $1 } +; + +parse_constr_longident: + constr_longident EOF + { $1 } +; + +parse_mod_ext_longident: + mod_ext_longident EOF + { $1 } +; + +parse_mod_longident: + mod_longident EOF + { $1 } +; + +parse_any_longident: + any_longident EOF + { $1 } +; +/* END AVOID */ + +(* -------------------------------------------------------------------------- *) + +(* Functor arguments appear in module expressions and module types. *) + +%inline functor_args: + reversed_nonempty_llist(functor_arg) + { $1 } + (* Produce a reversed list on purpose; + later processed using [fold_left]. *) +; + +functor_arg: + (* An anonymous and untyped argument. *) + LPAREN RPAREN + { $startpos, Unit } + | (* An argument accompanied with an explicit type. *) + LPAREN x = mkrhs(module_name) COLON mty_mm = module_type_with_optional_modes RPAREN + { let mty, mm = mty_mm in + $startpos, Named (x, mty, mm) } +; + +module_name: + (* A named argument. *) + x = UIDENT + { Some x } + | (* An anonymous argument. *) + UNDERSCORE + { None } +; + +module_name_modal(at_modal_expr): + | mkrhs(module_name) { $1, [] } + | LPAREN mkrhs(module_name) at_modal_expr RPAREN { $2, $3 } + +(* -------------------------------------------------------------------------- *) + +(* Module expressions. *) + +(* The syntax of module expressions is not properly stratified. The cases of + functors, functor applications, and attributes interact and cause conflicts, + which are resolved by precedence declarations. This is concise but fragile. + Perhaps in the future an explicit stratification could be used. *) + +module_expr: + | STRUCT attrs = attributes s = structure END + { mkmod ~loc:$sloc ~attrs (Pmod_structure s) } + | STRUCT attributes structure error + { unclosed "struct" $loc($1) "end" $loc($4) } + | SIG error + { expecting $loc($1) "struct" } + | FUNCTOR attrs = attributes args = functor_args MINUSGREATER me = module_expr + { wrap_mod_attrs ~loc:$sloc attrs ( + List.fold_left (fun acc (startpos, arg) -> + mkmod ~loc:(startpos, $endpos) (Pmod_functor (arg, acc)) + ) me args + ) } + | me = paren_module_expr + { me } + | me = module_expr attr = attribute + { match attr with + | { attr_name = { txt = "jane.non_erasable.instances"; loc = _ }; + attr_payload = PStr []; + } -> mkmod ~loc:$sloc (pmod_instance me) + | attr -> Mod.attr me attr + } + | mkmod( + (* A module identifier. *) + x = mkrhs(mod_longident) + { Pmod_ident x } + | (* In a functor application, the actual argument must be parenthesized. *) + me1 = module_expr me2 = paren_module_expr + { Pmod_apply(me1, me2) } + | (* Functor applied to unit. *) + me = module_expr LPAREN RPAREN + { Pmod_apply_unit me } + | (* An extension. *) + ex = extension + { Pmod_extension ex } + ) + { $1 } +; + +(* A parenthesized module expression is a module expression that begins + and ends with parentheses. *) + +paren_module_expr: + (* A module expression annotated with a module type. *) + LPAREN me = module_expr mty_mm = module_constraint RPAREN + { let mty, mm = mty_mm in + mkmod ~loc:$sloc (Pmod_constraint(me, mty, mm)) } + | LPAREN module_expr COLON module_type error + { unclosed "(" $loc($1) ")" $loc($5) } + | (* A module expression within parentheses. *) + LPAREN me = module_expr RPAREN + { me (* TODO consider reloc *) } + | LPAREN module_expr error + { unclosed "(" $loc($1) ")" $loc($3) } + | (* A core language expression that produces a first-class module. + This expression can be annotated in various ways. *) + LPAREN VAL attrs = attributes e = expr_colon_package_type RPAREN + { mkmod ~loc:$sloc ~attrs (Pmod_unpack e) } + | LPAREN VAL attributes expr COLON error + { unclosed "(" $loc($1) ")" $loc($6) } + | LPAREN VAL attributes expr COLONGREATER error + { unclosed "(" $loc($1) ")" $loc($6) } + | LPAREN VAL attributes expr error + { unclosed "(" $loc($1) ")" $loc($5) } +; + +(* The various ways of annotating a core language expression that + produces a first-class module that we wish to unpack. *) +%inline expr_colon_package_type: + e = expr + { e } + | e = expr COLON ty = package_type + { ghexp_constraint ~loc:$loc ~exp:e ~cty:(Some ty) ~modes:[] } + | e = expr COLON ty1 = package_type COLONGREATER ty2 = package_type + { ghexp ~loc:$loc (Pexp_coerce (e, Some ty1, ty2)) } + | e = expr COLONGREATER ty2 = package_type + { ghexp ~loc:$loc (Pexp_coerce (e, None, ty2)) } +; + +(* A structure, which appears between STRUCT and END (among other places), + begins with an optional standalone expression, and continues with a list + of structure elements. *) +structure: + extra_str(append( + optional_structure_standalone_expression, + flatten(structure_element*) + )) + { $1 } +; + +(* An optional standalone expression is just an expression with attributes + (str_exp), with extra wrapping. *) +%inline optional_structure_standalone_expression: + items = iloption(mark_rhs_docs(text_str(str_exp))) + { items } +; + +(* An expression with attributes, wrapped as a structure item. *) +%inline str_exp: + e = seq_expr + attrs = post_item_attributes + { mkstrexp e attrs } +; + +(* A structure element is one of the following: + - a double semicolon followed with an optional standalone expression; + - a structure item. *) +%inline structure_element: + append(text_str_SEMISEMI, optional_structure_standalone_expression) + | text_str(structure_item) + { $1 } +; + +(* A structure item. *) +structure_item: + let_bindings(ext) + { val_of_let_bindings ~loc:$sloc $1 } + | mkstr( + item_extension post_item_attributes + { let docs = symbol_docs $sloc in + Pstr_extension ($1, add_docs_attrs docs $2) } + | floating_attribute + { Pstr_attribute $1 } + | kind_abbreviation_decl + { let name, jkind = $1 in + Pstr_kind_abbrev (name, jkind) + }) + | wrap_mkstr_ext( + primitive_declaration + { pstr_primitive $1 } + | value_description + { pstr_primitive $1 } + | type_declarations + { pstr_type $1 } + | str_type_extension + { pstr_typext $1 } + | str_exception_declaration + { pstr_exception $1 } + | module_binding + { $1 } + | rec_module_bindings + { pstr_recmodule $1 } + | module_type_declaration + { let (body, ext) = $1 in (Pstr_modtype body, ext) } + | open_declaration + { let (body, ext) = $1 in (Pstr_open body, ext) } + | class_declarations + { let (ext, l) = $1 in (Pstr_class l, ext) } + | class_type_declarations + { let (ext, l) = $1 in (Pstr_class_type l, ext) } + ) + { $1 } + | include_statement(module_expr) + { let incl, ext = $1 in + let item = mkstr ~loc:$sloc (Pstr_include incl) in + wrap_str_ext ~loc:$sloc item ext + } +; + +(* A single module binding. *) +%inline module_binding: + MODULE + ext = ext attrs1 = attributes + name_ = module_name_modal(at_mode_expr) + body = module_binding_body + attrs2 = post_item_attributes + { let docs = symbol_docs $sloc in + let loc = make_loc $sloc in + let attrs = attrs1 @ attrs2 in + let name, modes = name_ in + let body = maybe_pmod_constraint modes body in + let body = Mb.mk name body ~attrs ~loc ~docs in + Pstr_module body, ext } +; + +%inline module_constraint: + COLON mty_mm = module_type_with_optional_modes + { let mty, mm = mty_mm in + (Some mty, mm) + } + | at_mode_expr + { (None, $1) } + +(* The body (right-hand side) of a module binding. *) +module_binding_body: + EQUAL me = module_expr + { me } + | COLON error + { expecting $loc($1) "=" } + | mkmod( + mty_mm = module_constraint EQUAL me = module_expr + { + let mty, mm = mty_mm in + Pmod_constraint(me, mty, mm) } + | arg_and_pos = functor_arg body = module_binding_body + { let (_, arg) = arg_and_pos in + Pmod_functor(arg, body) } + ) { $1 } +; + +(* A group of recursive module bindings. *) +%inline rec_module_bindings: + xlist(rec_module_binding, and_module_binding) + { $1 } +; + +(* The first binding in a group of recursive module bindings. *) +%inline rec_module_binding: + MODULE + ext = ext + attrs1 = attributes + REC + name_ = module_name_modal(at_mode_expr) + body = module_binding_body + attrs2 = post_item_attributes + { + let loc = make_loc $sloc in + let attrs = attrs1 @ attrs2 in + let docs = symbol_docs $sloc in + let name, modes = name_ in + let body = maybe_pmod_constraint modes body in + ext, + Mb.mk name body ~attrs ~loc ~docs + } +; + +(* The following bindings in a group of recursive module bindings. *) +%inline and_module_binding: + AND + attrs1 = attributes + name_ = module_name_modal(at_mode_expr) + body = module_binding_body + attrs2 = post_item_attributes + { + let loc = make_loc $sloc in + let attrs = attrs1 @ attrs2 in + let docs = symbol_docs $sloc in + let text = symbol_text $symbolstartpos in + let name, modes = name_ in + let body = maybe_pmod_constraint modes body in + Mb.mk name body ~attrs ~loc ~text ~docs + } +; + +(* -------------------------------------------------------------------------- *) + +(* Shared material between structures and signatures. *) + +include_kind: + | INCLUDE %prec below_FUNCTOR + { Structure } + | INCLUDE FUNCTOR + { Functor } +; + +(* An [include] statement can appear in a structure or in a signature, + which is why this definition is parameterized. *) +%inline include_statement(thing): + kind = include_kind + ext = ext + attrs1 = attributes + thing = thing + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + let incl = Incl.mk ~kind thing ~attrs ~loc ~docs in + incl, ext + } +; + +(* A module type declaration. *) +module_type_declaration: + MODULE TYPE + ext = ext + attrs1 = attributes + id = mkrhs(ident) + typ = preceded(EQUAL, module_type)? + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + Mtd.mk id ?typ ~attrs ~loc ~docs, ext + } +; + +(* -------------------------------------------------------------------------- *) + +(* Opens. *) + +open_declaration: + OPEN + override = override_flag + ext = ext + attrs1 = attributes + me = module_expr + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + Opn.mk me ~override ~attrs ~loc ~docs, ext + } +; + +open_description: + OPEN + override = override_flag + ext = ext + attrs1 = attributes + id = mkrhs(mod_ext_longident) + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + Opn.mk id ~override ~attrs ~loc ~docs, ext + } +; + +%inline open_dot_declaration: mkrhs(mod_longident) + { let loc = make_loc $loc($1) in + let me = Mod.ident ~loc $1 in + Opn.mk ~loc me } +; + +(* -------------------------------------------------------------------------- *) + +/* Module types */ + +module_type_atomic: + | SIG attrs = attributes s = signature END + { mkmty ~loc:$sloc ~attrs (Pmty_signature s) } + | SIG attributes signature error + { unclosed "sig" $loc($1) "end" $loc($4) } + | STRUCT error + { expecting $loc($1) "sig" } + | LPAREN module_type RPAREN + { $2 } + | LPAREN module_type error + { unclosed "(" $loc($1) ")" $loc($3) } + | mkmty( + mkrhs(mty_longident) + { Pmty_ident $1 } +/* | LPAREN MODULE mkrhs(mod_longident) RPAREN + { Pmty_alias $3 } */ + ) + { $1 } +; + +module_type: + | module_type_atomic { $1 } + | FUNCTOR attrs = attributes args = functor_args + MINUSGREATER mty_mm = module_type_with_optional_modes + %prec below_WITH + { wrap_mty_attrs ~loc:$sloc attrs (mk_functor_typ args mty_mm) } + | args = functor_args + MINUSGREATER mty_mm = module_type_with_optional_modes + %prec below_WITH + { mk_functor_typ args mty_mm } + | MODULE TYPE OF attributes module_expr %prec below_LBRACKETAT + { mkmty ~loc:$sloc ~attrs:$4 (Pmty_typeof $5) } + | module_type attribute + { Mty.attr $1 $2 } + | mkmty( + module_type_with_optional_modes MINUSGREATER module_type_with_optional_modes + %prec below_WITH + { let mty0, mm0 = $1 in + let mty1, mm1 = $3 in + Pmty_functor(Named (mknoloc None, mty0, mm0), mty1, mm1) } + | module_type WITH separated_nonempty_llist(AND, with_constraint) + { Pmty_with($1, $3) } + | extension + { Pmty_extension $1 } + | module_type WITH mkrhs(mod_ext_longident) + { Pmty_strengthen ($1, $3) } + ) + { $1 } +; + +%inline module_type_with_optional_modes: + | module_type { $1, [] } + | module_type_atomic at_mode_expr { $1, $2 } + +(* A signature, which appears between SIG and END (among other places), + is a list of signature elements. *) +signature: + optional_atat_modalities_expr extra_sig(flatten(signature_element*)) + { { psg_modalities = $1; + psg_items = $2; + psg_loc = make_loc $sloc; } } +; + +(* A signature element is one of the following: + - a double semicolon; + - a signature item. *) +%inline signature_element: + text_sig_SEMISEMI + | text_sig(signature_item) + { $1 } +; + +(* A signature item. *) +signature_item: + | item_extension post_item_attributes + { let docs = symbol_docs $sloc in + mksig ~loc:$sloc (Psig_extension ($1, (add_docs_attrs docs $2))) } + | mksig( + floating_attribute + { Psig_attribute $1 } + | kind_abbreviation_decl + { let name, jkind = $1 in + Psig_kind_abbrev (name, jkind) + } + ) + { $1 } + | wrap_mksig_ext( + value_description + { psig_value $1 } + | primitive_declaration + { psig_value $1 } + | type_declarations + { psig_type $1 } + | type_subst_declarations + { psig_typesubst $1 } + | sig_type_extension + { psig_typext $1 } + | sig_exception_declaration + { psig_exception $1 } + | module_declaration + { let (body, ext) = $1 in (Psig_module body, ext) } + | module_alias + { let (body, ext) = $1 in (Psig_module body, ext) } + | module_subst + { let (body, ext) = $1 in (Psig_modsubst body, ext) } + | rec_module_declarations + { let (ext, l) = $1 in (Psig_recmodule l, ext) } + | module_type_declaration + { let (body, ext) = $1 in (Psig_modtype body, ext) } + | module_type_subst + { let (body, ext) = $1 in (Psig_modtypesubst body, ext) } + | open_description + { let (body, ext) = $1 in (Psig_open body, ext) } + | class_descriptions + { let (ext, l) = $1 in (Psig_class l, ext) } + | class_type_declarations + { let (ext, l) = $1 in (Psig_class_type l, ext) } + ) + { $1 } + | include_statement(module_type) modalities = optional_atat_modalities_expr + { let incl, ext = $1 in + let item = mksig ~loc:$sloc (Psig_include (incl, modalities)) in + wrap_sig_ext ~loc:$sloc item ext + } + +(* A module declaration. *) +%inline module_declaration: + MODULE + ext = ext attrs1 = attributes + name_ = module_name_modal(atat_modalities_expr) + body = module_declaration_body( + module_type optional_atat_modalities_expr { ($1, $2) } + ) + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + let name, modalities' = name_ in + let mty, modalities = body in + let modalities = modalities' @ modalities in + Md.mk name mty ~attrs ~loc ~docs ~modalities, ext + } +; + +(* The body (right-hand side) of a module declaration. *) +module_declaration_body(module_type_with_optional_modal_expr): + COLON mty_mm = module_type_with_optional_modal_expr + { mty_mm } + | EQUAL error + { expecting $loc($1) ":" } + | mkmty( + arg_and_pos = functor_arg body = module_declaration_body(module_type_with_optional_modes) + { let (_, arg) = arg_and_pos in + let (ret, mret) = body in + Pmty_functor(arg, ret, mret) } + ) + { $1, [] } +; + +(* A module alias declaration (in a signature). *) +%inline module_alias: + MODULE + ext = ext attrs1 = attributes + name_ = module_name_modal(atat_modalities_expr) + EQUAL + body = module_expr_alias + modalities = optional_atat_modalities_expr + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + let name, modalities' = name_ in + let modalities = modalities' @ modalities in + Md.mk name body ~attrs ~modalities ~loc ~docs, ext + } +; +%inline module_expr_alias: + id = mkrhs(mod_longident) + { Mty.alias ~loc:(make_loc $sloc) id } +; +(* A module substitution (in a signature). *) +module_subst: + MODULE + ext = ext attrs1 = attributes + uid = mkrhs(UIDENT) + COLONEQUAL + body = mkrhs(mod_ext_longident) + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + Ms.mk uid body ~attrs ~loc ~docs, ext + } +| MODULE ext attributes mkrhs(UIDENT) COLONEQUAL error + { expecting $loc($6) "module path" } +; + +(* A group of recursive module declarations. *) +%inline rec_module_declarations: + xlist(rec_module_declaration, and_module_declaration) + { $1 } +; +%inline rec_module_declaration: + MODULE + ext = ext + attrs1 = attributes + REC + name = mkrhs(module_name) + COLON + mty = module_type + modalities = optional_atat_modalities_expr + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + ext, Md.mk name mty ~attrs ~loc ~docs ~modalities + } +; +%inline and_module_declaration: + AND + attrs1 = attributes + name = mkrhs(module_name) + COLON + mty = module_type + modalities = optional_atat_modalities_expr + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + let docs = symbol_docs $sloc in + let loc = make_loc $sloc in + let text = symbol_text $symbolstartpos in + Md.mk name mty ~attrs ~loc ~text ~docs ~modalities + } +; + +(* A module type substitution *) +module_type_subst: + MODULE TYPE + ext = ext + attrs1 = attributes + id = mkrhs(ident) + COLONEQUAL + typ=module_type + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + Mtd.mk id ~typ ~attrs ~loc ~docs, ext + } + + +(* -------------------------------------------------------------------------- *) + +(* Class declarations. *) + +%inline class_declarations: + xlist(class_declaration, and_class_declaration) + { $1 } +; +%inline class_declaration: + CLASS + ext = ext + attrs1 = attributes + virt = virtual_flag + params = formal_class_parameters + id = mkrhs(LIDENT) + body = class_fun_binding + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + ext, + Ci.mk id body ~virt ~params ~attrs ~loc ~docs + } +; +%inline and_class_declaration: + AND + attrs1 = attributes + virt = virtual_flag + params = formal_class_parameters + id = mkrhs(LIDENT) + body = class_fun_binding + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + let text = symbol_text $symbolstartpos in + Ci.mk id body ~virt ~params ~attrs ~loc ~text ~docs + } +; + +class_fun_binding: + EQUAL class_expr + { $2 } + | mkclass( + COLON class_type EQUAL class_expr + { Pcl_constraint($4, $2) } + | labeled_simple_pattern class_fun_binding + { let (l,o,p) = $1 in Pcl_fun(l, o, p, $2) } + ) { $1 } +; + +formal_class_parameters: + params = class_parameters(type_parameter) + { params } +; + +(* -------------------------------------------------------------------------- *) + +(* Class expressions. *) + +class_expr: + class_simple_expr + { $1 } + | FUN attributes class_fun_def + { wrap_class_attrs ~loc:$sloc $3 $2 } + | let_bindings(no_ext) IN class_expr + { class_of_let_bindings ~loc:$sloc $1 $3 } + | LET OPEN override_flag attributes mkrhs(mod_longident) IN class_expr + { let loc = ($startpos($2), $endpos($5)) in + let od = Opn.mk ~override:$3 ~loc:(make_loc loc) $5 in + mkclass ~loc:$sloc ~attrs:$4 (Pcl_open(od, $7)) } + | class_expr attribute + { Cl.attr $1 $2 } + | mkclass( + class_simple_expr nonempty_llist(labeled_simple_expr) + { Pcl_apply($1, $2) } + | extension + { Pcl_extension $1 } + ) { $1 } +; +class_simple_expr: + | LPAREN class_expr RPAREN + { $2 } + | LPAREN class_expr error + { unclosed "(" $loc($1) ")" $loc($3) } + | mkclass( + tys = actual_class_parameters cid = mkrhs(class_longident) + { Pcl_constr(cid, tys) } + | OBJECT attributes class_structure error + { unclosed "object" $loc($1) "end" $loc($4) } + | LPAREN class_expr COLON class_type RPAREN + { Pcl_constraint($2, $4) } + | LPAREN class_expr COLON class_type error + { unclosed "(" $loc($1) ")" $loc($5) } + ) { $1 } + | OBJECT attributes class_structure END + { mkclass ~loc:$sloc ~attrs:$2 (Pcl_structure $3) } +; + +class_fun_def: + mkclass( + labeled_simple_pattern MINUSGREATER e = class_expr + | labeled_simple_pattern e = class_fun_def + { let (l,o,p) = $1 in Pcl_fun(l, o, p, e) } + ) { $1 } +; +%inline class_structure: + | class_self_pattern extra_cstr(class_fields) + { Cstr.mk $1 $2 } +; +class_self_pattern: + LPAREN pattern RPAREN + { reloc_pat ~loc:$sloc $2 } + | LPAREN pattern COLON core_type RPAREN + { mkpat_with_modes ~loc:$sloc ~pat:$2 ~cty:(Some $4) ~modes:[] } + | /* empty */ + { ghpat ~loc:$sloc Ppat_any } +; +%inline class_fields: + flatten(text_cstr(class_field)*) + { $1 } +; +class_field: + | INHERIT override_flag attributes class_expr + self = preceded(AS, mkrhs(LIDENT))? + post_item_attributes + { let docs = symbol_docs $sloc in + mkcf ~loc:$sloc (Pcf_inherit ($2, $4, self)) ~attrs:($3@$6) ~docs } + | VAL value post_item_attributes + { let v, attrs = $2 in + let docs = symbol_docs $sloc in + mkcf ~loc:$sloc (Pcf_val v) ~attrs:(attrs@$3) ~docs } + | METHOD method_ post_item_attributes + { let meth, attrs = $2 in + let docs = symbol_docs $sloc in + mkcf ~loc:$sloc (Pcf_method meth) ~attrs:(attrs@$3) ~docs } + | CONSTRAINT attributes constrain_field post_item_attributes + { let docs = symbol_docs $sloc in + mkcf ~loc:$sloc (Pcf_constraint $3) ~attrs:($2@$4) ~docs } + | INITIALIZER attributes seq_expr post_item_attributes + { let docs = symbol_docs $sloc in + mkcf ~loc:$sloc (Pcf_initializer $3) ~attrs:($2@$4) ~docs } + | item_extension post_item_attributes + { let docs = symbol_docs $sloc in + mkcf ~loc:$sloc (Pcf_extension $1) ~attrs:$2 ~docs } + | mkcf(floating_attribute + { Pcf_attribute $1 }) + { $1 } +; +value: + no_override_flag + attrs = attributes + mutable_ = virtual_with_mutable_flag + label = mkrhs(label) COLON ty = core_type + { (label, mutable_, Cfk_virtual ty), attrs } + | override_flag attributes mutable_flag mkrhs(label) EQUAL seq_expr + { ($4, $3, Cfk_concrete ($1, $6)), $2 } + | override_flag attributes mutable_flag mkrhs(label) type_constraint + EQUAL seq_expr + { let e = mkexp_type_constraint_with_modes ~loc:$sloc ~modes:[] $7 $5 in + ($4, $3, Cfk_concrete ($1, e)), $2 + } +; +method_: + no_override_flag + attrs = attributes + private_ = virtual_with_private_flag + label = mkrhs(label) COLON ty = poly_type + { (label, private_, Cfk_virtual ty), attrs } + | override_flag attributes private_flag mkrhs(label) strict_binding + { let e = $5 in + let loc = Location.(e.pexp_loc.loc_start, e.pexp_loc.loc_end) in + ($4, $3, + Cfk_concrete ($1, ghexp ~loc (Pexp_poly (e, None)))), $2 } + | override_flag attributes private_flag mkrhs(label) + COLON poly_type EQUAL seq_expr + { let poly_exp = + let loc = ($startpos($6), $endpos($8)) in + ghexp ~loc (Pexp_poly($8, Some $6)) in + ($4, $3, Cfk_concrete ($1, poly_exp)), $2 } + | override_flag attributes private_flag mkrhs(label) COLON TYPE newtypes + DOT core_type EQUAL seq_expr + { let poly_exp_loc = ($startpos($7), $endpos($11)) in + let poly_exp = + let exp, poly = + (* it seems odd to use the global ~loc here while poly_exp_loc + is tighter, but this is what ocamlyacc does; + TODO improve parser.mly *) + wrap_type_annotation ~loc:$sloc ~modes:[] $7 $9 $11 in + ghexp ~loc:poly_exp_loc (Pexp_poly(exp, Some poly)) in + ($4, $3, + Cfk_concrete ($1, poly_exp)), $2 } +; + +/* Class types */ + +class_type: + class_signature + { $1 } + | mkcty( + label = arg_label + domain = tuple_type + MINUSGREATER + codomain = class_type + { Pcty_arrow(label, domain, codomain) } + ) { $1 } + ; +class_signature: + mkcty( + tys = actual_class_parameters cid = mkrhs(clty_longident) + { Pcty_constr (cid, tys) } + | extension + { Pcty_extension $1 } + ) { $1 } + | OBJECT attributes class_sig_body END + { mkcty ~loc:$sloc ~attrs:$2 (Pcty_signature $3) } + | OBJECT attributes class_sig_body error + { unclosed "object" $loc($1) "end" $loc($4) } + | class_signature attribute + { Cty.attr $1 $2 } + | LET OPEN override_flag attributes mkrhs(mod_longident) IN class_signature + { let loc = ($startpos($2), $endpos($5)) in + let od = Opn.mk ~override:$3 ~loc:(make_loc loc) $5 in + mkcty ~loc:$sloc ~attrs:$4 (Pcty_open(od, $7)) } +; +%inline class_parameters(parameter): + | /* empty */ + { [] } + | LBRACKET params = separated_nonempty_llist(COMMA, parameter) RBRACKET + { params } +; +%inline actual_class_parameters: + tys = class_parameters(core_type) + { tys } +; +%inline class_sig_body: + class_self_type extra_csig(class_sig_fields) + { Csig.mk $1 $2 } +; +class_self_type: + LPAREN core_type RPAREN + { $2 } + | mktyp((* empty *) { Ptyp_any None }) + { $1 } +; +%inline class_sig_fields: + flatten(text_csig(class_sig_field)*) + { $1 } +; +class_sig_field: + INHERIT attributes class_signature post_item_attributes + { let docs = symbol_docs $sloc in + mkctf ~loc:$sloc (Pctf_inherit $3) ~attrs:($2@$4) ~docs } + | VAL attributes value_type post_item_attributes + { let docs = symbol_docs $sloc in + mkctf ~loc:$sloc (Pctf_val $3) ~attrs:($2@$4) ~docs } + | METHOD attributes private_virtual_flags mkrhs(label) COLON poly_type + post_item_attributes + { let (p, v) = $3 in + let docs = symbol_docs $sloc in + mkctf ~loc:$sloc (Pctf_method ($4, p, v, $6)) ~attrs:($2@$7) ~docs } + | CONSTRAINT attributes constrain_field post_item_attributes + { let docs = symbol_docs $sloc in + mkctf ~loc:$sloc (Pctf_constraint $3) ~attrs:($2@$4) ~docs } + | item_extension post_item_attributes + { let docs = symbol_docs $sloc in + mkctf ~loc:$sloc (Pctf_extension $1) ~attrs:$2 ~docs } + | mkctf(floating_attribute + { Pctf_attribute $1 }) + { $1 } +; +%inline value_type: + flags = mutable_virtual_flags + label = mkrhs(label) + COLON + ty = core_type + { + let mut, virt = flags in + label, mut, virt, ty + } +; +%inline constrain: + core_type EQUAL core_type + { $1, $3, make_loc $sloc } +; +constrain_field: + core_type EQUAL core_type + { $1, $3 } +; +(* A group of class descriptions. *) +%inline class_descriptions: + xlist(class_description, and_class_description) + { $1 } +; +%inline class_description: + CLASS + ext = ext + attrs1 = attributes + virt = virtual_flag + params = formal_class_parameters + id = mkrhs(LIDENT) + COLON + cty = class_type + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + ext, + Ci.mk id cty ~virt ~params ~attrs ~loc ~docs + } +; +%inline and_class_description: + AND + attrs1 = attributes + virt = virtual_flag + params = formal_class_parameters + id = mkrhs(LIDENT) + COLON + cty = class_type + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + let text = symbol_text $symbolstartpos in + Ci.mk id cty ~virt ~params ~attrs ~loc ~text ~docs + } +; +class_type_declarations: + xlist(class_type_declaration, and_class_type_declaration) + { $1 } +; +%inline class_type_declaration: + CLASS TYPE + ext = ext + attrs1 = attributes + virt = virtual_flag + params = formal_class_parameters + id = mkrhs(LIDENT) + EQUAL + csig = class_signature + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + ext, + Ci.mk id csig ~virt ~params ~attrs ~loc ~docs + } +; +%inline and_class_type_declaration: + AND + attrs1 = attributes + virt = virtual_flag + params = formal_class_parameters + id = mkrhs(LIDENT) + EQUAL + csig = class_signature + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + let text = symbol_text $symbolstartpos in + Ci.mk id csig ~virt ~params ~attrs ~loc ~text ~docs + } +; + +/* Core expressions */ + +%inline or_function(EXPR): + | EXPR + { $1 } + | maybe_stack ( + FUNCTION ext_attributes match_cases + { let loc = make_loc $sloc in + let cases = $3 in + (* There are two choices of where to put attributes: on the + Pexp_function node; on the Pfunction_cases body. We put them on the + Pexp_function node here because the compiler only uses + Pfunction_cases attributes for enabling/disabling warnings in + typechecking. For standalone function cases, we want the compiler to + respect, e.g., [@inline] attributes. + *) + mkfunction [] empty_body_constraint (Pfunction_cases (cases, loc, [])) ~attrs:$2 + ~loc:$sloc + } + ) + { $1 } +; + +(* [fun_seq_expr] (and [fun_expr]) are legal expression bodies of a function. + [seq_expr] (and [expr]) are expressions that appear in other contexts + (e.g. subexpressions of the expression body of a function). + [fun_seq_expr] can't be a bare [function _ -> ...]. [seq_expr] can. + This distinction exists because [function _ -> ...] is parsed as a *function + cases* body of a function, not an expression body. This so functions can be + parsed with the intended arity. +*) +fun_seq_expr: + | fun_expr %prec below_SEMI { $1 } + | fun_expr SEMI { $1 } + | mkexp(fun_expr SEMI seq_expr + { Pexp_sequence($1, $3) }) + { $1 } + | fun_expr SEMI PERCENT attr_id seq_expr + { let seq = mkexp ~loc:$sloc (Pexp_sequence ($1, $5)) in + let payload = PStr [mkstrexp seq []] in + mkexp ~loc:$sloc (Pexp_extension ($4, payload)) } +; +seq_expr: + | or_function(fun_seq_expr) { $1 } +; + +labeled_simple_pattern: + QUESTION LPAREN label_let_pattern opt_default RPAREN + { (Optional (fst $3), $4, snd $3) } + | QUESTION label_var + { (Optional (fst $2), None, snd $2) } + | OPTLABEL LPAREN let_pattern opt_default RPAREN + { (Optional $1, $4, $3) } + | OPTLABEL pattern_var + { (Optional $1, None, $2) } + | TILDE LPAREN label_let_pattern RPAREN + { (Labelled (fst $3), None, snd $3) } + | TILDE label_var + { (Labelled (fst $2), None, snd $2) } + | LABEL simple_pattern_extend_modes_or_poly + { (Labelled $1, None, $2) } + | simple_pattern_extend_modes_or_poly + { (Nolabel, None, $1) } +; + +pattern_var: + mkpat( + mkrhs(LIDENT) { Ppat_var $1 } + | UNDERSCORE { Ppat_any } + ) { $1 } +; + +%inline opt_default: + preceded(EQUAL, seq_expr)? + { $1 } +; + +optional_poly_type_and_modes: + { None, [] } + | at_mode_expr + { None, $1 } + | COLON cty_mm = poly_type_with_optional_modes + { let cty, mm = cty_mm in + Some cty, mm + } +; + +label_let_pattern: + modes0 = optional_mode_expr_legacy x = label_var + cty_modes1 = optional_poly_type_and_modes + { let lab, pat = x in + let cty, modes1 = cty_modes1 in + let modes = modes0 @ modes1 in + let loc = $startpos(modes0), $endpos(cty_modes1) in + let pat = mkpat_with_modes ~loc ~pat ~cty ~modes in + lab, pat + } +; +%inline label_var: + mkrhs(LIDENT) + { ($1.Location.txt, mkpat ~loc:$sloc (Ppat_var $1)) } +; +let_pattern: + modes0 = optional_mode_expr_legacy pat = pattern + cty_modes1 = optional_poly_type_and_modes + { + let cty, modes1 = cty_modes1 in + let modes = modes0 @ modes1 in + let loc = $startpos(modes0), $endpos(cty_modes1) in + mkpat_with_modes ~loc ~pat ~cty ~modes + } +; + +(* simple_pattern extended with poly_type and modes *) +simple_pattern_extend_modes_or_poly: + simple_pattern { $1 } + | LPAREN pattern_with_modes_or_poly RPAREN + { $2 } + +pattern_with_modes_or_poly: + modes0 = mode_expr_legacy pat = pattern cty_modes1 = optional_poly_type_and_modes + { + let cty, modes1 = cty_modes1 in + let modes = modes0 @ modes1 in + let loc = $startpos(modes0), $endpos(cty_modes1) in + mkpat_with_modes ~loc ~pat ~cty:cty ~modes + } + | pat = pattern COLON cty_modes = poly_type_with_modes + { + let cty, modes = cty_modes in + mkpat_with_modes ~loc:$sloc ~pat ~cty:(Some cty) ~modes + } + | pat = pattern modes = at_mode_expr + { + mkpat_with_modes ~loc:$sloc ~pat ~cty:None ~modes + } + | pat = pattern COLON cty = strictly_poly_type + { + mkpat_with_modes ~loc:$sloc ~pat ~cty:(Some cty) ~modes:[] + } + +%inline indexop_expr(dot, index, right): + | array=simple_expr d=dot LPAREN i=index RPAREN r=right + { array, d, Paren, i, r } + | array=simple_expr d=dot LBRACE i=index RBRACE r=right + { array, d, Brace, i, r } + | array=simple_expr d=dot LBRACKET i=index RBRACKET r=right + { array, d, Bracket, i, r } +; + +%inline indexop_error(dot, index): + | simple_expr dot _p=LPAREN index _e=error + { indexop_unclosed_error $loc(_p) Paren $loc(_e) } + | simple_expr dot _p=LBRACE index _e=error + { indexop_unclosed_error $loc(_p) Brace $loc(_e) } + | simple_expr dot _p=LBRACKET index _e=error + { indexop_unclosed_error $loc(_p) Bracket $loc(_e) } +; + +%inline qualified_dotop: ioption(DOT mod_longident {$2}) DOTOP { $1, $2 }; + +optional_atomic_constraint_: + | COLON atomic_type { + { ret_type_constraint = Some (Pconstraint $2) + ; mode_annotations = [] + ; ret_mode_annotations = [] + } + } + | at_mode_expr { + { ret_type_constraint = None + ; mode_annotations = [] + ; ret_mode_annotations = $1 + } + } + | { empty_body_constraint } + +fun_: + /* Cf #5939: we used to accept (fun p when e0 -> e) */ + | maybe_stack ( + FUN ext_attributes fun_params body_constraint = optional_atomic_constraint_ + MINUSGREATER fun_body + { mkfunction $3 body_constraint $6 ~loc:$sloc ~attrs:$2 } + ) { $1 } + +fun_expr: + simple_expr %prec below_HASH + { $1 } + | fun_expr_attrs + { let desc, attrs = $1 in + mkexp_attrs ~loc:$sloc desc attrs } + | fun_ + { $1 } + | expr_ + { $1 } + | let_bindings(ext) IN seq_expr + { expr_of_let_bindings ~loc:$sloc $1 $3 } + | pbop_op = mkrhs(LETOP) bindings = letop_bindings IN body = seq_expr + { let (pbop_pat, pbop_exp, rev_ands) = bindings in + let ands = List.rev rev_ands in + let pbop_loc = make_loc $sloc in + let let_ = {pbop_op; pbop_pat; pbop_exp; pbop_loc} in + mkexp ~loc:$sloc (Pexp_letop{ let_; ands; body}) } + | fun_expr COLONCOLON expr + { mkexp_cons ~loc:$sloc $loc($2) + (ghexp ~loc:$sloc (Pexp_tuple[None, $1;None, $3])) } + | mkrhs(label) LESSMINUS expr + { mkexp ~loc:$sloc (Pexp_setvar($1, $3)) } + | simple_expr DOT mkrhs(label_longident) LESSMINUS expr + { mkexp ~loc:$sloc (Pexp_setfield($1, $3, $5)) } + | indexop_expr(DOT, seq_expr, LESSMINUS v=expr {Some v}) + { mk_indexop_expr builtin_indexing_operators ~loc:$sloc $1 } + | indexop_expr(qualified_dotop, expr_semi_list, LESSMINUS v=expr {Some v}) + { mk_indexop_expr user_indexing_operators ~loc:$sloc $1 } + | fun_expr attribute + { Exp.attr $1 $2 } + | UNDERSCORE + { mkexp ~loc:$sloc Pexp_hole } + | mode=mode_legacy exp=seq_expr + { mkexp_constraint ~loc:$sloc ~exp ~cty:None ~modes:[mode] } + | EXCLAVE seq_expr + { mkexp_exclave ~loc:$sloc ~kwd_loc:($loc($1)) $2 } +; +%inline expr: + | or_function(fun_expr) { $1 } +; +%inline fun_expr_attrs: + | LET MODULE ext_attributes module_name_modal(at_mode_expr) module_binding_body IN seq_expr + { + let name, modes = $4 in + let body = maybe_pmod_constraint modes $5 in + Pexp_letmodule(name, body, $7), $3 } + | LET EXCEPTION ext_attributes let_exception_declaration IN seq_expr + { Pexp_letexception($4, $6), $3 } + | LET OPEN override_flag ext_attributes module_expr IN seq_expr + { let open_loc = make_loc ($startpos($2), $endpos($5)) in + let od = Opn.mk $5 ~override:$3 ~loc:open_loc in + Pexp_open(od, $7), $4 } + | MATCH ext_attributes seq_expr WITH match_cases + { Pexp_match($3, $5), $2 } + | TRY ext_attributes seq_expr WITH match_cases + { Pexp_try($3, $5), $2 } + | TRY ext_attributes seq_expr WITH error + { syntax_error() } + | OVERWRITE ext_attributes seq_expr WITH expr + { Pexp_overwrite($3, $5), $2 } + | IF ext_attributes seq_expr THEN expr ELSE expr + { Pexp_ifthenelse($3, $5, Some $7), $2 } + | IF ext_attributes seq_expr THEN expr + { Pexp_ifthenelse($3, $5, None), $2 } + | WHILE ext_attributes seq_expr do_done_expr + { Pexp_while($3, $4), $2 } + | FOR ext_attributes pattern EQUAL seq_expr direction_flag seq_expr + do_done_expr + { Pexp_for($3, $5, $7, $6, $8), $2 } + | ASSERT ext_attributes simple_expr %prec below_HASH + { Pexp_assert $3, $2 } + | LAZY ext_attributes simple_expr %prec below_HASH + { Pexp_lazy $3, $2 } + | subtractive expr %prec prec_unary_minus + { let desc, attrs = mkuminus ~oploc:$loc($1) $1 $2 in + desc, (None, attrs) } + | additive expr %prec prec_unary_plus + { let desc, attrs = mkuplus ~oploc:$loc($1) $1 $2 in + desc, (None, attrs) } +; +%inline do_done_expr: + | DO e = seq_expr DONE + { e } + | DO seq_expr error + { unclosed "do" $loc($1) "done" $loc($2) } +; +%inline expr_: + | simple_expr nonempty_llist(labeled_simple_expr) + { mkexp ~loc:$sloc (Pexp_apply($1, $2)) } + | stack(simple_expr) %prec below_HASH { $1 } + | labeled_tuple %prec below_COMMA + { mkexp ~loc:$sloc (Pexp_tuple $1) } + | maybe_stack ( + mkrhs(constr_longident) simple_expr %prec below_HASH + { mkexp ~loc:$sloc (Pexp_construct($1, Some $2)) } + ) { $1 } + | name_tag simple_expr %prec below_HASH + { mkexp ~loc:$sloc (Pexp_variant($1, Some $2)) } + | e1 = fun_expr op = op(infix_operator) e2 = expr + { mkexp ~loc:$sloc (mkinfix e1 op e2) } +; + +unboxed_access: + | DOTHASH mkrhs(label_longident) + { Uaccess_unboxed_field $2 } +; + +simple_expr: + | LPAREN seq_expr RPAREN + { reloc_exp ~loc:$sloc $2 } + | LPAREN seq_expr error + { unclosed "(" $loc($1) ")" $loc($3) } + | LPAREN seq_expr type_constraint_with_modes RPAREN + { let (t, m) = $3 in + mkexp_type_constraint_with_modes ~ghost:true ~loc:$sloc ~modes:m $2 t } + | indexop_expr(DOT, seq_expr, { None }) + { mk_indexop_expr builtin_indexing_operators ~loc:$sloc $1 } + (* Immutable array indexing is a regular operator, so it doesn't need its own + rule and is handled by the next case *) + | indexop_expr(qualified_dotop, expr_semi_list, { None }) + { mk_indexop_expr user_indexing_operators ~loc:$sloc $1 } + | indexop_error (DOT, seq_expr) { $1 } + | indexop_error (qualified_dotop, expr_semi_list) { $1 } + | simple_expr_attrs + { let desc, attrs = $1 in + mkexp_attrs ~loc:$sloc desc attrs } + | mkexp(simple_expr_) + { $1 } + (* Jane Syntax. These rules create [expression] instead of [expression_desc] + because Jane Syntax can use attributes as part of their encoding. + *) + | array_exprs(LBRACKETCOLON, COLONRBRACKET) + { Generic_array.Expression.to_expression + "[:" ":]" + ~loc:$sloc + Immutable + $1 + } + | constant { mkexp ~loc:$sloc (Pexp_constant $1) } + | comprehension_expr { $1 } +; +%inline simple_expr_attrs: + | BEGIN ext = ext attrs = attributes e = seq_expr END + { e.pexp_desc, (ext, attrs @ e.pexp_attributes) } + | BEGIN ext_attributes END + { Pexp_construct (mkloc (Lident "()") (make_loc $sloc), None), $2 } + | BEGIN ext_attributes seq_expr error + { unclosed "begin" $loc($1) "end" $loc($4) } + | NEW ext_attributes mkrhs(class_longident) + { Pexp_new($3), $2 } + | LPAREN MODULE ext_attributes module_expr RPAREN + { Pexp_pack $4, $3 } + | LPAREN MODULE ext_attributes module_expr COLON package_type RPAREN + { Pexp_constraint (ghexp ~loc:$sloc (Pexp_pack $4), Some $6, []), $3 } + | LPAREN MODULE ext_attributes module_expr COLON error + { unclosed "(" $loc($1) ")" $loc($6) } + | OBJECT ext_attributes class_structure END + { Pexp_object $3, $2 } + | OBJECT ext_attributes class_structure error + { unclosed "object" $loc($1) "end" $loc($4) } +; + +comprehension_iterator: + | EQUAL expr direction_flag expr + { Pcomp_range { start = $2 ; stop = $4 ; direction = $3 } } + | IN expr + { Pcomp_in $2 } +; + +comprehension_clause_binding: + | attributes pattern comprehension_iterator + { { pcomp_cb_pattern = $2 ; pcomp_cb_iterator = $3 ; pcomp_cb_attributes = $1 } } + (* We can't write [[e for local_ x = 1 to 10]], because the [local_] has to + move to the RHS and there's nowhere for it to move to; besides, you never + want that [int] to be [local_]. But we can parse [[e for local_ x in xs]]. + We have to have that as a separate rule here because it moves the [local_] + over to the RHS of the binding, so we need everything to be visible. *) + | attributes mode_legacy pattern IN expr + { let expr = + mkexp_constraint ~loc:$sloc ~exp:$5 ~cty:None ~modes:[$2] + in + { pcomp_cb_pattern = $3 + ; pcomp_cb_iterator = Pcomp_in expr + ; pcomp_cb_attributes = $1 + } + } +; + +comprehension_clause: + | FOR separated_nonempty_llist(AND, comprehension_clause_binding) + { Pcomp_for $2 } + | WHEN expr + { Pcomp_when $2 } + +%inline comprehension(lbracket, rbracket): + lbracket expr nonempty_llist(comprehension_clause) rbracket + { { pcomp_body = $2; pcomp_clauses = $3 } } +; + +%inline comprehension_ext_expr: + | comprehension(LBRACKET,RBRACKET) + { Pcomp_list_comprehension $1 } + | comprehension(LBRACKETBAR,BARRBRACKET) + { Pcomp_array_comprehension (Mutable, $1) } + | comprehension(LBRACKETCOLON,COLONRBRACKET) + { Pcomp_array_comprehension (Immutable, $1) } +; + +%inline comprehension_expr: + comprehension_ext_expr + { mkexp ~loc:$sloc (Pexp_comprehension $1) } +; + +%inline array_simple(ARR_OPEN, ARR_CLOSE, contents_semi_list): + | ARR_OPEN contents_semi_list ARR_CLOSE + { Generic_array.Simple.Literal $2 } + | ARR_OPEN contents_semi_list error + { Generic_array.Simple.Unclosed($loc($1),$loc($3)) } + | ARR_OPEN ARR_CLOSE + { Generic_array.Simple.Literal [] } +; + +%inline array_exprs(ARR_OPEN, ARR_CLOSE): + | array_simple(ARR_OPEN, ARR_CLOSE, expr_semi_list) + { Generic_array.Expression.Simple $1 } + | od=open_dot_declaration DOT ARR_OPEN expr_semi_list ARR_CLOSE + { Generic_array.Expression.Opened_literal(od, $startpos($3), $endpos, $4) + } + | od=open_dot_declaration DOT ARR_OPEN ARR_CLOSE + { (* TODO: review the location of Pexp_array *) + Generic_array.Expression.Opened_literal(od, $startpos($3), $endpos, []) + } + | mod_longident DOT + ARR_OPEN expr_semi_list error + { Generic_array.Expression.Simple (Unclosed($loc($3), $loc($5))) } +; + +%inline array_patterns(ARR_OPEN, ARR_CLOSE): + | array_simple(ARR_OPEN, ARR_CLOSE, pattern_semi_list) + { $1 } +; + +%inline hash: + | HASH { () } + | HASH_SUFFIX { () } +; + +%inline indexop_block_access(dot, index): + | d=dot LPAREN i=index RPAREN + { d, Paren, i } + | d=dot LBRACE i=index RBRACE + { d, Brace, i } + | d=dot LBRACKET i=index RBRACKET + { d, Bracket, i } +; + +block_access: + | DOT mkrhs(label_longident) + { Baccess_field $2 } + | DOT _p=LPAREN i=seq_expr RPAREN + { Baccess_array (Mutable, Index_int, i) } + | DOTOP _p=LPAREN i=seq_expr RPAREN + { + match $1 with + | ":" -> Baccess_array (Immutable, Index_int, i) + | _ -> raise Syntaxerr.(Error(Block_access_bad_paren(make_loc $loc(_p)))) + } + | DOT ident _p=LPAREN i=seq_expr RPAREN + { + match $2 with + | "L" -> Baccess_array (Mutable, Index_unboxed_int64, i) + | "l" -> Baccess_array (Mutable, Index_unboxed_int32, i) + | "n" -> Baccess_array (Mutable, Index_unboxed_nativeint, i) + | "idx_imm" -> Baccess_block (Immutable, i) + | "idx_mut" -> Baccess_block (Mutable, i) + | _ -> + raise Syntaxerr.(Error(Block_access_bad_paren(make_loc $loc(_p)))) + } + | DOTOP ident _p=LPAREN i=seq_expr RPAREN + { + match $1, $2 with + | ":", "L" -> Baccess_array (Immutable, Index_unboxed_int64, i) + | ":", "l" -> Baccess_array (Immutable, Index_unboxed_int32, i) + | ":", "n" -> Baccess_array (Immutable, Index_unboxed_nativeint, i) + | _ -> + raise Syntaxerr.(Error(Block_access_bad_paren(make_loc $loc(_p)))) + } + | DOT ident _p=LPAREN seq_expr _e=error + { indexop_unclosed_error $loc(_p) Paren $loc(_e) } +; + +%inline simple_expr_: + | mkrhs(val_longident) + { Pexp_ident ($1) } + | mkrhs(constr_longident) %prec prec_constant_constructor + { Pexp_construct($1, None) } + | name_tag %prec prec_constant_constructor + { Pexp_variant($1, None) } + | op(PREFIXOP) simple_expr + { Pexp_apply($1, [Nolabel,$2]) } + | op(BANG {"!"}) simple_expr + { Pexp_apply($1, [Nolabel,$2]) } + | LBRACELESS object_expr_content GREATERRBRACE + { Pexp_override $2 } + | LBRACELESS object_expr_content error + { unclosed "{<" $loc($1) ">}" $loc($3) } + | LBRACELESS GREATERRBRACE + { Pexp_override [] } + | simple_expr DOT mkrhs(label_longident) + { Pexp_field($1, $3) } + | simple_expr DOTHASH mkrhs(label_longident) + { Pexp_unboxed_field($1, $3) } + | LPAREN block_access llist(unboxed_access) RPAREN + { Pexp_idx ($2, $3) } + | od=open_dot_declaration DOT LPAREN seq_expr RPAREN + { Pexp_open(od, $4) } + | od=open_dot_declaration DOT LBRACELESS object_expr_content GREATERRBRACE + { (* TODO: review the location of Pexp_override *) + Pexp_open(od, mkexp ~loc:$sloc (Pexp_override $4)) } + | mod_longident DOT LBRACELESS object_expr_content error + { unclosed "{<" $loc($3) ">}" $loc($5) } + | simple_expr hash mkrhs(label) + { Pexp_send($1, $3) } + | simple_expr op(HASHOP) simple_expr + { mkinfix $1 $2 $3 } + | extension + { Pexp_extension $1 } + | od=open_dot_declaration DOT mkrhs(LPAREN RPAREN {Lident "()"}) + { Pexp_open(od, mkexp ~loc:($loc($3)) (Pexp_construct($3, None))) } + | mod_longident DOT LPAREN seq_expr error + { unclosed "(" $loc($3) ")" $loc($5) } + | LBRACE record_expr_content RBRACE + { let (exten, fields) = $2 in + Pexp_record(fields, exten) } + | HASHLBRACE record_expr_content RBRACE + { let (exten, fields) = $2 in + Pexp_record_unboxed_product(fields, exten) } + | LBRACE record_expr_content error + { unclosed "{" $loc($1) "}" $loc($3) } + | od=open_dot_declaration DOT LBRACE record_expr_content RBRACE + { let (exten, fields) = $4 in + Pexp_open(od, mkexp ~loc:($startpos($3), $endpos) + (Pexp_record(fields, exten))) } + | mod_longident DOT LBRACE record_expr_content error + { unclosed "{" $loc($3) "}" $loc($5) } + | array_exprs(LBRACKETBAR, BARRBRACKET) + { Generic_array.Expression.to_desc + "[|" "|]" + Mutable + $1 + } + | LBRACKET expr_semi_list RBRACKET + { fst (mktailexp $loc($3) $2) } + | LBRACKET expr_semi_list error + { unclosed "[" $loc($1) "]" $loc($3) } + | od=open_dot_declaration DOT comprehension_expr + { Pexp_open(od, $3) } + | od=open_dot_declaration DOT LBRACKET expr_semi_list RBRACKET + { let list_exp = + (* TODO: review the location of list_exp *) + let tail_exp, _tail_loc = mktailexp $loc($5) $4 in + mkexp ~loc:($startpos($3), $endpos) tail_exp in + Pexp_open(od, list_exp) } + | od=open_dot_declaration DOT mkrhs(LBRACKET RBRACKET {Lident "[]"}) + { Pexp_open(od, mkexp ~loc:$loc($3) (Pexp_construct($3, None))) } + | mod_longident DOT + LBRACKET expr_semi_list error + { unclosed "[" $loc($3) "]" $loc($5) } + | od=open_dot_declaration DOT LPAREN MODULE ext_attributes module_expr COLON + package_type RPAREN + { let modexp = + mkexp_attrs ~loc:($startpos($3), $endpos) + (Pexp_constraint (ghexp ~loc:$sloc (Pexp_pack $6), Some $8, [])) $5 in + Pexp_open(od, modexp) } + | LESSLBRACKET expr_semi_list RBRACKETGREATER + { quotation_reserved "<[" $loc($1) } + | LESSLBRACKET expr_semi_list error + { unclosed "<[" $loc($1) "]>" $loc($3) } + | DOLLAR error + { quotation_reserved "$" $loc($1) } + | mod_longident DOT + LPAREN MODULE ext_attributes module_expr COLON error + { unclosed "(" $loc($3) ")" $loc($8) } + | HASHLPAREN labeled_tuple RPAREN + { Pexp_unboxed_tuple $2 } +; +labeled_simple_expr: + simple_expr %prec below_HASH + { (Nolabel, $1) } + | LABEL simple_expr %prec below_HASH + { (Labelled $1, $2) } + | TILDE label = LIDENT + { let loc = $loc(label) in + (Labelled label, mkexpvar ~loc label) } + | TILDE LPAREN label = LIDENT c = type_constraint RPAREN + { (Labelled label, mkexp_type_constraint_with_modes ~loc:($startpos($2), $endpos) ~modes:[] + (mkexpvar ~loc:$loc(label) label) c) } + | QUESTION label = LIDENT + { let loc = $loc(label) in + (Optional label, mkexpvar ~loc label) } + | OPTLABEL simple_expr %prec below_HASH + { (Optional $1, $2) } +; +%inline let_ident: + val_ident { mkpatvar ~loc:$sloc $1 } +; +%inline pvc_modes: + | at_mode_expr {None, $1} + | COLON core_type_with_optional_modes { + let typ, mm = $2 in + Some(Pvc_constraint { locally_abstract_univars=[]; typ }), mm + } +; + +%inline empty_list: { [] } + +%inline let_ident_with_modes: + optional_mode_expr_legacy let_ident + { ($2, $1) } + | LPAREN let_ident at_mode_expr RPAREN + { ($2, $3) } + +let_binding_body_no_punning: + let_ident_with_modes strict_binding_modes + { let v, modes = $1 in + (v, $2 modes, None, modes) } + | let_ident_with_modes constraint_ EQUAL seq_expr + (* CR zqian: modes are duplicated, and one of them needs to be made ghost + to make internal tools happy. We should try to avoid that. *) + { let v, modes0 = $1 in + let typ, modes1 = $2 in + let t = + Option.map (function + | Pconstraint t -> + Pvc_constraint { locally_abstract_univars = []; typ=t } + | Pcoerce (ground, coercion) -> Pvc_coercion { ground; coercion} + ) typ + in + let modes = modes0 @ modes1 in + (v, $4, t, modes) + } + | let_ident_with_modes COLON strictly_poly_type_with_optional_modes EQUAL seq_expr + { let v, modes0 = $1 in + let typ, modes1 = $3 in + let modes = modes0 @ modes1 in + (v, $5, Some (Pvc_constraint { locally_abstract_univars = []; typ }), + modes) + } + | let_ident_with_modes COLON TYPE ntys = newtypes DOT cty = core_type modes1 = empty_list EQUAL e = seq_expr + | let_ident_with_modes COLON TYPE ntys = newtypes DOT cty = tuple_type modes1=at_mode_expr EQUAL e = seq_expr + (* The code upstream looks like: + {[ + let constraint' = + Pvc_constraint { locally_abstract_univars=$4; typ = $6} + in + ($1, $8, Some constraint') + ]} + + But this would require adding a jkind field to [newtypes], which will require + a small amount of additional work. + + The [typloc] argument to [wrap_type_annotation] is used to make the + location on the [core_type] node for the annotation match the upstream + version, even though we are creating a slightly different [core_type]. + *) + { let exp, poly = + wrap_type_annotation ~loc:$sloc ~modes:[] ~typloc:$loc(cty) ntys cty e + in + let v, modes0 = $1 in + let modes = modes0 @ modes1 in + let loc = ($startpos($1), $endpos(modes1)) in + (ghpat_with_modes ~loc ~pat:v ~cty:(Some poly) ~modes:[], exp, None, modes) + } + | pattern_no_exn EQUAL seq_expr + { ($1, $3, None, []) } + | simple_pattern_not_ident pvc_modes EQUAL seq_expr + { + let pvc, modes = $2 in + ($1, $4, pvc, modes) + } +; +let_binding_body: + | let_binding_body_no_punning + { let p,e,c,modes = $1 in (p,e,c,modes,false) } +/* BEGIN AVOID */ + | val_ident %prec below_HASH + { (mkpatvar ~loc:$loc $1, ghexpvar ~loc:$loc $1, None, [], true) } + (* The production that allows puns is marked so that [make list-parse-errors] + does not attempt to exploit it. That would be problematic because it + would then generate bindings such as [let x], which are rejected by the + auxiliary function [addlb] via a call to [syntax_error]. *) +/* END AVOID */ +; +(* The formal parameter EXT can be instantiated with ext or no_ext + so as to indicate whether an extension is allowed or disallowed. *) +let_bindings(EXT): + let_binding(EXT) { $1 } + | let_bindings(EXT) and_let_binding { addlb $1 $2 } +; +%inline let_binding(EXT): + LET + ext = EXT + attrs1 = attributes + mutable_flag = mutable_flag + rec_flag = rec_flag + body = let_binding_body + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + mklbs ext mutable_flag rec_flag (mklb ~loc:$sloc true body attrs) + } +; +and_let_binding: + AND + attrs1 = attributes + body = let_binding_body + attrs2 = post_item_attributes + { + let attrs = attrs1 @ attrs2 in + mklb ~loc:$sloc false body attrs + } +; +letop_binding_body: + pat = let_ident exp = strict_binding + { (pat, exp) } + | val_ident + (* Let-punning *) + { (mkpatvar ~loc:$loc $1, ghexpvar ~loc:$loc $1) } + (* CR zqian: support mode annotation on letop. *) + | pat = simple_pattern COLON typ = core_type EQUAL exp = seq_expr + { let loc = ($startpos(pat), $endpos(typ)) in + (ghpat_with_modes ~loc ~pat ~cty:(Some typ) ~modes:[], exp) } + | pat = pattern_no_exn EQUAL exp = seq_expr + { (pat, exp) } +; +letop_bindings: + body = letop_binding_body + { let let_pat, let_exp = body in + let_pat, let_exp, [] } + | bindings = letop_bindings pbop_op = mkrhs(ANDOP) body = letop_binding_body + { let let_pat, let_exp, rev_ands = bindings in + let pbop_pat, pbop_exp = body in + let pbop_loc = make_loc $sloc in + let and_ = {pbop_op; pbop_pat; pbop_exp; pbop_loc} in + let_pat, let_exp, and_ :: rev_ands } +; +strict_binding_modes: + EQUAL seq_expr + { fun _ -> $2 } + | fun_params constraint_? EQUAL fun_body + { fun mode_annotations -> + let constraint_ : function_constraint = + let ret_type_constraint, ret_mode_annotations = + match $2 with + | None -> None, [] + | Some (ret_type_constraint, ret_mode_annotations) -> + ret_type_constraint, ret_mode_annotations + in + {mode_annotations; ret_type_constraint ; ret_mode_annotations } + in + let exp = mkfunction $1 constraint_ $4 ~loc:$sloc ~attrs:(None, []) in + { exp with pexp_loc = { exp.pexp_loc with loc_ghost = true } } + + } +; +%inline strict_binding: + strict_binding_modes + {$1 []} +; +fun_body: + | FUNCTION ext_attributes match_cases + { let ext, attrs = $2 in + match ext with + | None -> Pfunction_cases ($3, make_loc $sloc, attrs) + | Some _ -> + (* function%foo extension nodes interrupt the arity *) + let cases = Pfunction_cases ($3, make_loc $sloc, []) in + let function_ = mkfunction [] empty_body_constraint cases ~loc:$sloc ~attrs:$2 in + Pfunction_body function_ + } + | fun_seq_expr + { Pfunction_body $1 } +; +%inline match_cases: + xs = preceded_or_separated_nonempty_llist(BAR, match_case) + { xs } +; +match_case: + pattern MINUSGREATER seq_expr + { Exp.case $1 $3 } + | pattern WHEN seq_expr MINUSGREATER seq_expr + { Exp.case $1 ~guard:$3 $5 } + | pattern MINUSGREATER DOT + { Exp.case $1 (Exp.unreachable ~loc:(make_loc $loc($3)) ()) } +; +fun_param_as_list: + | LPAREN TYPE ty_params = newtypes RPAREN + { (* We desugar (type a b c) to (type a) (type b) (type c). + If we do this desugaring, the loc for each parameter is a ghost. + *) + let loc = + match ty_params with + | [] | [_] -> make_loc $sloc + | _ :: _ :: _ -> ghost_loc $sloc + in + List.map + (fun (newtype, jkind) -> + { pparam_loc = loc; + pparam_desc = Pparam_newtype (newtype, jkind) + }) + ty_params + } + | LPAREN TYPE mkrhs(LIDENT) COLON jkind_annotation RPAREN + { [ { pparam_loc = make_loc $sloc; + pparam_desc = Pparam_newtype ($3, Some $5) + } + ] + } + | labeled_simple_pattern + { let a, b, c = $1 in + [ { pparam_loc = make_loc $sloc; + pparam_desc = Pparam_val (a, b, c) + } + ] + } +; +fun_params: + | nonempty_concat(fun_param_as_list) { $1 } +; + +(* Parsing labeled tuple expressions + + The grammar we want to parse is something like: + + labeled_tuple_element := expr | ~x:expr | ~x | ~(x:ty) + labeled_tuple := lt_element [, lt_element]+ + + (The last case of [labeled_tuple_element] is a punned label with a type + constraint, which is allowed for functions, so we allow it here). + + So you might think [labeled_tuple] could therefore just be: + + labeled_tuple : + separated_nontrivial_llist(COMMA, labeled_tuple_element) + + But this doesn't work: + + - If we don't mark [labeled_tuple_element] %inline, this causes many + reduce/reduce conflicts (basically just ambiguities) because + [labeled_tuple_element] trivially reduces to [expr]. + + - If we do mark [labeled_tuple_element] %inline, it is not allowed to have + %prec annotations. Menhir doesn't permit these on %inline non-terminals + that are used in non-tail position. + + To get around this, we do mark it inlined, and then because we can only use + it in tail position it is _manually_ inlined into the occurrences in + [separated_nontrivial_llist] where it doesn't appear in tail position. This + results in [labeled_tuple] and [reversed_labeled_tuple_body] below. So the + latter is just a list of comma-separated labeled tuple elements, with length + at least two, where the first element in the base case is inlined (resulting + in one base case for each case of [labeled_tuple_element]. *) +%inline labeled_tuple_element : + | expr + { None, $1 } + | LABEL simple_expr %prec below_HASH + { Some $1, $2 } + | TILDE label = LIDENT + { let loc = $loc(label) in + Some label, mkexpvar ~loc label } + | TILDE LPAREN label = LIDENT c = type_constraint RPAREN %prec below_HASH + { Some label, + mkexp_type_constraint_with_modes + ~loc:($startpos($2), $endpos) ~modes:[] (mkexpvar ~loc:$loc(label) label) c } +; +reversed_labeled_tuple_body: + (* > 2 elements *) + xs = reversed_labeled_tuple_body + COMMA + x = labeled_tuple_element + { x :: xs } + (* base cases (2 elements) *) +| x1 = expr + COMMA + x2 = labeled_tuple_element + { [ x2; None, x1 ] } +| l1 = LABEL x1 = simple_expr + COMMA + x2 = labeled_tuple_element + { [ x2; Some l1, x1 ] } +| TILDE l1 = LIDENT + COMMA + x2 = labeled_tuple_element + { let loc = $loc(l1) in + [ x2; Some l1, mkexpvar ~loc l1] } +| TILDE LPAREN l1 = LIDENT c = type_constraint RPAREN + COMMA + x2 = labeled_tuple_element + { let x1 = + mkexp_type_constraint_with_modes + ~loc:($startpos($2), $endpos) ~modes:[] (mkexpvar ~loc:$loc(l1) l1) c + in + [ x2; Some l1, x1] } +; +%inline labeled_tuple: + xs = rev(reversed_labeled_tuple_body) + { xs } +; + +record_expr_content: + eo = ioption(terminated(simple_expr, WITH)) + fields = separated_or_terminated_nonempty_list(SEMI, record_expr_field) + { eo, fields } +; +%inline record_expr_field: + | label = mkrhs(label_longident) + c = type_constraint? + eo = preceded(EQUAL, expr)? + { let constraint_loc, label, e = + match eo with + | None -> + (* No pattern; this is a pun. Desugar it. *) + $sloc, make_ghost label, exp_of_longident label + | Some e -> + ($startpos(c), $endpos), label, e + in + label, mkexp_opt_type_constraint_with_modes ~loc:constraint_loc ~modes:[] e c } +; +%inline object_expr_content: + xs = separated_or_terminated_nonempty_list(SEMI, object_expr_field) + { xs } +; +%inline object_expr_field: + label = mkrhs(label) + oe = preceded(EQUAL, expr)? + { let label, e = + match oe with + | None -> + (* No expression; this is a pun. Desugar it. *) + make_ghost label, exp_of_label label + | Some e -> + label, e + in + label, e } +; +%inline expr_semi_list: + es = separated_or_terminated_nonempty_list(SEMI, expr) + { es } +; +type_constraint: + COLON core_type { Pconstraint $2 } + | COLON core_type COLONGREATER core_type { Pcoerce (Some $2, $4) } + | COLONGREATER core_type { Pcoerce (None, $2) } + | COLON error { syntax_error() } + | COLONGREATER error { syntax_error() } +; + +%inline type_constraint_with_modes: + | COLON core_type_with_optional_modes { + let cty, mm = $2 in + Pconstraint cty, mm } + | COLON core_type COLONGREATER core_type_with_optional_modes { + let cty, mm = $4 in + Pcoerce (Some $2, cty), mm } + | COLONGREATER core_type_with_optional_modes { + let cty, mm = $2 in + Pcoerce (None, cty), mm } + | COLON error { syntax_error() } + | COLONGREATER error { syntax_error() } +; + +%inline constraint_: + | type_constraint_with_modes + { let ty, modes = $1 in + Some ty, modes } + | at_mode_expr + { None, $1 } +; + +(* the thing between the [type] and the [.] in + [let : type <>. 'a -> 'a = ...] *) +newtypes: (* : (string with_loc * jkind_annotation option) list *) + newtype+ + { $1 } + +newtype: (* : string with_loc * jkind_annotation option *) + mkrhs(LIDENT) { $1, None } + | LPAREN name=mkrhs(LIDENT) COLON jkind=jkind_annotation RPAREN + { name, Some jkind } + +/* Patterns */ + +(* Whereas [pattern] is an arbitrary pattern, [pattern_no_exn] is a pattern + that does not begin with the [EXCEPTION] keyword. Thus, [pattern_no_exn] + is the intersection of the context-free language [pattern] with the + regular language [^EXCEPTION .*]. + + Ideally, we would like to use [pattern] everywhere and check in a later + phase that EXCEPTION patterns are used only where they are allowed (there + is code in typing/typecore.ml to this end). Unfortunately, in the + definition of [let_binding_body], we cannot allow [pattern]. That would + create a shift/reduce conflict: upon seeing LET EXCEPTION ..., the parser + wouldn't know whether this is the beginning of a LET EXCEPTION construct or + the beginning of a LET construct whose pattern happens to begin with + EXCEPTION. The conflict is avoided there by using [pattern_no_exn] in the + definition of [let_binding_body]. + + In order to avoid duplication between the definitions of [pattern] and + [pattern_no_exn], we create a parameterized definition [pattern_(self)] + and instantiate it twice. *) + +pattern: + pattern_(pattern) + { $1 } + | EXCEPTION ext_attributes pattern %prec prec_constr_appl + { mkpat_attrs ~loc:$sloc (Ppat_exception $3) $2} +; + +pattern_no_exn: + pattern_(pattern_no_exn) + { $1 } +; + +%inline pattern_(self): + | self COLONCOLON pattern + { mkpat_cons ~loc:$sloc $loc($2) + (ghpat ~loc:$sloc (Ppat_tuple ([None, $1;None, $3], Closed))) + } + | self attribute + { Pat.attr $1 $2 } + | pattern_gen + { $1 } + | mkpat( + self AS mkrhs(val_ident) + { Ppat_alias($1, $3) } + | self AS error + { expecting $loc($3) "identifier" } + | self COLONCOLON error + { expecting $loc($3) "pattern" } + | self BAR pattern + { Ppat_or($1, $3) } + | self BAR error + { expecting $loc($3) "pattern" } + ) { $1 } + | reversed_labeled_tuple_pattern(self) + { let closed, pats = $1 in + mkpat ~loc:$sloc (Ppat_tuple (List.rev pats, closed)) + } +; + +(* Parsing labeled tuple patterns + + Here we play essentially the same game we did for expressions - see the + comment beginning "Parsing labeled tuple expressions". + + One difference is that we would need to manually inline the definition of + individual elements in two places: Once in the base case for lists 2 or more + elements, and once in the special case for open patterns with just one + element (e.g., [~x, ..]). Rather than manually inlining + [labeled_tuple_pat_element] twice, we simply define it twice: once with the + [%prec] annotations needed for its occurrences in tail position, and once + without them suitable for use in other locations. +*) +%inline labeled_tuple_pat_element(self): + | self { None, $1 } + | LABEL simple_pattern %prec COMMA + { Some $1, $2 } + | TILDE label = LIDENT + { let loc = $loc(label) in + Some label, mkpatvar ~loc label } + | TILDE LPAREN label = LIDENT COLON cty = core_type RPAREN %prec COMMA + { let lbl_loc = $loc(label) in + let pat_loc = $startpos($2), $endpos in + let pat = mkpatvar ~loc:lbl_loc label in + Some label, mkpat_with_modes ~loc:pat_loc ~modes:[] ~pat ~cty:(Some cty) } + +(* If changing this, don't forget to change its copy just above. *) +%inline labeled_tuple_pat_element_noprec(self): + | self { None, $1 } + | LABEL simple_pattern + { Some $1, $2 } + | TILDE label = LIDENT + { let loc = $loc(label) in + Some label, mkpatvar ~loc label } + | TILDE LPAREN label = LIDENT COLON cty = core_type RPAREN + { let lbl_loc = $loc(label) in + let pat_loc = $startpos($2), $endpos in + let pat = mkpatvar ~loc:lbl_loc label in + Some label, mkpat_with_modes ~loc:pat_loc ~modes:[] ~pat ~cty:(Some cty) } + +labeled_tuple_pat_element_list(self): + | labeled_tuple_pat_element_list(self) COMMA labeled_tuple_pat_element(self) + { $3 :: $1 } + | labeled_tuple_pat_element_noprec(self) COMMA labeled_tuple_pat_element(self) + { [ $3; $1 ] } + | self COMMA error + { expecting $loc($3) "pattern" } +; + +reversed_labeled_tuple_pattern(self): + | labeled_tuple_pat_element_list(self) %prec below_COMMA + { Closed, $1 } + | labeled_tuple_pat_element_list(self) COMMA DOTDOT + { Open, $1 } + | labeled_tuple_pat_element_noprec(self) COMMA DOTDOT + { Open, [ $1 ] } + +pattern_gen: + simple_pattern + { $1 } + | mkpat( + mkrhs(constr_longident) pattern %prec prec_constr_appl + { Ppat_construct($1, Some ([], $2)) } + | constr=mkrhs(constr_longident) LPAREN TYPE newtypes=newtypes RPAREN + pat=simple_pattern + { Ppat_construct(constr, Some (newtypes, pat)) } + | constr=mkrhs(constr_longident) + LPAREN TYPE ty=mkrhs(LIDENT) COLON jkind=jkind_annotation RPAREN + pat=simple_pattern + { Ppat_construct(constr, Some ([(ty,Some jkind)], pat)) } + | name_tag pattern %prec prec_constr_appl + { Ppat_variant($1, Some $2) } + ) { $1 } + | LAZY ext_attributes simple_pattern + { mkpat_attrs ~loc:$sloc (Ppat_lazy $3) $2} +; +simple_pattern: + mkpat(mkrhs(val_ident) %prec below_EQUAL + { Ppat_var ($1) }) + { $1 } + | simple_pattern_not_ident { $1 } +; + +simple_pattern_not_ident: + | LPAREN pattern RPAREN + { reloc_pat ~loc:$sloc $2 } + | simple_delimited_pattern + { $1 } + | LPAREN MODULE ext_attributes mkrhs(module_name) RPAREN + { mkpat_attrs ~loc:$sloc (Ppat_unpack $4) $3 } + | LPAREN MODULE ext_attributes mkrhs(module_name) COLON package_type RPAREN + { mkpat_attrs ~loc:$sloc + (Ppat_constraint(mkpat ~loc:$loc($4) (Ppat_unpack $4), Some $6, [])) + $3 } + | simple_pattern_not_ident_ + { $1 } + | signed_constant { mkpat (Ppat_constant $1) ~loc:$sloc } +; +%inline simple_pattern_not_ident_: + mkpat( + UNDERSCORE + { Ppat_any } + | signed_value_constant DOTDOT signed_value_constant + { Ppat_interval ($1, $3) } + | mkrhs(constr_longident) + { Ppat_construct($1, None) } + | name_tag + { Ppat_variant($1, None) } + | hash mkrhs(type_longident) + { Ppat_type ($2) } + | mkrhs(mod_longident) DOT simple_delimited_pattern + { Ppat_open($1, $3) } + | mkrhs(mod_longident) DOT mkrhs(LBRACKET RBRACKET {Lident "[]"}) + { Ppat_open($1, mkpat ~loc:$sloc (Ppat_construct($3, None))) } + | mkrhs(mod_longident) DOT mkrhs(LPAREN RPAREN {Lident "()"}) + { Ppat_open($1, mkpat ~loc:$sloc (Ppat_construct($3, None))) } + | mkrhs(mod_longident) DOT LPAREN pattern RPAREN + { Ppat_open ($1, $4) } + | mod_longident DOT LPAREN pattern error + { unclosed "(" $loc($3) ")" $loc($5) } + | mod_longident DOT LPAREN error + { expecting $loc($4) "pattern" } + | LPAREN pattern error + { unclosed "(" $loc($1) ")" $loc($3) } + | LPAREN pattern COLON core_type error + { unclosed "(" $loc($1) ")" $loc($5) } + | LPAREN pattern COLON error + { expecting $loc($4) "type" } + | LPAREN MODULE ext_attributes module_name COLON package_type + error + { unclosed "(" $loc($1) ")" $loc($7) } + | extension + { Ppat_extension $1 } + ) { $1 } + | LPAREN pattern COLON core_type RPAREN + { mkpat_with_modes ~loc:$sloc ~pat:$2 ~cty:(Some $4) ~modes:[] } +; + +simple_delimited_pattern: + mkpat( + LBRACE record_pat_content RBRACE + { let (fields, closed) = $2 in + Ppat_record(fields, closed) } + | HASHLBRACE record_pat_content RBRACE + { let (fields, closed) = $2 in + Ppat_record_unboxed_product(fields, closed) } + | LBRACE record_pat_content error + { unclosed "{" $loc($1) "}" $loc($3) } + | LBRACKET pattern_semi_list RBRACKET + { fst (mktailpat $loc($3) $2) } + | LBRACKET pattern_semi_list error + { unclosed "[" $loc($1) "]" $loc($3) } + | array_patterns(LBRACKETBAR, BARRBRACKET) + { Generic_array.Pattern.to_ast + "[|" "|]" + Mutable + $1 + } + | array_patterns(LBRACKETCOLON, COLONRBRACKET) + { Generic_array.Pattern.to_ast + "[:" ":]" + Immutable + $1 + } + | HASHLPAREN reversed_labeled_tuple_pattern(pattern) RPAREN + { let (closed, fields) = $2 in + Ppat_unboxed_tuple (List.rev fields, closed) } + ) { $1 } + +%inline pattern_semi_list: + ps = separated_or_terminated_nonempty_list(SEMI, pattern) + { ps } +; +(* A label-pattern list is a nonempty list of label-pattern pairs, optionally + followed with an UNDERSCORE, separated-or-terminated with semicolons. *) +%inline record_pat_content: + listx(SEMI, record_pat_field, UNDERSCORE) + { let fields, closed = $1 in + let closed = match closed with Some () -> Open | None -> Closed in + fields, closed } +; +%inline record_pat_field: + label = mkrhs(label_longident) + octy = preceded(COLON, core_type)? + opat = preceded(EQUAL, pattern)? + { let constraint_loc, label, pat = + match opat with + | None -> + (* No pattern; this is a pun. Desugar it. + But that the pattern was there and the label reconstructed (which + piece of AST is marked as ghost is important for warning + emission). *) + $sloc, make_ghost label, pat_of_label label + | Some pat -> + ($startpos(octy), $endpos), label, pat + in + label, mkpat_with_modes ~loc:constraint_loc ~modes:[] ~pat ~cty:octy + } +; + +/* Value descriptions */ + +value_description: + VAL + ext = ext + attrs1 = attributes + id = mkrhs(val_ident) + COLON + ty = possibly_poly(core_type) + modalities = optional_atat_modalities_expr + attrs2 = post_item_attributes + { let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + Val.mk id ty ~attrs ~modalities ~loc ~docs, + ext } +; + +/* Primitive declarations */ + +primitive_declaration: + EXTERNAL + ext = ext + attrs1 = attributes + id = mkrhs(val_ident) + COLON + ty = possibly_poly(core_type) + modalities = optional_atat_modalities_expr + EQUAL + prim = raw_string+ + attrs2 = post_item_attributes + { let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + Val.mk id ty ~prim ~attrs ~modalities ~loc ~docs, + ext } +; + +(* Type declarations and type substitutions. *) + +(* Type declarations [type t = u] and type substitutions [type t := u] are very + similar, so we view them as instances of [generic_type_declarations]. In the + case of a type declaration, the use of [nonrec_flag] means that [NONREC] may + be absent or present, whereas in the case of a type substitution, the use of + [no_nonrec_flag] means that [NONREC] must be absent. The use of [type_kind] + versus [type_subst_kind] means that in the first case, we expect an [EQUAL] + sign, whereas in the second case, we expect [COLONEQUAL]. *) + +%inline type_declarations: + generic_type_declarations(nonrec_flag, type_kind) + { $1 } +; + +%inline type_subst_declarations: + generic_type_declarations(no_nonrec_flag, type_subst_kind) + { $1 } +; + +(* A set of type declarations or substitutions begins with a + [generic_type_declaration] and continues with a possibly empty list of + [generic_and_type_declaration]s. *) + +%inline generic_type_declarations(flag, kind): + xlist( + generic_type_declaration(flag, kind), + generic_and_type_declaration(kind) + ) + { $1 } +; + +(* [generic_type_declaration] and [generic_and_type_declaration] look similar, + but are in reality different enough that it is difficult to share anything + between them. *) + +generic_type_declaration(flag, kind): + TYPE + ext = ext + attrs1 = attributes + flag = flag + params = type_parameters + id = mkrhs(LIDENT) + jkind_annotation = jkind_constraint? + kind_priv_manifest = kind + cstrs = constraints + attrs2 = post_item_attributes + { + let (kind, priv, manifest) = kind_priv_manifest in + let docs = symbol_docs $sloc in + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + (flag, ext), + Type.mk id ~params ~cstrs ~kind ~priv ?manifest ~attrs ~loc ~docs + ?jkind_annotation + } +; +%inline generic_and_type_declaration(kind): + AND + attrs1 = attributes + params = type_parameters + id = mkrhs(LIDENT) + jkind_annotation = jkind_constraint? + kind_priv_manifest = kind + cstrs = constraints + attrs2 = post_item_attributes + { + let (kind, priv, manifest) = kind_priv_manifest in + let docs = symbol_docs $sloc in + let attrs = attrs1 @ attrs2 in + let loc = make_loc $sloc in + let text = symbol_text $symbolstartpos in + Type.mk id ~params ~cstrs ~kind ~priv ?manifest ~attrs ~loc ~docs ~text + ?jkind_annotation + } +; +%inline constraints: + llist(preceded(CONSTRAINT, constrain)) + { $1 } +; +(* Lots of %inline expansion are required for [nonempty_type_kind] to be + LR(1). At the cost of some manual expansion, it would be possible to give a + definition that leads to a smaller grammar (after expansion) and therefore + a smaller automaton. *) +nonempty_type_kind: + | priv = inline_private_flag + ty = core_type + { (Ptype_abstract, priv, Some ty) } + | oty = type_synonym + priv = inline_private_flag + cs = constructor_declarations + { (Ptype_variant cs, priv, oty) } + | oty = type_synonym + priv = inline_private_flag + DOTDOT + { (Ptype_open, priv, oty) } + | oty = type_synonym + priv = inline_private_flag + LBRACE ls = label_declarations RBRACE + { (Ptype_record ls, priv, oty) } + | oty = type_synonym + priv = inline_private_flag + HASHLBRACE ls = label_declarations RBRACE + { (Ptype_record_unboxed_product ls, priv, oty) } +; +%inline type_synonym: + ioption(terminated(core_type, EQUAL)) + { $1 } +; +type_kind: + /*empty*/ + { (Ptype_abstract, Public, None) } + | EQUAL nonempty_type_kind + { $2 } +; +%inline type_subst_kind: + COLONEQUAL nonempty_type_kind + { $2 } +; +type_parameters: + /* empty */ + { [] } + | p = type_parameter + { [p] } + | LPAREN + ps = separated_nonempty_llist(COMMA, parenthesized_type_parameter) + RPAREN + { ps } +; + +jkind_desc: + jkind_annotation MOD mkrhs(LIDENT)+ { (* LIDENTs here are for modes *) + let modes = + List.map + (fun {txt; loc} -> {txt = Mode txt; loc}) + $3 + in + Mod ($1, modes) + } + | jkind_annotation WITH core_type optional_atat_modalities_expr { + With ($1, $3, $4) + } + | ident { + Abbreviation $1 + } + | KIND_OF ty=core_type { + Kind_of ty + } + | UNDERSCORE { + Default + } + | reverse_product_jkind %prec below_AMPERSAND { + Product (List.rev $1) + } + | LPAREN jkind_desc RPAREN { + $2 + } +; + +reverse_product_jkind : + | jkind1 = jkind_annotation AMPERSAND jkind2 = jkind_annotation %prec prec_unboxed_product_kind + { [jkind2; jkind1] } + | jkinds = reverse_product_jkind + AMPERSAND + jkind = jkind_annotation %prec prec_unboxed_product_kind + { jkind :: jkinds } + +jkind_annotation: (* : jkind_annotation *) + jkind_desc { { pjkind_loc = make_loc $sloc; pjkind_desc = $1 } } +; + +jkind_constraint: + COLON jkind_annotation { $2 } +; + +kind_abbreviation_decl: + KIND_ABBREV abbrev=mkrhs(LIDENT) EQUAL jkind=jkind_annotation { + (abbrev, jkind) + } +; + +%inline type_param_with_jkind: + name=tyvar_name_or_underscore + attrs=attributes + COLON + jkind=jkind_annotation + { match name with + | None -> mktyp ~loc:$sloc ~attrs (Ptyp_any (Some jkind)) + | Some name -> mktyp ~loc:$sloc ~attrs (Ptyp_var (name, Some jkind)) } +; + +parenthesized_type_parameter: + type_parameter { $1 } + | type_variance type_param_with_jkind + { $2, $1 } +; + +type_parameter: + type_variance type_variable attributes + { {$2 with ptyp_attributes = $3}, $1 } +; + +%inline type_variable: + mktyp( + QUOTE tyvar = ident + { Ptyp_var (tyvar, None) } + | UNDERSCORE + { Ptyp_any None } + ) { $1 } +; + +%inline tyvar_name_or_underscore: + QUOTE ident + { Some $2 } + | UNDERSCORE + { None } +; + +type_variance: + /* empty */ { NoVariance, NoInjectivity } + | PLUS { Covariant, NoInjectivity } + | MINUS { Contravariant, NoInjectivity } + | BANG { NoVariance, Injective } + | PLUS BANG | BANG PLUS { Covariant, Injective } + | MINUS BANG | BANG MINUS { Contravariant, Injective } + | INFIXOP2 + { if $1 = "+!" then Covariant, Injective else + if $1 = "-!" then Contravariant, Injective else + expecting $loc($1) "type_variance" } + | PREFIXOP + { if $1 = "!+" then Covariant, Injective else + if $1 = "!-" then Contravariant, Injective else + expecting $loc($1) "type_variance" } +; + +(* A sequence of constructor declarations is either a single BAR, which + means that the list is empty, or a nonempty BAR-separated list of + declarations, with an optional leading BAR. *) +constructor_declarations: + | BAR + { [] } + | cs = bar_llist(constructor_declaration) + { cs } +; +(* A constructor declaration begins with an opening symbol, which can + be either epsilon or BAR. Note that this opening symbol is included + in the footprint $sloc. *) +(* Because [constructor_declaration] and [extension_constructor_declaration] + are identical except for their semantic actions, we introduce the symbol + [generic_constructor_declaration], whose semantic action is neutral -- it + merely returns a tuple. *) +generic_constructor_declaration(opening): + opening + cid = mkrhs(constr_ident) + vars_args_res = generalized_constructor_arguments + attrs = attributes + { + let vars, args, res = vars_args_res in + let info = symbol_info $endpos in + let loc = make_loc $sloc in + cid, vars, args, res, attrs, loc, info + } +; +%inline constructor_declaration(opening): + d = generic_constructor_declaration(opening) + { + let cid, vars, args, res, attrs, loc, info = d in + Type.constructor cid ~vars ~args ?res ~attrs ~loc ~info + } +; +str_exception_declaration: + sig_exception_declaration + { $1 } +| EXCEPTION + ext = ext + attrs1 = attributes + id = mkrhs(constr_ident) + EQUAL + lid = mkrhs(constr_longident) + attrs2 = attributes + attrs = post_item_attributes + { let loc = make_loc $sloc in + let docs = symbol_docs $sloc in + Te.mk_exception ~attrs + (Te.rebind id lid ~attrs:(attrs1 @ attrs2) ~loc ~docs) + , ext } +; +sig_exception_declaration: + EXCEPTION + ext = ext + attrs1 = attributes + id = mkrhs(constr_ident) + vars_args_res = generalized_constructor_arguments + attrs2 = attributes + attrs = post_item_attributes + { let vars, args, res = vars_args_res in + let loc = make_loc ($startpos, $endpos(attrs2)) in + let docs = symbol_docs $sloc in + Te.mk_exception ~attrs + (Te.decl id ~vars ~args ?res ~attrs:(attrs1 @ attrs2) ~loc ~docs) + , ext } +; +%inline let_exception_declaration: + mkrhs(constr_ident) generalized_constructor_arguments attributes + { let vars, args, res = $2 in + Te.decl $1 ~vars ~args ?res ~attrs:$3 ~loc:(make_loc $sloc) } +; + +generalized_constructor_arguments: + /*empty*/ { ([],Pcstr_tuple [],None) } + | OF constructor_arguments { ([],$2,None) } + | COLON constructor_arguments MINUSGREATER atomic_type %prec below_HASH + { ([],$2,Some $4) } + | COLON typevar_list DOT constructor_arguments MINUSGREATER atomic_type + %prec below_HASH + { ($2,$4,Some $6) } + | COLON atomic_type %prec below_HASH + { ([],Pcstr_tuple [],Some $2) } + | COLON typevar_list DOT atomic_type %prec below_HASH + { ($2,Pcstr_tuple [],Some $4) } +; + +%inline constructor_argument: + gbl=global_flag cty=atomic_type m1=optional_atat_modalities_expr { + let modalities = gbl @ m1 in + Type.constructor_arg cty ~modalities ~loc:(make_loc $sloc) + } +; + +constructor_arguments: + | tys = inline_separated_nonempty_llist(STAR, constructor_argument) + { Pcstr_tuple tys } + | LBRACE label_declarations RBRACE + { Pcstr_record $2 } +; +label_declarations: + label_declaration { [$1] } + | label_declaration_semi { [$1] } + | label_declaration_semi label_declarations { $1 :: $2 } +; +label_declaration: + mutable_or_global_flag mkrhs(label) COLON poly_type_no_attr m1=optional_atat_modalities_expr attrs=attributes + { let info = symbol_info $endpos in + let mut, m0 = $1 in + let modalities = m0 @ m1 in + Type.field $2 $4 ~mut ~modalities ~attrs ~loc:(make_loc $sloc) ~info} +; +label_declaration_semi: + mutable_or_global_flag mkrhs(label) COLON poly_type_no_attr m1=optional_atat_modalities_expr attrs0=attributes + SEMI attrs1=attributes + { let info = + match rhs_info $endpos(attrs0) with + | Some _ as info_before_semi -> info_before_semi + | None -> symbol_info $endpos + in + let mut, m0 = $1 in + let modalities = m0 @ m1 in + Type.field $2 $4 ~mut ~modalities ~attrs:(attrs0 @ attrs1) ~loc:(make_loc $sloc) ~info} +; + +/* Type Extensions */ + +%inline str_type_extension: + type_extension(extension_constructor) + { $1 } +; +%inline sig_type_extension: + type_extension(extension_constructor_declaration) + { $1 } +; +%inline type_extension(declaration): + TYPE + ext = ext + attrs1 = attributes + no_nonrec_flag + params = type_parameters + tid = mkrhs(type_longident) + PLUSEQ + priv = private_flag + cs = bar_llist(declaration) + attrs2 = post_item_attributes + { let docs = symbol_docs $sloc in + let attrs = attrs1 @ attrs2 in + Te.mk tid cs ~params ~priv ~attrs ~docs, + ext } +; +%inline extension_constructor(opening): + extension_constructor_declaration(opening) + { $1 } + | extension_constructor_rebind(opening) + { $1 } +; +%inline extension_constructor_declaration(opening): + d = generic_constructor_declaration(opening) + { + let name, vars, args, res, attrs, loc, info = d in + Te.decl name ~vars ~args ?res ~attrs ~loc ~info + } +; +extension_constructor_rebind(opening): + opening + cid = mkrhs(constr_ident) + EQUAL + lid = mkrhs(constr_longident) + attrs = attributes + { let info = symbol_info $endpos in + Te.rebind cid lid ~attrs ~loc:(make_loc $sloc) ~info } +; + +/* "with" constraints (additional type equations over signature components) */ + +with_constraint: + TYPE type_parameters mkrhs(label_longident) with_type_binder + core_type_no_attr constraints + { let lident = loc_last $3 in + Pwith_type + ($3, + (Type.mk lident + ~params:$2 + ~cstrs:$6 + ~manifest:$5 + ~priv:$4 + ~loc:(make_loc $sloc))) } + /* used label_longident instead of type_longident to disallow + functor applications in type path */ + | TYPE type_parameters mkrhs(label_longident) + COLONEQUAL core_type_no_attr + { let lident = loc_last $3 in + Pwith_typesubst + ($3, + (Type.mk lident + ~params:$2 + ~manifest:$5 + ~loc:(make_loc $sloc))) } + | MODULE mkrhs(mod_longident) EQUAL mkrhs(mod_ext_longident) + { Pwith_module ($2, $4) } + | MODULE mkrhs(mod_longident) COLONEQUAL mkrhs(mod_ext_longident) + { Pwith_modsubst ($2, $4) } + | MODULE TYPE l=mkrhs(mty_longident) EQUAL rhs=module_type + { Pwith_modtype (l, rhs) } + | MODULE TYPE l=mkrhs(mty_longident) COLONEQUAL rhs=module_type + { Pwith_modtypesubst (l, rhs) } +; +with_type_binder: + EQUAL { Public } + | EQUAL PRIVATE { Private } +; + +/* Polymorphic types */ + +%inline typevar: (* : string with_loc * jkind_annotation option *) + QUOTE mkrhs(ident) + { ($2, None) } + | LPAREN QUOTE tyvar=mkrhs(ident) COLON jkind=jkind_annotation RPAREN + { (tyvar, Some jkind) } +; +%inline typevar_list: + (* : (string with_loc * jkind_annotation option) list *) + nonempty_llist(typevar) + { $1 } +; +%inline poly(X): + typevar_list DOT X + { ($1, $3) } +; +%inline strictly_poly(X): +| poly(X) + { let bound_vars, inner_type = $1 in + mktyp ~loc:$sloc (Ptyp_poly (bound_vars, inner_type)) } +; + +possibly_poly(X): + X + { $1 } +| strictly_poly(X) + { $1 } +; +%inline poly_type: + possibly_poly(core_type) + { $1 } +; + +%inline strictly_poly_type: + strictly_poly(core_type) + { $1 } +; + +%inline strictly_poly_tuple_type: + strictly_poly(tuple_type) + { $1 } + +%inline poly_tuple_type: + | tuple_type { $1 } + | strictly_poly_tuple_type { $1 } +; + +%inline poly_type_with_modes: + | poly_tuple_type at_mode_expr { $1, $2 } +; + +%inline poly_type_with_optional_modes: + | poly_type_with_modes { $1 } + | poly_type { $1, [] } +; + +%inline strictly_poly_type_with_optional_modes: + | strictly_poly_type { $1, [] } + | strictly_poly_tuple_type at_mode_expr { $1, $2 } +; + +%inline poly_type_no_attr: + possibly_poly(core_type_no_attr) + { $1 } +; + +(* -------------------------------------------------------------------------- *) + +(* Core language types. *) + +(* A core type (core_type) is a core type without attributes (core_type_no_attr) + followed with a list of attributes. *) +core_type: + core_type_no_attr + { $1 } + | core_type attribute + { Typ.attr $1 $2 } +; + +%inline core_type_with_optional_modes: + core_type { $1, [] } + | tuple_type at_mode_expr { $1, $2 } + +(* A core type without attributes is currently defined as an alias type, but + this could change in the future if new forms of types are introduced. From + the outside, one should use core_type_no_attr. *) +%inline core_type_no_attr: + alias_type + { $1 } +; + +(* Alias types include: + - function types (see below); + - proper alias types: 'a -> int as 'a + *) +alias_type: + function_type + { $1 } + | mktyp( + ty = alias_type AS QUOTE tyvar = mkrhs(ident) + { Ptyp_alias(ty, Some tyvar, None) } + ) + { $1 } + | aliased_type = alias_type AS + LPAREN + name = mkrhs(tyvar_name_or_underscore) + COLON + jkind = jkind_annotation + RPAREN + { let name = Option.map (fun x -> mkloc x name.loc) name.txt in + mktyp ~loc:$sloc (Ptyp_alias (aliased_type, name, Some jkind)) } +; + +(* Function types include: + - tuple types (see below); + - proper function types: int -> int + foo: int -> int + ?foo: int -> int + *) +function_type: + | ty = tuple_type + %prec MINUSGREATER + { ty } + | ty = strict_function_or_labeled_tuple_type + { ty } +; + +strict_function_or_labeled_tuple_type: + | mktyp( + label = arg_label + domain_with_modes = with_optional_mode_expr(extra_rhs(param_type)) + MINUSGREATER + codomain = strict_function_or_labeled_tuple_type + { let (domain, (_ : Lexing.position * Lexing.position)), arg_modes = domain_with_modes in + Ptyp_arrow(label, domain , codomain, arg_modes, []) } + ) + { $1 } + | mktyp( + label = arg_label + domain_with_modes = with_optional_mode_expr(extra_rhs(param_type)) + MINUSGREATER + codomain_with_modes = with_optional_mode_expr(tuple_type) + %prec MINUSGREATER + { let (domain, (_ : Lexing.position * Lexing.position)), arg_modes = domain_with_modes in + let (codomain, codomain_loc), ret_modes = codomain_with_modes in + Ptyp_arrow(label, + domain, + maybe_curry_typ codomain codomain_loc, arg_modes, ret_modes) } + ) + { $1 } + (* These next three cases are for labled tuples - see comment on [tuple_type] + below. + + The first two cases are present just to resolve a shift reduce conflict + in a module type [S with t := x:t1 * t2 -> ...] which might be the + beginning of + [S with t := x:t1 * t2 -> S'] or [S with t := x:t1 * t2 -> t3] + They are the same as the previous two cases, but with [arg_label] replaced + with the more specific [LIDENT COLON] and [param_type] replaced with the + more specific [proper_tuple_type]. Apparently, this is sufficient for + menhir to be able to delay a decision about which of the above module type + cases we are in. *) + | mktyp( + label = LIDENT COLON + tuple_with_modes = with_optional_mode_expr(proper_tuple_type) + MINUSGREATER + codomain = strict_function_or_labeled_tuple_type + { + let (tuple, tuple_loc), arg_modes = tuple_with_modes in + let ty, ltys = tuple in + let label = Labelled label in + let domain = mktyp ~loc:tuple_loc (Ptyp_tuple ((None, ty) :: ltys)) in + let domain = extra_rhs_core_type domain ~pos:(snd tuple_loc) in + Ptyp_arrow(label, domain, codomain, arg_modes, []) } + ) + { $1 } + | mktyp( + label = LIDENT COLON + tuple_with_modes = with_optional_mode_expr(proper_tuple_type) + MINUSGREATER + codomain_with_modes = with_optional_mode_expr(tuple_type) + %prec MINUSGREATER + { let (tuple, tuple_loc), arg_modes = tuple_with_modes in + let (codomain, codomain_loc), ret_modes = codomain_with_modes in + let ty, ltys = tuple in + let label = Labelled label in + let domain = mktyp ~loc:tuple_loc (Ptyp_tuple ((None, ty) :: ltys)) in + let domain = extra_rhs_core_type domain ~pos:(snd tuple_loc) in + Ptyp_arrow(label, + domain , + maybe_curry_typ codomain codomain_loc, + arg_modes, + ret_modes) + } + ) + { $1 } + | label = LIDENT COLON proper_tuple_type %prec MINUSGREATER + { let ty, ltys = $3 in + mktyp ~loc:$sloc (Ptyp_tuple ((Some label, ty) :: ltys)) + } +; + +%inline strict_arg_label: + | label = optlabel + { Optional label } + | label = LIDENT COLON + { Labelled label } +; + +%inline arg_label: + | strict_arg_label + { $1 } + | /* empty */ + { Nolabel } +; +/* Legacy mode annotations */ +%inline mode_legacy: + | LOCAL + { mkloc (Mode "local") (make_loc $sloc) } + | UNIQUE + { mkloc (Mode "unique") (make_loc $sloc) } + | ONCE + { mkloc (Mode "once") (make_loc $sloc) } +; + +%inline mode_expr_legacy: + | mode_legacy+ { $1 } +; + +%inline optional_mode_expr_legacy: + | { [] } + | mode_expr_legacy {$1} +; + +/* New mode annotation, introduced by AT or ATAT */ +%inline mode: + | LIDENT { mkloc (Mode $1) (make_loc $sloc) } +; + +%inline mode_expr: + | mode+ { $1 } +; + +at_mode_expr: + | AT mode_expr {$2} + | AT error { expecting $loc($2) "mode expression" } +; + +%inline optional_at_mode_expr: + | { [] } + | at_mode_expr {$1} +; + +%inline with_optional_mode_expr(ty): + | m0=optional_mode_expr_legacy ty=ty m1=optional_at_mode_expr { + let m = m0 @ m1 in + (ty, $loc(ty)), m + } +; + + +/* Modalities */ + +%inline modality: + | LIDENT { mkloc (Modality $1) (make_loc $sloc) } + +%inline modalities: + | modality+ { $1 } + +atat_modalities_expr: + | ATAT modalities {$2} + | ATAT error { expecting $loc($2) "modality expression" } +; + +optional_atat_modalities_expr: + | %prec below_HASH + { [] } + | atat_modalities_expr + { $1 } +; + +%inline stack(expr): + | STACK expr { mkexp ~loc:$sloc (Pexp_stack $2) } + +%inline maybe_stack(expr): + | expr { $1 } + | stack(expr) { $1 } + +%inline param_type: + | mktyp( + LPAREN bound_vars = typevar_list DOT inner_type = core_type RPAREN + { Ptyp_poly (bound_vars, inner_type) } + ) + { $1 } + | ty = tuple_type + { ty } +; + +(* Tuple types include: + - atomic types (see below); + - proper tuple types: int * int * int list + A proper tuple type is a star-separated list of at least two atomic types. + Tuple components can also be labeled, as an [int * int list * y:bool]. + + However, the special case of labeled tuples where the first element has a + label is not parsed as a proper_tuple_type, but rather as a case of + strict_function_or_labled_tuple_type above. This helps in dealing with + ambiguities around [x:t1 * t2 -> t3] which must continue to parse as a + function with one labeled argument even in the presense of labled tuples. +*) +tuple_type: + | ty = atomic_type + %prec below_HASH + { ty } + | proper_tuple_type %prec below_FUNCTOR + { let ty, ltys = $1 in + mktyp ~loc:$sloc (Ptyp_tuple ((None, ty) :: ltys)) + } +; + +%inline proper_tuple_type: + | ty = atomic_type + STAR + ltys = separated_nonempty_llist(STAR, labeled_tuple_typ_element) + { ty, ltys } + +(* In the case of an unboxed tuple, we don't need the nonsense above because + the [#( ... )] disambiguates. However, we still must write out + the first element explicitly because [labeled_tuple_typ_element] is + restricted to tail position by its %prec annotation. *) +%inline unboxed_tuple_type_body: + | ty1 = atomic_type + STAR + ltys = separated_nonempty_llist(STAR, labeled_tuple_typ_element) + { (None, ty1) :: ltys } + | label = LIDENT + COLON + ty1 = atomic_type + STAR + ltys = separated_nonempty_llist(STAR, labeled_tuple_typ_element) + { (Some label, ty1) :: ltys } + +%inline labeled_tuple_typ_element : + | atomic_type %prec STAR + { None, $1 } + | label = LIDENT COLON ty = atomic_type %prec STAR + { Some label, ty } + +(* Atomic types are the most basic level in the syntax of types. + Atomic types include: + - types between parentheses: (int -> int) + - first-class module types: (module S) + - type variables: 'a + - applications of type constructors: int, int list, int option list + - variant types: [`A] + *) + + +(* + Delimited types: + - parenthesised type (type) + - first-class module types (module S) + - object types < x: t; ... > + - variant types [ `A ] + - extension [%foo ...] + + We support local opens on the following classes of types: + - parenthesised + - first-class module types + - variant types + + Object types are not support for local opens due to a potential + conflict with MetaOCaml syntax: + M.< x: t, y: t > + and quoted expressions: + .< e >. + + Extension types are not support for local opens merely as a precaution. +*) +delimited_type_supporting_local_open: + | LPAREN type_ = core_type RPAREN + { type_ } + | LPAREN MODULE attrs = ext_attributes package_type = package_type RPAREN + { wrap_typ_attrs ~loc:$sloc (reloc_typ ~loc:$sloc package_type) attrs } + | mktyp( + LBRACKET field = tag_field RBRACKET + { Ptyp_variant([ field ], Closed, None) } + | LBRACKET BAR fields = row_field_list RBRACKET + { Ptyp_variant(fields, Closed, None) } + | LBRACKET field = row_field BAR fields = row_field_list RBRACKET + { Ptyp_variant(field :: fields, Closed, None) } + | LBRACKETGREATER BAR? fields = row_field_list RBRACKET + { Ptyp_variant(fields, Open, None) } + | LBRACKETGREATER RBRACKET + { Ptyp_variant([], Open, None) } + | LBRACKETLESS BAR? fields = row_field_list RBRACKET + { Ptyp_variant(fields, Closed, Some []) } + | LBRACKETLESS BAR? fields = row_field_list + GREATER + tags = name_tag_list + RBRACKET + { Ptyp_variant(fields, Closed, Some tags) } + | HASHLPAREN unboxed_tuple_type_body RPAREN + { Ptyp_unboxed_tuple $2 } + ) + { $1 } +; + +object_type: + | mktyp( + LESS meth_list = meth_list GREATER + { let (f, c) = meth_list in Ptyp_object (f, c) } + | LESS GREATER + { Ptyp_object ([], Closed) } + ) + { $1 } +; + +extension_type: + | mktyp ( + ext = extension + { Ptyp_extension ext } + ) + { $1 } +; + +delimited_type: + | object_type + | extension_type + | delimited_type_supporting_local_open + { $1 } +; + +atomic_type: + | type_ = delimited_type + { type_ } + | mktyp( /* begin mktyp group */ + tys = actual_type_parameters + tid = mkrhs(type_longident) + { Ptyp_constr (tid, tys) } + | tys = actual_type_parameters + tid = mkrhs(type_unboxed_longident) + { unboxed_type $loc(tid) tid.txt tys } + | tys = actual_type_parameters + HASH + cid = mkrhs(clty_longident) + { Ptyp_class (cid, tys) } + | mod_ident = mkrhs(mod_ext_longident) + DOT + type_ = delimited_type_supporting_local_open + { Ptyp_open (mod_ident, type_) } + | QUOTE ident = ident + { Ptyp_var (ident, None) } + | UNDERSCORE + { Ptyp_any None } + ) + { $1 } /* end mktyp group */ + | LPAREN QUOTE name=ident COLON jkind=jkind_annotation RPAREN + { mktyp ~loc:$sloc (Ptyp_var (name, Some jkind)) } + | LPAREN UNDERSCORE COLON jkind=jkind_annotation RPAREN + { mktyp ~loc:$sloc (Ptyp_any (Some jkind)) } + | LPAREN TYPE COLON jkind=jkind_annotation RPAREN + { mktyp ~loc:$loc (Ptyp_of_kind jkind) } + | LESSLBRACKET core_type RBRACKETGREATER + { quotation_reserved "<[" $loc($1) } + | LESSLBRACKET core_type error + { unclosed "<[" $loc($1) "]>" $loc($3) } + | DOLLAR error + { quotation_reserved "$" $loc($1) } + + +(* This is the syntax of the actual type parameters in an application of + a type constructor, such as int, int list, or (int, bool) Hashtbl.t. + We allow one of the following: + - zero parameters; + - one parameter: + an atomic type; + among other things, this can be an arbitrary type between parentheses; + - two or more parameters: + arbitrary types, between parentheses, separated with commas. + *) +%inline actual_type_parameters: + | /* empty */ + { [] } + | ty = atomic_type + { [ ty ] } + | LPAREN + tys = separated_nontrivial_llist(COMMA, one_type_parameter_of_several) + RPAREN + { tys } + +(* Layout annotations on type expressions typically require parens, as in [('a : + float64)]. But this is unnecessary when the type expression is used as the + parameter of a tconstr with more than one argument, as in [(int, 'b : + float64) t]. *) +%inline one_type_parameter_of_several: + | core_type { $1 } + | QUOTE id=ident COLON jkind=jkind_annotation + { mktyp ~loc:$sloc (Ptyp_var (id, (Some jkind))) } + | UNDERSCORE COLON jkind=jkind_annotation + { mktyp ~loc:$sloc (Ptyp_any (Some jkind)) } + +%inline package_type: module_type + { let (lid, cstrs, attrs) = package_type_of_module_type $1 in + let descr = Ptyp_package (lid, cstrs) in + mktyp ~loc:$sloc ~attrs descr } +; +%inline row_field_list: + separated_nonempty_llist(BAR, row_field) + { $1 } +; +row_field: + tag_field + { $1 } + | core_type + { Rf.inherit_ ~loc:(make_loc $sloc) $1 } +; +tag_field: + mkrhs(name_tag) OF opt_ampersand amper_type_list attributes + { let info = symbol_info $endpos in + let attrs = add_info_attrs info $5 in + Rf.tag ~loc:(make_loc $sloc) ~attrs $1 $3 $4 } + | mkrhs(name_tag) attributes + { let info = symbol_info $endpos in + let attrs = add_info_attrs info $2 in + Rf.tag ~loc:(make_loc $sloc) ~attrs $1 true [] } +; +opt_ampersand: + AMPERSAND { true } + | /* empty */ { false } +; +%inline amper_type_list: + separated_nonempty_llist(AMPERSAND, core_type_no_attr) + { $1 } +; +%inline name_tag_list: + nonempty_llist(name_tag) + { $1 } +; +(* A method list (in an object type). *) +meth_list: + head = field_semi tail = meth_list + | head = inherit_field SEMI tail = meth_list + { let (f, c) = tail in (head :: f, c) } + | head = field_semi + | head = inherit_field SEMI + { [head], Closed } + | head = field + | head = inherit_field + { [head], Closed } + | DOTDOT + { [], Open } +; +%inline field: + mkrhs(label) COLON poly_type_no_attr attributes + { let info = symbol_info $endpos in + let attrs = add_info_attrs info $4 in + Of.tag ~loc:(make_loc $sloc) ~attrs $1 $3 } +; + +%inline field_semi: + mkrhs(label) COLON poly_type_no_attr attributes SEMI attributes + { let info = + match rhs_info $endpos($4) with + | Some _ as info_before_semi -> info_before_semi + | None -> symbol_info $endpos + in + let attrs = add_info_attrs info ($4 @ $6) in + Of.tag ~loc:(make_loc $sloc) ~attrs $1 $3 } +; + +%inline inherit_field: + ty = atomic_type + { Of.inherit_ ~loc:(make_loc $sloc) ty } +; + +%inline label: + LIDENT { $1 } +; + +/* Constants */ + +value_constant: + | INT { let (n, m) = $1 in Pconst_integer (n, m) } + | CHAR { Pconst_char $1 } + | STRING { let (s, strloc, d) = $1 in + Pconst_string (s, strloc, d) } + | FLOAT { let (f, m) = $1 in Pconst_float (f, m) } +; +unboxed_constant: + | HASH_INT { unboxed_int $sloc $sloc Positive $1 } + | HASH_FLOAT { unboxed_float Positive $1 } +; +constant: + value_constant { $1 } + | unboxed_constant { $1 } +; +signed_value_constant: + value_constant { $1 } + | MINUS INT { let (n, m) = $2 in Pconst_integer("-" ^ n, m) } + | MINUS FLOAT { let (f, m) = $2 in Pconst_float("-" ^ f, m) } + | PLUS INT { let (n, m) = $2 in Pconst_integer (n, m) } + | PLUS FLOAT { let (f, m) = $2 in Pconst_float(f, m) } +; +signed_constant: + signed_value_constant { $1 } + | unboxed_constant { $1 } + | MINUS HASH_INT { unboxed_int $sloc $loc($2) Negative $2 } + | MINUS HASH_FLOAT { unboxed_float Negative $2 } + | PLUS HASH_INT { unboxed_int $sloc $loc($2) Positive $2 } + | PLUS HASH_FLOAT { unboxed_float Positive $2 } +; + +/* Identifiers and long identifiers */ + +ident: + UIDENT { $1 } + | LIDENT { $1 } +; +val_extra_ident: + | LPAREN operator RPAREN { $2 } + | LPAREN operator error { unclosed "(" $loc($1) ")" $loc($3) } + | LPAREN error { expecting $loc($2) "operator" } + | LPAREN MODULE error { expecting $loc($3) "module-expr" } +; +val_ident: + LIDENT { $1 } + | val_extra_ident { $1 } +; +operator: + PREFIXOP { $1 } + | LETOP { $1 } + | ANDOP { $1 } + | DOTOP LPAREN index_mod RPAREN { "."^ $1 ^"(" ^ $3 ^ ")" } + | DOTOP LPAREN index_mod RPAREN LESSMINUS { "."^ $1 ^ "(" ^ $3 ^ ")<-" } + | DOTOP LBRACKET index_mod RBRACKET { "."^ $1 ^"[" ^ $3 ^ "]" } + | DOTOP LBRACKET index_mod RBRACKET LESSMINUS { "."^ $1 ^ "[" ^ $3 ^ "]<-" } + | DOTOP LBRACE index_mod RBRACE { "."^ $1 ^"{" ^ $3 ^ "}" } + | DOTOP LBRACE index_mod RBRACE LESSMINUS { "."^ $1 ^ "{" ^ $3 ^ "}<-" } + | HASHOP { $1 } + | BANG { "!" } + | infix_operator { $1 } +; +%inline infixop3: + | op = INFIXOP3 { op } + | MOD { "mod" } +; +%inline infix_operator: + | op = INFIXOP0 { op } + /* Still support the two symbols as infix operators */ + | AT {"@"} + | ATAT {"@@"} + | op = INFIXOP1 { op } + | op = INFIXOP2 { op } + | op = infixop3 { op } + | op = INFIXOP4 { op } + | PLUS {"+"} + | PLUSDOT {"+."} + | PLUSEQ {"+="} + | MINUS {"-"} + | MINUSDOT {"-."} + | STAR {"*"} + | PERCENT {"%"} + | EQUAL {"="} + | LESS {"<"} + | GREATER {">"} + | OR {"or"} + | BARBAR {"||"} + | AMPERSAND {"&"} + | AMPERAMPER {"&&"} + | COLONEQUAL {":="} +; +index_mod: +| { "" } +| SEMI DOTDOT { ";.." } +; + +%inline constr_extra_ident: + | LPAREN COLONCOLON RPAREN { "::" } +; +constr_extra_nonprefix_ident: + | LBRACKET RBRACKET { "[]" } + | LPAREN RPAREN { "()" } + | FALSE { "false" } + | TRUE { "true" } +; +constr_ident: + UIDENT { $1 } + | constr_extra_ident { $1 } + | constr_extra_nonprefix_ident { $1 } +; +constr_longident: + mod_longident %prec below_DOT { $1 } /* A.B.x vs (A).B.x */ + | mod_longident DOT constr_extra_ident { Ldot($1,$3) } + | constr_extra_ident { Lident $1 } + | constr_extra_nonprefix_ident { Lident $1 } +; +mk_longident(prefix,final): + | final { Lident $1 } + | prefix DOT final { Ldot($1,$3) } +; +val_longident: + mk_longident(mod_longident, val_ident) { $1 } +; +label_longident: + mk_longident(mod_longident, LIDENT) { $1 } +; +type_trailing_no_hash: + LIDENT { $1 } %prec below_HASH +; +type_trailing_hash: + LIDENT HASH_SUFFIX { $1 ^ "#" } +; +type_longident: + mk_longident(mod_ext_longident, type_trailing_no_hash) { $1 } +; +type_unboxed_longident: + mk_longident(mod_ext_longident, type_trailing_hash) { $1 } +; + +mod_longident: + mk_longident(mod_longident, UIDENT) { $1 } +; +mod_ext_longident: + mk_longident(mod_ext_longident, UIDENT) { $1 } + | mod_ext_longident LPAREN mod_ext_longident RPAREN + { lapply ~loc:$sloc $1 $3 } + | mod_ext_longident LPAREN error + { expecting $loc($3) "module path" } +; +mty_longident: + mk_longident(mod_ext_longident,ident) { $1 } +; +clty_longident: + mk_longident(mod_ext_longident,LIDENT) { $1 } +; +class_longident: + mk_longident(mod_longident,LIDENT) { $1 } +; + +/* BEGIN AVOID */ +/* For compiler-libs: parse all valid longidents and a little more: + final identifiers which are value specific are accepted even when + the path prefix is only valid for types: (e.g. F(X).(::)) */ +any_longident: + | mk_longident (mod_ext_longident, + ident | constr_extra_ident | val_extra_ident { $1 } + ) { $1 } + | constr_extra_nonprefix_ident { Lident $1 } +; +/* END AVOID */ + +/* Toplevel directives */ + +toplevel_directive: + hash dir = mkrhs(ident) + arg = ioption(mk_directive_arg(toplevel_directive_argument)) + { mk_directive ~loc:$sloc dir arg } +; + +%inline toplevel_directive_argument: + | STRING { let (s, _, _) = $1 in Pdir_string s } + | INT { let (n, m) = $1 in Pdir_int (n ,m) } + | val_longident { Pdir_ident $1 } + | mod_longident { Pdir_ident $1 } + | FALSE { Pdir_bool false } + | TRUE { Pdir_bool true } +; + +/* Miscellaneous */ + +(* The symbol epsilon can be used instead of an /* empty */ comment. *) +%inline epsilon: + /* empty */ + { () } +; + +%inline raw_string: + s = STRING + { let body, _, _ = s in body } +; + +name_tag: + BACKQUOTE ident { $2 } +; +rec_flag: + /* empty */ { Nonrecursive } + | REC { Recursive } +; +%inline nonrec_flag: + /* empty */ { Recursive } + | NONREC { Nonrecursive } +; +%inline no_nonrec_flag: + /* empty */ { Recursive } +/* BEGIN AVOID */ + | NONREC { not_expecting $loc "nonrec flag" } +/* END AVOID */ +; +direction_flag: + TO { Upto } + | DOWNTO { Downto } +; +private_flag: + inline_private_flag + { $1 } +; +%inline inline_private_flag: + /* empty */ { Public } + | PRIVATE { Private } +; +mutable_flag: + /* empty */ { Immutable } + | MUTABLE { Mutable } +; +mutable_or_global_flag: + /* empty */ + { Immutable, [] } + | MUTABLE + { Mutable, [] } + | GLOBAL + { Immutable, [ mkloc (Modality "global") (make_loc $sloc)] } +; +%inline global_flag: + { [] } + | GLOBAL { [ mkloc (Modality "global") (make_loc $sloc)] } +; +virtual_flag: + /* empty */ { Concrete } + | VIRTUAL { Virtual } +; +mutable_virtual_flags: + /* empty */ + { Immutable, Concrete } + | MUTABLE + { Mutable, Concrete } + | VIRTUAL + { Immutable, Virtual } + | MUTABLE VIRTUAL + | VIRTUAL MUTABLE + { Mutable, Virtual } +; +private_virtual_flags: + /* empty */ { Public, Concrete } + | PRIVATE { Private, Concrete } + | VIRTUAL { Public, Virtual } + | PRIVATE VIRTUAL { Private, Virtual } + | VIRTUAL PRIVATE { Private, Virtual } +; +(* This nonterminal symbol indicates the definite presence of a VIRTUAL + keyword and the possible presence of a MUTABLE keyword. *) +virtual_with_mutable_flag: + | VIRTUAL { Immutable } + | MUTABLE VIRTUAL { Mutable } + | VIRTUAL MUTABLE { Mutable } +; +(* This nonterminal symbol indicates the definite presence of a VIRTUAL + keyword and the possible presence of a PRIVATE keyword. *) +virtual_with_private_flag: + | VIRTUAL { Public } + | PRIVATE VIRTUAL { Private } + | VIRTUAL PRIVATE { Private } +; +%inline no_override_flag: + /* empty */ { Fresh } +; +%inline override_flag: + /* empty */ { Fresh } + | BANG { Override } +; +subtractive: + | MINUS { "-" } + | MINUSDOT { "-." } +; +additive: + | PLUS { "+" } + | PLUSDOT { "+." } +; +optlabel: + | OPTLABEL { $1 } + | QUESTION LIDENT COLON { $2 } +; + +/* Attributes and extensions */ + +single_attr_id: + LIDENT { $1 } + | UIDENT { $1 } + | AND { "and" } + | AS { "as" } + | ASSERT { "assert" } + | BEGIN { "begin" } + | CLASS { "class" } + | CONSTRAINT { "constraint" } + | DO { "do" } + | DONE { "done" } + | DOWNTO { "downto" } + | ELSE { "else" } + | END { "end" } + | EXCEPTION { "exception" } + | EXTERNAL { "external" } + | FALSE { "false" } + | FOR { "for" } + | FUN { "fun" } + | FUNCTION { "function" } + | FUNCTOR { "functor" } + | IF { "if" } + | IN { "in" } + | INCLUDE { "include" } + | INHERIT { "inherit" } + | INITIALIZER { "initializer" } + | LAZY { "lazy" } + | LET { "let" } + | LOCAL { "local_" } + | MATCH { "match" } + | METHOD { "method" } + | MODULE { "module" } + | MUTABLE { "mutable" } + | NEW { "new" } + | NONREC { "nonrec" } + | OBJECT { "object" } + | OF { "of" } + | OPEN { "open" } + | OR { "or" } + | PRIVATE { "private" } + | REC { "rec" } + | SIG { "sig" } + | STRUCT { "struct" } + | THEN { "then" } + | TO { "to" } + | TRUE { "true" } + | TRY { "try" } + | TYPE { "type" } + | VAL { "val" } + | VIRTUAL { "virtual" } + | WHEN { "when" } + | WHILE { "while" } + | WITH { "with" } +/* mod/land/lor/lxor/lsl/lsr/asr are not supported for now */ +; + +attr_id: + mkloc( + single_attr_id { $1 } + | single_attr_id DOT attr_id { $1 ^ "." ^ $3.txt } + ) { $1 } +; +attribute: + LBRACKETAT attr_id attr_payload RBRACKET + { mk_attr ~loc:(make_loc $sloc) $2 $3 } +; +post_item_attribute: + LBRACKETATAT attr_id attr_payload RBRACKET + { mk_attr ~loc:(make_loc $sloc) $2 $3 } +; +floating_attribute: + LBRACKETATATAT attr_id attr_payload RBRACKET + { mark_symbol_docs $sloc; + mk_attr ~loc:(make_loc $sloc) $2 $3 } +; +%inline post_item_attributes: + post_item_attribute* + { $1 } +; +%inline attributes: + attribute* + { $1 } +; +ext: + | /* empty */ { None } + | PERCENT attr_id { Some $2 } +; +%inline no_ext: + | /* empty */ { None } +/* BEGIN AVOID */ + | PERCENT attr_id { not_expecting $loc "extension" } +/* END AVOID */ +; +%inline ext_attributes: + ext attributes { $1, $2 } +; +extension: + | LBRACKETPERCENT attr_id payload RBRACKET { ($2, $3) } + | QUOTED_STRING_EXPR + { mk_quotedext ~loc:$sloc $1 } +; +item_extension: + | LBRACKETPERCENTPERCENT attr_id payload RBRACKET { ($2, $3) } + | QUOTED_STRING_ITEM + { mk_quotedext ~loc:$sloc $1 } +; +payload: + structure { PStr $1 } + | COLON signature { PSig $2 } + | COLON core_type { PTyp $2 } + | QUESTION pattern { PPat ($2, None) } + | QUESTION pattern WHEN seq_expr { PPat ($2, Some $4) } +; +attr_payload: + payload + { Builtin_attributes.mark_payload_attrs_used $1; + $1 + } +; +%% diff --git a/test/fuzzer/run.sh b/test/fuzzer/run.sh new file mode 100755 index 0000000000..11a40fb65e --- /dev/null +++ b/test/fuzzer/run.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env sh + +export WITH_FUZZER=true +if dune build @fuzzer-no-regression; then + if dune build @fuzzer-update-state; then + echo "" + echo "No regressions, baseline has not changed." + else + echo '$ dune promote' + dune promote || exit 1 + echo "" + echo "There were no regressions, the baseline has been updated." + fi +else + echo "There are some regressions to fix." +fi diff --git a/test/fuzzer/state.dat b/test/fuzzer/state.dat new file mode 100644 index 0000000000..01adc35e19 --- /dev/null +++ b/test/fuzzer/state.dat @@ -0,0 +1,4107 @@ +version: OCAMLGRAMMARFUZZER0 +hash: 03c63b75ae604ded15e522e10a02223a +sentences: 490799 +valid sentences: 251417 +syntax errors: 59851 +comment errors: 715 +comments dropped: 732 +internal errors: 178818 +--- +2@-5760086105234862072 +71@-1148400086807474168 +136@8622308458672142440 +201@8132808989419077345 +266@-4934041455934046209 +331@-6927602190534068698 +396@-6438634227212481535 +461@-322324647845040615 +529@3463285931619913736 +596@35334695944191 +664@9202040205605871616 +729@-9007244238919034 +794@-3969 +859-1118 +1122@-2 +1187-1739 +1741@-682579017546599034 +1806@-1583156006509084673 +1871-1964 +1968@-6569081142268 +2033@153752141746601983 +2100@-2543686613580321152 +2165@72342684789964936 +2230@1152941845622816913 +2297@-1152921504606847100 +2362@4612952655825207312 +2440@2594082183874347012 +2528@2594073400397857796 +2601@20267297994280960 +2668@-17873660752674816 +2733@-32212254721 +2798@4503874505343255 +2878@35333087429634 +2944@162129603837035522 +3013@72057731476914304 +3090@52451054977024 +3156@4503599627370496 +3222@72057731482879648 +3290@18084771550732288 +3358@-9187308038277855584 +3432@-9220394413268656128 +3509@8033162245158686785 +3575@2199025598123 +3642@90073092059070592 +3722@-1603780608 +3787@25762244667113727 +3852@-6340927537465415680 +3917@7926086442267183984 +3985@319755574885499003 +4054@4647875347365502977 +4136@163255503708226562 +4205@2269460719239296 +4280@5769120004654501890 +4349@629874335181771008 +4414@21612551403078660 +4490@141330193843202 +4558@39582687182852 +4626@-98305 +4691-4832 +4835@-161210394663190785 +4900@4629720483024076799 +4971@72061992084480000 +5046@1243028767425824896 +5116@282578785681408 +5195@-9200853488962035712 +5270@8934068854818 +5336@-6917528984690884608 +5409@162129603837821952 +5480@1233986315652432930 +5548@-8065941984818199424 +5617@162134534408634368 +5687@-176059299356672 +5752@288942722228682734 +5820@72339224707219490 +5885@4521260608389120 +5961@-2044 +6026@2256507165116415 +6098@1157425104773193732 +6167@577674647584112640 +6246@1157425104773193732 +6315@2883467594650615808 +6381@149183955067732232 +6462@-1078604414173805440 +6527@-4314417656626138369 +6592@-9205313657603306497 +6659@4629770824335757320 +6745@5766864820406091904 +6812@144680338260492544 +6893@-8050178836366589824 +6961@-1028375164656 +7026@720575979050844159 +7095@72097176464934144 +7160@70644695826560 +7232@324259207602242562 +7302@18085042131599488 +7382@324259207602242562 +7452@18085042131599488 +7532@-8898968846647919542 +7600@2266156411886960639 +7683@324259207602242562 +7753@18085042131599488 +7833@81064810508715010 +7901@18085042131599488 +7981@324259207602242562 +8051@18085042131599488 +8132@324259207602242562 +8202@18085042131599488 +8282@324259207602242562 +8352@18085042131599488 +8433@81064810508715010 +8501@18085042131599488 +8581@324259207602242562 +8651@18085042131599488 +8732@81064810508715010 +8800@18085042131599488 +8881@324259207602242562 +8951@18085042131599488 +9032@324259207602242562 +9102@18085042131599488 +9183@81064810508715010 +9251@18085042131599488 +9332@81064810508715010 +9400@18085042131599488 +9481@324259207602242562 +9551@18085042131599488 +9632@81064810508715010 +9700@18085042131599488 +9781@81627760462136322 +9849@289358749959749760 +9916@289444271432400896 +9994@578712552656084996 +10062@1765705723044429824 +10129@3891114486848881161 +10196@-5 +10261@8131229455193473023 +10326-10462 +10464@-1146 +10529-10716 +10719@-9185091440322315386 +10790@18058447962506242 +10860@-1172736 +10925@-5156903048315928577 +10990@-36649 +11055-11143 +11145@-1146 +11210-11397 +11402@-10073725500047232 +11467-11548 +11553@1443412476698902656 +11623@2102196886210355200 +11690@-37527031 +11755@999799117276250111 +11820@-2345477 +11885-11979 +11981@-1146 +12046-12233 +12238@-4788922861141835 +12303@154250491695464303 +12369@565157571330048 +12442@324261372193964160 +12527@162129603837035522 +12596@18085042131599488 +12676@4936015732140941312 +12747@565157571330048 +12820@1297045488775757952 +12907@162129603837035522 +12976@18085042131599488 +13057@4620715207914758144 +13123@2314885412167878664 +13208@324261372193964160 +13292@162129603837035522 +13361@18085042131599488 +13442@4620715207914758144 +13508@2314885412167878664 +13593@324261372193964160 +13678@162129603837035522 +13747@18085042131599488 +13828@-8068193234876063744 +13896@144680338260492416 +13977@2310357603957375104 +14042@2314885412167878664 +14127@144191054378205312 +14199@10995250495490 +14269@648522744387936256 +14354@648522744387936256 +14440@289358749959757824 +14507@9044586955538432 +14576@-9200854038448435196 +14649@-9187202425038036958 +14736@18085042131599488 +14814@81064801918780418 +14882@18085042131599488 +14964@81064801918780418 +15032@18085042131599488 +15113@648522744387936256 +15198@326510990200407042 +15268@1157430052036575360 +15337@1374406311936 +15404@2305878341774738818 +15481@2305843047868530976 +15546@45036546029519360 +15627@-576460683583942652 +15693@-288210619306868741 +15758-15997 +15999@2305843095114088448 +16064@2305843017803629056 +16140@-9223371486494982142 +16231@2254273714868224 +16308@9017094859431936 +16386@-9222809086884577280 +16452@2305843146803642368 +16542@9017094859431936 +16620@134217728 +16688@72136758875275264 +16776@162130136341151744 +16860@8796093026308 +16940@1130315152097288 +17012@9216555065033621113 +17077@-16420 +17142@-6029313 +17207@-1643794579587073 +17272@-7746191359077253121 +17338@2159465604944784163 +17404@-8070450532247929463 +17470@-2425301657 +17535@-8502796027587493889 +17607@4611688222853005312 +17672@-8646911009002354680 +17744@289356276328042496 +17811@-1048576 +17876-17980 +17982@8796094070784 +18051@144115188151353344 +18147@1073741824 +18216@-9223372035781033984 +18281@-36028797279011009 +18346@576460752303423487 +18425@-16777212 +18490@289497013214370869 +18557@947853807149121536 +18624@1229200249500172416 +18694@985714349371008 +18762@-3454251568344293376 +18827@-2887340658508948914 +18896@5656979692240437755 +18962@8131989166061353862 +19027@-444596225 +19092@360292508225346146 +19173@4531085219041640447 +19240@-137438912512 +19305@-9837617594369 +19370-19454 +19456@-39350469927884 +19521-19607 +19613@-2717990596370432 +19678@657535981348856831 +19751@1341413178546685 +19819@-39393440038913 +19884@-255086725955585 +19949@2457820655152988169 +20014@-1423175164699630149 +20079@134040365177987888 +20147@-9338 +20212@72235714921627647 +20278@-9187202424501157854 +20365@72339069149382660 +20430@-1048576 +20495-20562 +20564@-4609 +20629@-7690177771198568193 +20695@8618462392113690865 +20761@-647328245845213058 +20826@-939560854 +20891-21468 +21470@4503889209318428 +21541@-144115187991968768 +21606@8796093022207 +21774@-2589569785739083648 +21839@317324131360529410 +21904@1191182353179868795 +21970@621778698641699839 +22038@177268578097496336 +22170@326808950409265280 +22251@-54648000786202496 +22316@-599785473 +22381@-268435457 +22446-22912 +22914@-1152921530661864837 +22980@-13 +23045@-227712706398912001 +23110@4611686018494496767 +23196@297237851358101622 +23329@8589934720 +23402@-16911433728 +23467@4521191846969343 +23544@72057598349672448 +23626@72057596185411712 +23691@146371385944440832 +23758@562951027179714 +23835@327988716611829888 +23901@141287244317831 +23980@35321811042432 +24050 +24137@619 +24248@619 +24372@619 +24468@34603008 +24560@954611171233628779 +24665@2260595906707457 +24748@288230376151711339 +24847@174373748072252011 +24960@-38843546786069909 +25025@2810263828384774638 +25104@68719480848 +25188@4295098496 +25310@576460752303423520 +25378@57028264341504 +25494@1367792466002048 +25565@2251804108652672 +25655@-10996189986784 +25720@-864691128455135233 +25785@-874824226543247361 +25850@36310306355412991 +25920@17249075200 +25987@-9214329653227945856 +26066@289391460967514112 +26171@128 +26254@35321811042432 +26324@144115205322833984 +26424@8830452760640 +26489@36173932689096768 +26555@1152921504606846975 +26634@4295098496 +26709@-1117103813820352 +26774@4521191846969343 +26850 +26921@1073741952 +27017@144115205322833984 +27146@128 +27236@35321811042432 +27305 +27378@1073741952 +27466@-1073114152345600 +27531@289356276058554879 +27613 +27684@1073741952 +27788@1073741952 +27878@-1073114152345600 +27943@511 +28008@1073741952 +28112@1073741952 +28216@1073741952 +28327@1073741952 +28431@1073741952 +28542@1073741952 +28651@1073741952 +28762@1073741952 +28873@1073741952 +28984@1073741952 +29095@1073741952 +29206@1073741952 +29322@1073741952 +29437@1073741952 +29551@4295098496 +29626@-9223372036854775744 +29698@8388608 +29788@-4649386547848675361 +29898@-407371648 +29963@-1234285365062270977 +30028@-3 +30093@8646911284551352319 +30158@-25 +30223-30373 +30375@144115325511628411 +30441@275951648768 +30512@-389 +30577@-71545850429441 +30642-30746 +30748@-389 +30813-30967 +30988@-407371648 +31053@17592186044415 +31118@70643622084736 +31196@233059286778475 +31267@-389 +31332@-71545850429441 +31397-31501 +31503@-389 +31568-31722 +31743@-4294967168 +31808@144115196700393535 +31947@1130435392311312 +32022 +32099@2207881625616 +32165 +32246@1130435392311312 +32321 +32402@1130435392311312 +32477 +32557@565217696157712 +32631 +32712@1130435392311312 +32787 +32868@1130435392311312 +32943 +33024@1130435392311312 +33099 +33184@2147483776 +33282@4521191813431296 +33366@70652212019328 +33439@2260870784618512 +33517@2260870784618512 +33593@1152921504606847040 +33677@36169534507319296 +33757 +33864@2147483776 +33981@2147483776 +34094@2260870784618512 +34175@4295098496 +34250@17592186044480 +34316@70643622084736 +34406@144115196699344896 +34512@2147483776 +34610@-9006924376834049 +34675-34941 +34963@2251799948427264 +35100@2147483776 +35217@2147483776 +35298@2147483776 +35439@2147483776 +35571@2147483776 +35726@2147483776 +35843@4294967424 +35955@69256381088 +36030@4485320246575037 +36097@-27021597764223011 +36162@-118850335014913 +36227@8915963614901305343 +36293@-4298111212062277 +36358@3459329662799314943 +36455@17179869312 +36561-36677 +36978@9223372036804444159 +37043@2305913377957871615 +37110@6773413839564963968 +37175@1073716697 +37250@4386977218688 +37365@144115188075856000 +37431 +37515@7746213201060036736 +37581@2008029143310958592 +37646@2810246166673870708 +37735@-70334250221504 +37800@72057649728847871 +37865@562949953420288 +37938@-133 +38003@417505180909567 +38075@-133 +38140@-9187343205476073473 +38216@-120 +38281@5331156991 +38357@110340389894881528 +38436@-6743098654721 +38501@72057078638047231 +38580@-1149436121466273792 +38645@-4611675375498424321 +38710@-358 +38775@2308103605153955839 +38852@283673999966208 +38961-39037 +39042@5139733074736578529 +39114@-4612814070817658132 +39180@-2274006007650 +39245-39589 +39593@565148976693755 +39674@9222254933578875008 +39744@-64 +39809@37243793879138303 +39879@-558551370005440 +39944@18621352617443327 +40013@1163902314382400 +40078@288266729291809856 +40145@2323858543758804002 +40211@-8912619246769274864 +40289@4611976977228792896 +40359@4647717088561987848 +40426@4902168336462512144 +40494@4764878778941841408 +40571@4611976843548172928 +40642@4629701552972497954 +40707@5769111406670512392 +40774@4972255481344294928 +40842@2313733105209319424 +40909@578220246339469568 +40974@1156440217247334656 +41040@-8934261775969238784 +41113@148632119819665504 +41180@297264239101378656 +41248@297264239101378656 +41316@148632119819665504 +41383@297264239101378656 +41451@297264101662425184 +41519@297264239101378656 +41587@2378112809533735008 +41658@297264239101378656 +41726@1189056405035843680 +41796@2378112809533735008 +41867@8430117416344780896 +41932@2378112843087069167 +42003@2378112809533735008 +42074@4756225618529517664 +42146@-6628449827974774688 +42219@4756225652351303652 +42291@2378112809533735008 +42362@297802724921081952 +42437@54324674800191616 +42502@-4539619610578116592 +42575@9222817900712697872 +42642@-9223226622130257656 +42717@576497110034808813 +42786@-532676344 +42851@2310487780121116671 +42922@288248552520421512 +42988@74316266337239140 +43054@2305988488883896416 +43125@-2287792323058204408 +43198@9151278158630101008 +43263@1605635 +43331@-741072984869849 +43396-43640 +43644@-87963754307594 +43709-44004 +44007@-353895589 +44072-44597 +44601@-16747772394086410 +44666-44966 +44968@-5649732289 +45033-45948 +45951@-176554135 +46016-46296 +46298@-1025 +46363-46569 +46573@-47380361301287969 +46638-46951 +46955@1909491124741735423 +47020@-301266525978634 +47085-47463 +47466@-19412344842 +47531-47893 +47897@-11279802378 +47962-48251 +48263@-4260888640 +48328@144132853418967295 +48399@49821070877786048 +48464@2252075900600448 +48529@297802724651597952 +48596@576531396999381504 +48664@144678207018238080 +48730@144680337322020864 +48801@144132849249845376 +48867@72339103509643392 +48934@2308112403363008512 +49009@9009402573488256 +49076@9009406868979968 +49143@18016606123720960 +49211@144132788852883712 +49282@72066398721933568 +49352@-586294715574385664 +49417@-9222245587125001987 +49494@-9222245999492200448 +49561@288371130822066172 +49633@4503874522058752 +49702@2252074725150720 +49767@3837084474974666720 +49832@-34091294711 +49897@1298162626982903887 +49968@2305913654983524608 +50037@5188212702241112192 +50131@-5067133696402549 +50196@8069254263596908543 +50261-50616 +50618@-393088 +50683-51057 +51059@578731248126558340 +51128@-8065929305939443584 +51199@4620728475085504640 +51270@612560193483444480 +51339@4620728475085504640 +51410@306315418822250752 +51479@-9205287123555385216 +51551@4900481547867537664 +51623@72339348204355712 +51689@144679241840132224 +51756@577034688770532868 +51824@288795527309492480 +51891@577591058880299136 +51959@1154054001567859200 +52028@288795527309492480 +52095@-9214329635980935040 +52164@578716967377174656 +52234@-9185654392106188672 +52307@2314930804330864679 +52378@-522232 +52443@4620728728471732223 +52510@290904388430430336 +52577@289426782845928512 +52644-52715 +52717@3242591731744506335 +52797@-8386561 +52862@1155314591698255871 +52941@-549755813632 +53006@72057869453500415 +53072@72198332064202752 +53147@36028934726353152 +53212@18084767320899584 +53285@36028831445811456 +53350@36099165830381568 +53424@36028934726353152 +53489@36099166032101376 +53565@36028831445811456 +53630@36099165830381568 +53704@36028934726353152 +53769@36099166032101376 +53844@144115222502703360 +53911@288793326172372992 +53988@72057869452706048 +54054@577586656513622016 +54139@1152921539033694464 +54209@577586652277506048 +54287@1152925911243292928 +54357@1155173313027244032 +54443@-9223372002427928320 +54516@1155173304487772160 +54595@4611703644973170944 +54667@-9205357569491599360 +54753@-9214505592302952590 +54826@-9205357638278053888 +54908@70506183131392 +54973@4612952930700493056 +55039@70506250239999 +55104@-9223336783763209984 +55177@288230651566489600 +55245@2305851822486585344 +55316@72057869452705792 +55382@2203854962688 +55447@282041912393984 +55517@-134217472 +55582@576460786679939071 +55651@1153202980121477120 +55736@108086459910586624 +55802@72339069552558080 +55878@648522187585618048 +55967@-361582713064 +56032-56487 +56490@-3373006891 +56555-57171 +57175@-165379 +57240-57911 +57914-63034 +63036-70881 +70884@-11034634 +70949-71822 +71825@-44138518 +71890-73435 +73438@-94470166 +73503-76692 +76698@8728020058518847967 +76769@-2216331767575412536 +76834@-43105 +76899-77423 +77429@4796510832362530788 +77498@-142988742976615040 +77563@-9079256848779180001 +77636@-2234207627636472 +77701@17639699120127 +77772@2199023255556 +77853@9007199321915656 +77934@9007199321849856 +78015@9007199321849856 +78096@4503599694479360 +78176@144115188612726784 +78263@-9223372034707292160 +78358@4611686020574871552 +78454@8589934592 +78521@4294967296 +78589@-8939681645145882624 +78688@34359738368 +78761@34896494592 +78832@34359738368 +78910@68719476736 +78977@807622076927057919 +79067@2251810551103487 +79149@281474977759236 +79226@648526587175641088 +79317@146366715160157067 +79382@612561017578192895 +79447@-17454730311672 +79512@288265698333949951 +79578@4521260541281284 +79644@36169672500973568 +79713@144132849249845376 +79779@144678207018238080 +79845@144680337322020864 +79916@144132849249845376 +79981@1155173579567923328 +80052@4612816316918140928 +80128@18018805146976512 +80196@9009402573488256 +80263@18018805146976384 +80331@144150441175811072 +80402@576531155411534336 +80475@18016665711077504 +80543@2306124552918270976 +80618@-9222228546607378432 +80695@4611967562131964928 +80772@18016597801205760 +80840@144117391393820672 +80908@-34909485783446 +80973@1152956723405864959 +81041@578730146452738052 +81116@8439233318502464 +81183@4319073186495856644 +81259@576425572402462724 +81331@4631952766506369023 +81396@-274844344318 +81461@189153384044711935 +81531@2306406096648013824 +81596@5629774496008832 +81661@-9221119549812758528 +81727@-9220557149606770688 +81803@11259548992020482 +81869@18018934028511232 +81936@-9151296846067335152 +82012@2306410358287632384 +82086@2306406097680072768 +82156@18018797638125568 +82221@18018797638125568 +82286@7061679408687351808 +82351@18018797631815547 +82416@576601524159907840 +82488@576601524168292608 +82558@2815093406435328 +82624@576601524159907840 +82696@9359045660069887 +82766@9429411719802880 +82835@1188951444088160272 +82910@1441195862297432064 +82984@7493989780481389935 +83054@-48378406764065 +83119-84858 +84860@-288195470952432705 +84925@288793343150784511 +85029@107752139522047 +85202@256 +86015@16645070 +86172@32764 +86381@35184372092927 +86462@8589934591 +86548@1125899906842624 +86629@5188212676467113984 +86723@77310393355 +86791@-140720444801013 +86856@141012374585343 +86949@107752139522047 +87122@256 +87935@16645070 +88092@32764 +88301@35184372092927 +88382@8589934591 +88468@1125899906842624 +88549@5188212676467113984 +88643@77310393355 +88711@-140720444801013 +88776@141012374585343 +88869@107752139522047 +89042@256 +89855@16645070 +90012@32764 +90221@35184372092927 +90302@8589934591 +90388@1125899906842624 +90469@5188212676467113984 +90563@77310393355 +90631@-140720312680437 +90696@141287252556799 +90789@213305255788543 +90963@128 +91776@8257006 +91924@8387720 +92141@35184372092927 +92222@8589934591 +92308@1125899906842624 +92389@648526587846737920 +92480@77310393355 +92548@154620653579 +92626@-137170646015 +92691@-4393648466630653 +92756@-2095054849 +92821@37084328181628927 +92887@-2 +92952-93107 +93109@4616196217274630656 +93176@144264730256081408 +93244@4616330493124681736 +93317@19141399010091016 +93382@-9214355972720360960 +93447@-9214294400068255777 +93521@288124960743096576 +93588@72128031569216000 +93656@1154049605686526976 +93727@4508581793629183 +93792@-9221117900377554946 +93858@2882444670837753858 +93930@9895730407426 +94005@77310393355 +94073@175930451294230 +94139@289356344769644543 +94215@1152934973624287231 +94284 +94521@-3152510940935550977 +94586@6629298651640366974 +94651-96240 +96244@-38659162113 +96309@-79173964005377 +96374-96712 +96714@-393088 +96779-97153 +97155@578731248126558340 +97224@-8065929305939443584 +97295@4620728475085504640 +97366@612560193483444480 +97435@4620728475085504640 +97506@306315418822250752 +97575@-9205287123555385216 +97647@4900481547867537664 +97719@72339348204355712 +97785@144679241840132224 +97852@577034688770532868 +97920@288795527309492480 +97987@577591058880299136 +98055@1154054001567859200 +98124@288795527309492480 +98191@-9214329635980935040 +98260@578716967377174656 +98330@-9185654392106188672 +98403@9222193350453501991 +98468@-560741802307548 +98533-98597 +98599@-70092725288444 +98664@5190407920705232895 +98735@-267382528 +98800@5188212707068739583 +98894@-70351568502762 +98959@1103806857215 +99041@26663156973567 +99199@128 +99944@4128238 +100091@16380 +100288@562949953423359 +100371@2147483647 +100453@281474976710656 +100531@324261093960589312 +100619@144714114824937496 +100685@613302088415313919 +100753@1157433935899201792 +100823@-65408 +100888@72198900610896639 +100953@72198882360181888 +101018@144679241844294784 +101083@36174516703076488 +101148@7206324557082853504 +101215@288795739893596288 +101282@316380081452816640 +101349@289358484510671104 +101417@144733117922443404 +101484@1297601845972762752 +101550@1155182173544841344 +101619@4652236076113989888 +101690@4629735739033190656 +101762@577657158931320840 +101830@4629735739033190656 +101902@577059024605810696 +101970@-9187272595643236096 +102043@4621257271450566688 +102114@144397763654779136 +102180@2594638538653843712 +102249@144678698514108345 +102316@144679241840132224 +102382@578716967377174656 +102452@289357382012617856 +102520@144679241840132224 +102586@1188985623504224384 +102655@2308103622367511040 +102725@36176131568763136 +102792@4620728419387181064 +102858@-70092725288444 +102923@5189277108412612607 +102989@72699743330910272 +103054@648800990088153344 +103122@289497565719695616 +103189@1297053168245411859 +103281@-4593585860426595306 +103346@175635712543031295 +103412@1157433935899201792 +103482@-65408 +103547@72198900610896639 +103612@72198882360181888 +103677@144679241844294784 +103742@36174516703076488 +103807@2594638538654417024 +103874@288795602454642816 +103941@298365682943330560 +104008@289358483973800192 +104076@144697933550354564 +104143@1297601845971714176 +104209@1155182173544841344 +104278@2326118038056994944 +104348@4629735739033190656 +104419@288828648454098952 +104486@4629735739033190656 +104557@577059024605810696 +104625@4629735739033190656 +104696@2310629187632791584 +104766@144397763654779136 +104832@648800922985570432 +104899@72339350326595513 +104965@72339620920066176 +105030@289360691318620288 +105099@289357382012617856 +105167@72339620920066176 +105232@612524871200800896 +105300@1154051819807310336 +105369@36176131568763136 +105436@306280097707460616 +105503@1369094286720630656 +105571@289426782783340672 +105638@1225544267217766418 +105707@289497565584688256 +105774@316663372973060 +105854@154620786710 +105923@2306090401510850582 +105993@18084767253792512 +106058@594193676406620288 +106125@4785074604081400 +106198@6312435839 +106272@105905099565432840 +106365@-92565180055544 +106430-106891 +106903@4164952191 +106975@279223177182183432 +107050@76561202792103937 +107126@-8646629809507531776 +107203@-176554135 +107268-107459 +107472@4239862731374600 +107557@578714759730167816 +107624@2449993381670027267 +107706@1154894037065433087 +107783@2305843155244679168 +107856@4785212043067392 +107922@-176554135 +107987-108178 +108191@144256475311636488 +108257@17592454611392 +108324@72620526811514880 +108391@4398113734784 +108456@7226069464469475328 +108526@268386940084323593 +108598@288300749459292168 +108668@4785212043067392 +108734@-176554135 +108799-108990 +109003@-23141303517176 +109068-109277 +109288@-2287758102365208704 +109354@115897349300973275 +109419@-4890891329333968305 +109524@4576784229400051720 +109632@506659424576733192 +109705@4899916394579558528 +109793@1152921504598460415 +109868@-281474976710528 +109933@205520895 +110074@128 +110818@4128238 +110965@16380 +111161@35184372090879 +111239@1073741823 +111318@70368744177664 +111393@324263292983844864 +111483@9007473067360779 +111551@-361583063672 +111616-112139 +112144@153122387332448287 +112239@-361582867448 +112304-112506 +112519@-677773052221587448 +112584@-21553 +112649-112827 +112840@2305843009284997128 +112906@-22598929216 +112971-113169 +113182@7564923879295614984 +113247@-172289 +113312-113577 +113580@-11034634 +113645-113920 +113937@1152921504598460415 +114012@-281474976710528 +114077@406847487 +114219@128 +114964@4128238 +115111@16380 +115308@562949953423359 +115391@2147483647 +115473@281474976710656 +115551@324263292983844864 +115641@-2251215984402986 +115717@162217556105494527 +115797@114841790497945600 +115863@18014398514724864 +115949@281475052210690 +116020@8796095119360 +116086@8796095119360 +116152@-9223367638806167552 +116240@70368752566272 +116313@2251799847239680 +116391@4503599660924928 +116470@18014398777917440 +116554@4467279504867328 +116635@576460752571858944 +116713@8796093030396 +116786@77309411328 +116854@72066389057208320 +116925@5188146769657200650 +117000@175931255717890 +117073@-4652217040600299520 +117138@-1140096783800451071 +117203@205196357536055325 +117274@123350294655 +117342@-4616752016104603644 +117407@8646911284551091204 +117472@149199622976317183 +117538@-4389422956288 +117603@1297133776123461631 +117669@36174520981192832 +117734@144397801235742848 +117800@-8646345995845566208 +117867@-9205284795160981488 +117939@298365682943330560 +118006@289358483973800192 +118074@144697933550354564 +118141@2594638538654417024 +118208@288795602454642816 +118275@4649975445780170880 +118346@578716967494549760 +118414@288828648454098952 +118481@4629735739033190656 +118552@288828648454098952 +118619@-9187272595928448768 +118691@2308130131376345096 +118761@4629735739033190656 +118832@18296977301209120 +118897@-108706476943409024 +118962@578721365457176061 +119028@1154051819807310336 +119097@-133977686555950848 +119162@2314885461828699647 +119230@2306973324414157312 +119300@289357380133848064 +119368@289358483680166016 +119434@18089167456436223 +119499@164399051607933222 +119564@324400529403871360 +119631@38655196800 +119698@309241573462 +119768@2306090401510850582 +119838@1154051802560202496 +119907@36589547951357952 +119972@962342158448 +120052@-8070445859289432056 +120118@5193785512675021055 +120183@653015625593258048 +120248@-8646769137977628844 +120316@639785002866779149 +120382@-85081304973699966 +120447@-1347 +120512-120687 +120690@-11034634 +120755-120941 +120946@-6263076622793785390 +121014@5188151581108373504 +121080@5911547221132247615 +121149@76561812342177854 +121219@6989870297835066863 +121284@-33422848 +121349@650807667258819973 +121414@-1123692276809600 +121479@24853360834248703 +121545@-9186066702524186492 +121618@144397801235742848 +121684@-8646345995845566208 +121751@-9205280397114470384 +121823@316380081452816640 +121890@289358484510671104 +121958@144733117922443404 +122025@7206324557082853504 +122092@288795739893596288 +122159@581246930722522240 +122227@2314867869944447232 +122297@-9187268455798013436 +122370@-9205287131624177536 +122438@4629737808955769088 +122510@4629770923657986176 +122577@72207144866415104 +122642@288795527309492480 +122709@1171006547277385984 +122780@144678696391868544 +122847@1440024322122514560 +122914@577032515596976640 +122982@577591054568587520 +123050@864689084117876992 +123118@577032515596976640 +123186@4613946618645905664 +123257@144679241840083456 +123324@-558534693355392 +123389@4652781917064724747 +123463@289426782783340672 +123530@1163336078745141247 +123599@2595203958735653120 +123664@153193033402187904 +123730@578853841643242624 +123799@633326745946121 +123880@38655196694 +123946@90072147167214602 +124022@1152921504598460415 +124097@-281474976710528 +124162@809500671 +124305@128 +125050@4128238 +125197@16380 +125394@562949953423359 +125482@2147483647 +125564@281474976710656 +125642@648524665177776128 +125733@-4510196697137242 +125798-127871 +127873@-35476429869057 +127938@287113341627793407 +128014@-11848347387936767 +128079-130091 +130097@-4562146422488563233 +130162@9007199273615415 +130237@1152921504598460415 +130312@-281474976710528 +130377@406847487 +130519@128 +131264@4128238 +131403@4193416 +131608@140737488357375 +131689@2147483647 +131771@281474976710656 +131849@-8070318727352016896 +131944@-70351568502762 +132009@1103806857215 +132091@13469017440255 +132248@128 +132992@4128238 +133139@16380 +133335@35184372090879 +133413@1073741823 +133492@70368744177664 +133567@324263292983844864 +133657@2059 +133727@-2242961845911424 +133792@-9205271878720028673 +133860@72198882360181256 +133925@-256 +133990@72339620993439250 +134055@72339620922147396 +134120@1225544251933229188 +134185@72198900743799328 +134250@298365682943330560 +134317@289358483973800192 +134385@144697933550354564 +134452@2594638538654417024 +134519@288795602454642816 +134586@1162493861445044480 +134655@1157433934972256512 +134724@-9187268455798013436 +134797@2314885461828993152 +134863@4629737808955769088 +134935@2314885461828993152 +135001@-9187268455798013440 +135074@72339620920066176 +135139@2308130131376345096 +135209@144397763654779136 +135275@73744241635230848 +135342@72339348204355712 +135408@289358483680166016 +135475@289919222019129472 +135544@72339348204355712 +135610@2314854623703236736 +135682@4629771061097924616 +135755@-9185654392106188672 +135830@306280097707460616 +135897@648800989683913280 +135965@20266455820141696 +136051@309241573462 +136121@2306090401510850582 +136191@1154051802560202496 +136260@1152640029632364544 +136333@289356344778031103 +136433@26663156973567 +136591@128 +137336@4128238 +137475@4193416 +137680@562949953423359 +137763@2147483647 +137845@281474976710656 +137923@324263292983844864 +138013@794887541844082710 +138083@-4395513236313636736 +138149@2315167985649713664 +138220@-8573091712 +138285@74591058444419071 +138350@72198900760510720 +138415@144679241986932992 +138482@4774942608999071872 +138553@289358484510671104 +138621@144733117922443404 +138688@7206324557082853504 +138755@288795739893596288 +138822@316380081452816640 +138889@289358484510671104 +138956@578731248126558340 +139025@-8065929305939443584 +139096@4620728475085504640 +139167@612560193483444480 +139236@4620728475085504640 +139307@306315418822250752 +139376@-9205287123555385216 +139448@4900481547867537664 +139520@72339348204355712 +139586@144679241840132224 +139653@577034688770532868 +139721@288795527309492480 +139788@577591058880299136 +139856@1154054001567859200 +139925@288795527309492480 +139992@-9214329635980935040 +140061@578716967377174656 +140131@-9185654392106188672 +140206@-8068189932002211832 +140273@-8761590661056 +140338@5260345656978964479 +140408@-9187199959457267584 +140475@36187195698184708 +140540@-162058942423758840 +140606@25332747904253955 +140674@8072711129098363007 +140769@149533615063168 +140835@1224979098660569631 +140919@1152921504598460415 +140994@-281474976710528 +141059@205520895 +141200@128 +141944@4128238 +142091@16380 +142287@35184372090879 +142365@1073741823 +142444@70368744177664 +142519@324263292983844864 +142609@-4593596754074270709 +142674@153325522103828479 +142740@1157433935899201792 +142810@-65408 +142875@72198900610896639 +142940@72198882360181888 +143005@144679241844294784 +143070@36174516703076488 +143135@7206324557082853504 +143202@288795739893596288 +143269@316380081452816640 +143336@289358484510671104 +143404@144733117922443404 +143471@1297601845972762752 +143537@1155182173544841344 +143606@4652236076113989888 +143677@4629735739033190656 +143749@577657158931320840 +143817@4629735739033190656 +143889@577059024605810696 +143957@-9187272595643236096 +144030@4621257271450566688 +144101@144397763654779136 +144167@2594638538653843712 +144236@144678698514108345 +144303@144679241840132224 +144369@578716967377174656 +144439@289357382012617856 +144507@144679241840132224 +144573@1188985623504224384 +144642@2308103622367511040 +144712@36176131568763136 +144779@-9205287234954065912 +144846@-70092725288444 +144911@5189277108412612607 +144977@72699743330910272 +145042@648800990088153344 +145110@289497565719695616 +145177@618483149131 +145248@1299851459631642646 +145314@-8760495964672 +145379@-3638835596141002753 +145444@596731503326665271 +145513@-7566047373982433281 +145579@-6683269003816624123 +145644@4845946042251743376 +145710@-7209312740830011376 +145777@-3456433531382349808 +145846@2594656238214643844 +145913@2608712360504397056 +145980@298365752082237696 +146048@149210329404966022 +146115@3747577635581788292 +146182@596728088810291332 +146253@4616350971385741444 +146318@3846192828953658404 +146387@-9223372030949134371 +146452@77310393355 +146520@2306090401510850583 +146585@37295434414219280 +146659@9895730348040 +146733@-8070326836099350518 +146802@4899973569183745792 +146877@2305843014045593540 +146942@154619804682 +147010@618479218708 +147080@-140703137005548 +147145@2207613714431 +147228@26663156973567 +147386@128 +148131@4128238 +148270@4193416 +148475@140737488357375 +148556@2147483647 +148638@281474976710656 +148716@162131646961688576 +148805@-5629499534213162 +148870@-2594073385935831041 +148935@-18875521 +149000@-4614307258980139027 +149065@-18434 +149130@-3071464842096280769 +149196@-324279651650245121 +149261@-42010159602598033 +149326@-20969963079237651 +149391@-10484981539618826 +149457@-4614307263812292611 +149522@-2307153631906146306 +149588@-2594237213805980161 +149653@-4614230289542095169 +149718@-40576386775716866 +149783@-2328363481402867731 +149849@-2882620440214245889 +149914@-162139487559876681 +149979@-40537894808490025 +150044@9212110563734028269 +150109@-40534870883078147 +150174@-2307109818407584907 +150240@-4614219602474306049 +150305@-4948104333314 +150370@-324303158467919891 +150435@9222105360803692399 +150500@-648557931176017930 +150565@-166633821867868449 +150630@-39728745041 +150695@9220814572199346175 +150760@-5332421800347631626 +150825@-5188225936809534465 +150890@-114143233 +150955@-4616752015972892801 +151020@8646911284551091204 +151085@149199622976317183 +151151@-4389422956288 +151216@1297133776123461631 +151282@36174520981192832 +151347@144397801235742848 +151413@-8646345995845566208 +151480@-9205284795160981488 +151552@298365682943330560 +151619@289358483973800192 +151687@144697933550354564 +151754@2594638538654417024 +151821@288795602454642816 +151888@4649975445780170880 +151959@578716967494549760 +152027@288828648454098952 +152094@4629735739033190656 +152165@288828648454098952 +152232@-9187272595928448768 +152304@2308130131376345096 +152374@4629735739033190656 +152445@18296977301209120 +152510@-108706476943409024 +152575@578721365457176061 +152641@1154051819807310336 +152710@-133977686555950848 +152775@2314885461828699647 +152843@2306973324414157312 +152913@289357380133848064 +152981@289358483680166016 +153047@18089167456436223 +153112@164399051607933222 +153177@324400529403871360 +153244@38655196800 +153311@309241573462 +153381@2306090401510850582 +153451@1154051802560202496 +153520@2594106336356728832 +153612@1153045200755425290 +153681@1154051802560202496 +153750@2594106336356728832 +153842@-22 +153907-156507 +156512@-2242961845911424 +156577@-9205271878720028673 +156642@577591058881459264 +156710@-256 +156775@72339620993439250 +156840@72339620922147396 +156905@216737935402238084 +156970@72198900743799400 +157035@298365682943330560 +157102@289358483973800192 +157170@144697933550354564 +157237@2594638538654417024 +157304@288795602454642816 +157371@144680345659312384 +157440@288513019426898048 +157507@36176131568763136 +157574@-9187193637239257080 +157639@290904388430462975 +157706@-7781089582725969664 +157777@289426782783340672 +157844@2109825913979908 +157909@33742199380246532 +157978@574209339036794884 +158044@492719185125632 +158125@149533615063168 +158193@8072711129098363007 +158288@1153071038221910144 +158357@-8761569710592 +158422@-9187272536093097985 +158490@72339620922147398 +158556@1369094286720630783 +158622@2468043239960158213 +158687@4773886249173782544 +158758@347059754419421440 +158825@-8899042219522973184 +158897@289358483973800192 +158965@144697933550354564 +159032@2594638538654417024 +159099@288795602454642816 +159166@298365682943330560 +159233@4613946618645905664 +159304@-9151032415934733824 +159369@-9214327453126557697 +159435@-547599413231 +159500@164385801784786943 +159565@72341611904827520 +159631@1157990262338752548 +159700@316663372973060 +159780@154620786710 +159849@2306090401510850582 +159919@1154051802560202496 +159988@36589547951357952 +160053@962342158448 +160125@-2305693475598630784 +160190@4706261610615275579 +160256@-36309132889833456 +160321@2387369040856355439 +160392@5476377146882523135 +160457@-7818692707377635323 +160526@-6799976246779206144 +160591@-105517534883632 +160656@-2242688023191723 +160721@-9204723391934758913 +160786@597149447647134756 +160854@-1152921503868641797 +160920@-9223372032022876224 +160985@-8070326836099350517 +161054@1165482325444352 +161123@-4091449753143869432 +161188@2449958766372716544 +161263@-3922937231040255 +161328@-8034175448919310337 +161393@1803705411944460424 +161462@-240 +161527@-6845031075760957926 +161592@-9150874085050259868 +161657@1261574285912211660 +161722@112731607705715504 +161787@461128593058142608 +161854@-8933380229332663920 +161921@-8933340377136430695 +161988@-3709833312455155455 +162055@901852861644873985 +162123@230600587132115344 +162189@1159967227489878416 +162255@219779733368365452 +162321@4639868909072220560 +162389@-4447795000775703412 +162461@4639868909072220560 +162529@-4457646624960576372 +162601@-9167006255567273584 +162670@1311128141213475340 +162736@4756654991274615041 +162802@-8933380230047653631 +162869@1748553324455382553 +162938@450926247785070992 +163005@901852705969438928 +163073@1748531351408214792 +163142@450926247785070992 +163209@-8926081117852761904 +163277@1159967228872233217 +163342@3566850802878521392 +163412@-603487396515781616 +163477@-251068789558293121 +163542@4639160614982254591 +163610@1847637146802947688 +163676@4756689888413884673 +163742@3784156804603741190 +163812@8439846422936464 +163879@-8628790946378547196 +163944@-7482408965 +164009@-8349055714420858881 +164074@-269649587393756980 +164139@6371467572822409215 +164207@3689125670536885040 +164277@4756701715168821648 +164343@-8933346083019218687 +164412@2320253277746760908 +164479@7214821647777859596 +164545@-4017098287391567847 +164617@461128593058142608 +164684@-8933380229332663920 +164751@-8933340377136430695 +164818@27870421279416577 +164884@1838031666691182592 +164956@4828984837963255808 +165022@4612249279237456896 +165091@144194767377662097 +165162@10186150631195744 +165227@3476781112494919680 +165294@18023757310337028 +165362@8372616119038648416 +165427@3476781112495175663 +165496@144189980770582536 +165567@4902168135337541728 +165641@3476781112494919680 +165711@1159822177835681296 +165776@18023745977320448 +165844@579983725828243424 +165909@-3998063861700774256 +165981@7421932185906577296 +166055@-7331293798571940224 +166120@3749251156605666304 +166190@-2591812720436176624 +166255@-5476377146731526274 +166325@-2242961845911424 +166390@-9205271878720028673 +166462@1157433934754358376 +166532@1369094286720630783 +166598@2468043239960158213 +166663@4773886249173782544 +166734@347059754419421440 +166801@-8899042219522973184 +166873@289358483973800192 +166941@144697933550354564 +167008@2594638538654417024 +167075@288795602454642816 +167142@298365682943330560 +167209@577591054568587520 +167277@432344542058938496 +167344@2306973324414157312 +167414@289357380133848064 +167482@289358483680166016 +167548@18089167456436223 +167613@-2190397652922 +167678@657543207139147775 +167745@72341611904827520 +167811@1157990262338752548 +167880@316663372973060 +167960@154620786710 +168029@2306090401510850582 +168099@1154051802560202496 +168168@36589547951357952 +168233@962342158448 +168305@1153071038221910144 +168374@-8761569710592 +168439@-9115214942055170049 +168507@72339620922147398 +168573@1369094286720630783 +168639@2468043239960158213 +168704@4773886249173782544 +168775@347061953442676992 +168842@-8899042219522973184 +168914@289358483973800192 +168982@144697933550354564 +169049@2594638538654417024 +169116@288795602454642816 +169183@298365682943330560 +169250@4613946618645905664 +169321@-9151032415934733824 +169386@-9214327453126557697 +169452@-547599413231 +169517@164385801784786943 +169582@72341611904827520 +169648@1157990262338752548 +169717@316663372973060 +169797@154620786710 +169866@2306090401510850582 +169936@1154051802560202496 +170005@36589547951357952 +170070@962342158448 +170142@4035374799739027584 +170207@-604049409 +170272@2017611395968794623 +170337@-449691 +170402-170466 +170468@9223372036854775806 +170534@-2 +170599@3202059335060422655 +170664@-587186099 +170729-171110 +171112@630503947831804032 +171180@-7493989779944505472 +171245@-40681931669505 +171310-171409 +171412@-9187008988300967950 +171485@1158551004141059830 +171554@-3572628181351399425 +171619@-75041701411842 +171684@-737345 +171749-171872 +171884@8090743395745538175 +171979@1153071038498997409 +172048@-8761569710592 +172113@-9115214942055170049 +172181@72339620922147398 +172247@1369094286720630783 +172313@2468043239960158213 +172378@4773886249173782544 +172449@347061953442676992 +172516@-8899042219522973184 +172588@289358483973800192 +172656@144697933550354564 +172723@2594638538654417024 +172790@288795602454642816 +172857@298365682943330560 +172924@4613946618645905664 +172995@-9151032415934733824 +173060@-9214327453126557697 +173126@-547599413231 +173191@164385801784786943 +173256@72341611904827520 +173322@1157990262338752548 +173391@316663372973060 +173471@154620786710 +173540@2306090401510850582 +173610@1154051802560202496 +173679@36589547951357952 +173744@962342158448 +173816@1153071038221910144 +173885@-8761569710592 +173950@-9187272536093097985 +174018@72339620922147398 +174084@1369094286720630783 +174150@2468043239960158213 +174215@4773886249173782544 +174286@347059754419421440 +174353@-8899042219522973184 +174425@289358483973800192 +174493@144697933550354564 +174560@2594638538654417024 +174627@288795602454642816 +174694@298365682943330560 +174761@577591054568587520 +174829@432344542058938496 +174896@2306973324414157312 +174966@289357380133848064 +175034@289358483680166016 +175100@18089167456436223 +175165@-2190397652922 +175230@657543207139147775 +175297@72341611904827520 +175363@1157990262338752548 +175432@316663372973060 +175512@154620786710 +175581@2306090401510850582 +175651@1154051802560202496 +175720@36589547951357952 +175785@962342158448 +175857@1153071038221910144 +175926@-8761569710592 +175991@-9187272536093097985 +176059@72339620922147398 +176125@1369094286720630783 +176191@2468043239960158213 +176256@4773886249173782544 +176327@347059754419421440 +176394@-8899042219522973184 +176466@289358483973800192 +176534@144697933550354564 +176601@2594638538654417024 +176668@288795602454642816 +176735@298365682943330560 +176802@577591054568587520 +176870@432344542058938496 +176937@2306973324414157312 +177007@289357380133848064 +177075@289358483680166016 +177141@18089167456436223 +177206@-2190397652922 +177271@657543207139147775 +177338@72341611904827520 +177404@1157990262338752548 +177473@316663372973060 +177553@154620786710 +177622@2306090401510850582 +177692@1154051802560202496 +177761@36589547951357952 +177826@962342158448 +177898@4035374799739027584 +177963@-275481956357 +178028@-7206323590839402497 +178093@-4611686018427837635 +178158-178222 +178224@9223372036854775294 +178290@-2 +178355@-1265511495291109377 +178420@-1728036787 +178485-178866 +178868@-2310192694393176312 +178933@144679241875709951 +178999@-71441936246375416 +179064@9223301531845918718 +179129@157608394637445311 +179194@-36098865148985601 +179259@6908521759533793151 +179328@-4620616260458184832 +179393@9223301531221082111 +179458@684406404796129471 +179524@-72197768902361229 +179589@-144116289726382337 +179654@3546575910394007142 +179723@-577582228393951489 +179788@-1152930317811058689 +179853@1728819305881014295 +179918@289917026971910273 +179985@-29273397611462913 +180051@-79458994945 +180116-180206 +180209@-9187008988300967950 +180282@1158551004141059830 +180351@-3572628181351399425 +180416@-72132635739339780 +180481@-21708865 +180546@-4194433 +180611@288230376084602623 +180681@8140424489344180351 +180776@1153071039243489209 +180845@-8761569710592 +180910@-9187272536093097985 +180978@72339620922147398 +181044@1369094286720630783 +181110@2468043239960158213 +181175@4773886249173782544 +181246@347059754419421440 +181313@-8899042219522973184 +181385@289358483973800192 +181453@144697933550354564 +181520@2594638538654417024 +181587@288795602454642816 +181654@298365682943330560 +181721@577591054568587520 +181789@432344542058938496 +181856@2306973324414157312 +181926@289357380133848064 +181994@289358483680166016 +182060@18089167456436223 +182125@-2190397652922 +182190@657543207139147775 +182257@72341611904827520 +182323@1157990262338752548 +182392@316663372973060 +182472@154620786710 +182541@2306090401510850582 +182611@1154051802560202496 +182680@36589547951357952 +182745@962342158448 +182817@1153071038221910144 +182886@-8761569710592 +182951@-9187272536093097985 +183019@72339620922147398 +183085@1369094286720630783 +183151@2468043239960158213 +183216@4773886249173782544 +183287@347059754419421440 +183354@-8899042219522973184 +183426@289358483973800192 +183494@144697933550354564 +183561@2594638538654417024 +183628@288795602454642816 +183695@298365682943330560 +183762@577591054568587520 +183830@432344542058938496 +183897@2306973324414157312 +183967@289357380133848064 +184035@289358483680166016 +184101@18089167456436223 +184166@-2190397652922 +184231@657543207139147775 +184298@72341611904827520 +184364@1157990262338752548 +184433@316663372973060 +184513@154620786710 +184582@2306090401510850582 +184652@1154051802560202496 +184721@36589547951357952 +184786@962342158448 +184858@1153071038221910144 +184927@-8761569710592 +184992@-3999125765362286593 +185057@578716967377179188 +185126@1369094286720630783 +185192@2468043239960158213 +185257@4773886249173782544 +185328@347781034047242496 +185395@-8899042219522973184 +185467@289358483973800192 +185535@144697933550354564 +185602@2594638538654417024 +185669@288795602454642816 +185736@298365682943330560 +185803@4629735739033190656 +185874@577059024605810696 +185942@4629735739033190656 +186013@18296977301209120 +186078@72339348204355712 +186144@72339620920066176 +186209@72340172829655072 +186276@2595200389095686272 +186342@1157433934720729087 +186411@72340172829655072 +186479@288513019426898048 +186546@577591054568587520 +186614@2315413434423836608 +186686@-2190397652922 +186751@657543207139147775 +186818@72341611904827520 +186884@1157990262338752548 +186953@316663372973060 +187033@154620786710 +187102@2306090401510850582 +187172@1154051802560202496 +187241@36589547951357952 +187306@962342158448 +187378@1153071038221910144 +187447@-8761569710592 +187512@-9187272536093097985 +187580@72339620922147398 +187646@1369094286720630783 +187712@2468043239960158213 +187777@4773886249173782544 +187848@347059754419421440 +187915@-8899042219522973184 +187987@289358483973800192 +188055@144697933550354564 +188122@2594638538654417024 +188189@288795602454642816 +188256@298365682943330560 +188323@577591054568587520 +188391@432344542058938496 +188458@2306973324414157312 +188528@289357380133848064 +188596@289358483680166016 +188662@18089167456436223 +188727@-2190397652922 +188792@657543207139147775 +188859@72341611904827520 +188925@1157990262338752548 +188994@316663372973060 +189074@154620786710 +189143@2306090401510850582 +189213@1154051802560202496 +189282@36589547951357952 +189347@962342158448 +189419@1153071038221910144 +189488@-8761569710592 +189553@-8610811783789674497 +189621@72339620922147398 +189687@1369094286720630783 +189753@2468043239960158213 +189818@4773886249173782544 +189889@347077346605465856 +189956@-8899042219522973184 +190028@289358483973800192 +190096@144697933550354564 +190163@2594638538654417024 +190230@288795602454642816 +190297@298365682943330560 +190364@4629735739033190656 +190435@577059024605810696 +190503@4629735739033190656 +190574@18296977301209120 +190639@72339348204355712 +190705@72339620920066176 +190770@72340172829655072 +190837@2595200389095686272 +190903@1157433934720729087 +190972@72340172829655072 +191040@288513019426898048 +191107@577591054568587520 +191175@2315413434423836608 +191247@-2190397652922 +191312@657543207139147775 +191379@72341611904827520 +191445@1157990262338752548 +191514@316663372973060 +191594@154620786710 +191663@2306090401510850582 +191733@1154051802560202496 +191802@36589547951357952 +191867@962342158448 +191939@1153071038221910144 +192008@-8761569710592 +192073@-8610811783789674497 +192141@72339620922147398 +192207@1369094286720630783 +192273@2468043239960158213 +192338@4773886249173782544 +192409@347077346605465856 +192476@-8899042219522973184 +192548@289358483973800192 +192616@144697933550354564 +192683@2594638538654417024 +192750@288795602454642816 +192817@298365682943330560 +192884@-9187272595928448768 +192956@18296977301209120 +193021@72339348204355712 +193087@72339620920066176 +193152@72340172829655072 +193219@2595200389095686272 +193285@1157433934720729087 +193354@72340172829655072 +193422@288513019426898048 +193489@577591054568587520 +193557@2315413434423836608 +193629@-2190397652922 +193694@657543207139147775 +193761@72341611904827520 +193827@1157990262338752548 +193896@316663372973060 +193976@154620786710 +194045@2306090401510850582 +194115@1154051802560202496 +194184@36589547951357952 +194249@962342158448 +194321@1153071038221910144 +194390@-8761569710592 +194455@-8610811783789674497 +194523@72339620922147398 +194589@1369094286720630783 +194655@2468043239960158213 +194720@4773886249173782544 +194791@347077346605465856 +194858@-8899042219522973184 +194930@289358483973800192 +194998@144697933550354564 +195065@2594638538654417024 +195132@288795602454642816 +195199@298365682943330560 +195266@4629735739033190656 +195337@577059024605810696 +195405@4629735739033190656 +195476@18296977301209120 +195541@72339348204355712 +195607@72339620920066176 +195672@72340172829655072 +195739@2595200389095686272 +195805@1157433934720729087 +195874@72340172829655072 +195942@288513019426898048 +196009@577591054568587520 +196077@2315413434423836608 +196149@-2190397652922 +196214@657543207139147775 +196281@72341611904827520 +196347@1157990262338752548 +196416@316663372973060 +196496@154620786710 +196565@2306090401510850582 +196635@1154051802560202496 +196704@36589547951357952 +196769@962342158448 +196841@1153071038221910144 +196910@-8761569710592 +196975@-8610811783789674497 +197043@72339620922147398 +197109@1369094286720630783 +197175@2468043239960158213 +197240@4773886249173782544 +197311@347077346605465856 +197378@-8899042219522973184 +197450@289358483973800192 +197518@144697933550354564 +197585@2594638538654417024 +197652@288795602454642816 +197719@298365682943330560 +197786@4629735739033190656 +197857@577059024605810696 +197925@4629735739033190656 +197996@18296977301209120 +198061@72339348204355712 +198127@72339620920066176 +198192@72340172829655072 +198259@2595200389095686272 +198325@1157433934720729087 +198394@72340172829655072 +198462@288513019426898048 +198529@577591054568587520 +198597@2315413434423836608 +198669@-2190397652922 +198734@657543207139147775 +198801@72341611904827520 +198867@1157990262338752548 +198936@316663372973060 +199016@154620786710 +199085@2306090401510850582 +199155@1154051802560202496 +199224@36589547951357952 +199289@962342158448 +199361@1153071038221910144 +199430@-8761569710592 +199495@-3999125765362286593 +199560@578716967377179188 +199629@1369094286720630783 +199695@2468043239960158213 +199760@4773886249173782544 +199831@347781034047242496 +199898@-8899042219522973184 +199970@289358483973800192 +200038@144697933550354564 +200105@2594638538654417024 +200172@288795602454642816 +200239@298365682943330560 +200306@4629735739033190656 +200377@577059024605810696 +200445@4629735739033190656 +200516@18296977301209120 +200581@72339348204355712 +200647@72339620920066176 +200712@72340172829655072 +200779@2595200389095686272 +200845@1157433934720729087 +200914@72340172829655072 +200982@288513019426898048 +201049@577591054568587520 +201117@2315413434423836608 +201189@-2190397652922 +201254@657543207139147775 +201321@72341611904827520 +201387@1157990262338752548 +201456@316663372973060 +201536@154620786710 +201605@2306090401510850582 +201675@1154051802560202496 +201744@36589547951357952 +201809@962342158448 +201881@1153071038221910144 +201950@-8761569710592 +202015@-3999125765362286593 +202080@578716967377179188 +202149@1369094286720630783 +202215@2468043239960158213 +202280@4773886249173782544 +202351@347781034047242496 +202418@-8899042219522973184 +202490@289358483973800192 +202558@144697933550354564 +202625@2594638538654417024 +202692@288795602454642816 +202759@298365682943330560 +202826@4629735739033190656 +202897@577059024605810696 +202965@4629735739033190656 +203036@18296977301209120 +203101@72339348204355712 +203167@72339620920066176 +203232@72340172829655072 +203299@2595200389095686272 +203365@1157433934720729087 +203434@72340172829655072 +203502@288513019426898048 +203569@577591054568587520 +203637@2315413434423836608 +203709@-2190397652922 +203774@657543207139147775 +203841@72341611904827520 +203907@1157990262338752548 +203976@316663372973060 +204056@154620786710 +204125@2306090401510850582 +204195@1154051802560202496 +204264@36589547951357952 +204329@962342158448 +204401@1153071038221910144 +204470@-8761569710592 +204535@-3999125765362286593 +204600@578716967377179188 +204669@1369094286720630783 +204735@2468043239960158213 +204800@4773886249173782544 +204871@347781034047242496 +204938@-8899042219522973184 +205010@289358483973800192 +205078@144697933550354564 +205145@2594638538654417024 +205212@288795602454642816 +205279@298365682943330560 +205346@4629735739033190656 +205417@577059024605810696 +205485@4629735739033190656 +205556@18296977301209120 +205621@72339348204355712 +205687@72339620920066176 +205752@72340172829655072 +205819@2595200389095686272 +205885@1157433934720729087 +205954@72340172829655072 +206022@288513019426898048 +206089@577591054568587520 +206157@2315413434423836608 +206229@-2190397652922 +206294@657543207139147775 +206361@72341611904827520 +206427@1157990262338752548 +206496@316663372973060 +206576@154620786710 +206645@2306090401510850582 +206715@1154051802560202496 +206784@36589547951357952 +206849@962342158448 +206921@1153071038221910144 +206990@-8761569710592 +207055@-8610811783789674497 +207125@-9205287131624238959 +207190@684547143360315391 +207255@2468043239960158213 +207320@4773886249173782544 +207391@342573746978095360 +207458@-8899042219522973184 +207530@289358483973800192 +207598@144697933550354564 +207665@2594638538654417024 +207732@288795602454642816 +207799@298365682943330560 +207866@1157433934972256512 +207935@2314929407799854088 +208006@2314885461828993152 +208072@4629737808955769088 +208144@2314885461828993152 +208210@-9187305847816912640 +208283@2314885461828993152 +208351@-9187268455798013440 +208424@72339620920066176 +208489@-3600345323290984416 +208554@577591054652276606 +208622@72340170682146944 +208687@1154051819807310336 +208756@577591054576910276 +208824@72340170682146944 +208889@578853427581551616 +208959@289357379881992320 +209027@2450028853796520064 +209097@-2242967196591616 +209162@-9205286616766087169 +209229@290834295705174532 +209296@2595203958735653120 +209366@81065823481103488 +209454@154620786710 +209523@2306090401510850582 +209593@1154051802560202496 +209662@36589547951357952 +209727@962342158448 +209799@1153071038221910144 +209868@-8761569710592 +209933@-8610811783789674497 +210003@-9205287131624238959 +210068@684547143360315391 +210133@2468043239960158213 +210198@4773886249173782544 +210269@342573746978095360 +210336@-8899042219522973184 +210408@289358483973800192 +210476@144697933550354564 +210543@2594638538654417024 +210610@288795602454642816 +210677@298365682943330560 +210744@1157433934972256512 +210813@72207162113524744 +210878@4629735739033190656 +210949@288828648454098952 +211016@4629735739033190656 +211087@577657296908197896 +211155@144397763654779136 +211221@585503273638692992 +211291@72339348204355712 +211357@72339620920066176 +211422@72340172829655072 +211489@2595200389095686272 +211555@1157433934720729087 +211624@72340172829655072 +211692@288513019426898048 +211759@577591054568587520 +211827@2315413434423836608 +211899@-2190397652922 +211964@657543207139147775 +212031@72341611904827520 +212097@1157990262338752548 +212166@316663372973060 +212246@154620786710 +212315@2306090401510850582 +212385@1154051802560202496 +212454@36589547951357952 +212519@962342158448 +212591@1153071038221910144 +212660@-8761569710592 +212725@-8610811783789674497 +212795@-9205287131624238959 +212860@684547143360315391 +212925@2468043239960158213 +212990@4773886249173782544 +213061@342573746978095360 +213128@-8899042219522973184 +213200@289358483973800192 +213268@144697933550354564 +213335@2594638538654417024 +213402@288795602454642816 +213469@298365682943330560 +213536@1157433934972256512 +213605@72207162113524744 +213670@4629735739033190656 +213741@288828648454098952 +213808@4629735739033190656 +213879@577657296908197896 +213947@144397763654779136 +214013@585503273638692992 +214083@72339348204355712 +214149@72339620920066176 +214214@72340172829655072 +214281@2595200389095686272 +214347@1157433934720729087 +214416@72340172829655072 +214484@288513019426898048 +214551@577591054568587520 +214619@2315413434423836608 +214691@-2190397652922 +214756@657543207139147775 +214823@72341611904827520 +214889@1157990262338752548 +214958@316663372973060 +215038@154620786710 +215107@2306090401510850582 +215177@1154051802560202496 +215246@36589547951357952 +215311@962342158448 +215383@1153071038221910144 +215452@-8761569710592 +215517@-8610811783789674497 +215587@-9205287131624238960 +215652@684547143360315391 +215717@2468043239960158213 +215782@4773886249173782544 +215853@306544949959131392 +215920@-8899042219522973184 +215992@289358483973800192 +216060@144697933550354564 +216127@2594638538654417024 +216194@288795602454642816 +216261@298365682943330560 +216328@1157433934972256512 +216397@2314929407799854088 +216468@2314885461828993152 +216534@4629737808955769088 +216606@2314885461828993152 +216672@-9187305847816912640 +216745@2314885461828993152 +216813@-9187268455798013440 +216886@72339620920066176 +216951@-3744460511366840288 +217016@577591054652276542 +217084@72340170682146944 +217149@1154051819807310336 +217218@577591054576910276 +217286@72340170682146944 +217351@578853427581551616 +217421@289357379881992320 +217489@2450028853796520064 +217559@2323932183137655296 +217624@144748782792344068 +217690@79165843047428 +217768@309241573462 +217838@2306090401510850582 +217908@1154051802560202496 +217977@2594106336356728832 +218069@1153045200755425290 +218138@1154051802560202496 +218207@-40527981417725952 +218272@-4611686018429476826 +218337@1193596983810537469 +218406@-4389422956288 +218471@1297133776123461631 +218537@36174520981192832 +218602@144397801235742848 +218668@-8646345995845566208 +218735@-9205284795160981488 +218807@298365682943330560 +218874@289358483973800192 +218942@144697933550354564 +219009@2594638538654417024 +219076@288795602454642816 +219143@581246930722522240 +219211@1157433934972256512 +219280@-9187268455798013436 +219353@2314885461828993152 +219419@4629737808955769088 +219491@2314885461828993152 +219557@-9187268455798013440 +219630@72339620920066176 +219695@2308130131376345096 +219765@144397763654779136 +219831@73744241635230848 +219898@72339348204355712 +219964@289358483680166016 +220031@289919222019129472 +220100@72339348204355712 +220166@2314854623703236736 +220238@4629771061097924616 +220311@-9185654392106188672 +220386@306280097707460616 +220453@1369094286720630656 +220521@289426782783340672 +220588@1225544267217766418 +220657@289497565584688256 +220724@316663372973060 +220804@154620786710 +220873@2306090401510850582 +220943@1154051802560202496 +221012@36589547951357952 +221077@962342158448 +221149@-71908060422864768 +221214-221359 +221366@299781928599955428 +221439@1153485622829711744 +221507@-33288193 +221572@-9222245998937440127 +221643@144504415192088575 +221709@72066391209414656 +221774@289393668044882048 +221843@144678207018238080 +221909@144680337322020864 +221980@144132849249845376 +222046@144678207018238080 +222112@288512950774796288 +222184@2306124761216057600 +222254@288265569130514432 +222322@144132784573646848 +222389@288265564835547136 +222457@2306124518566922240 +222528@1153062259291850752 +222600@4575370944691834880 +222668@4612249037133844480 +222743@-123848714841223168 +222808@2306124621646137375 +222883@36029346808334336 +222952@-141863113350705152 +223017@72142257507024927 +223089@2310352106399203264 +223161@9016012546523136 +223228@578730213559517248 +223295@-9223372032022876197 +223360@-5649732299 +223425-227455 +227459@-5513226 +227524-227878 +227881@-11018250 +227946-233842 +233845@-11034634 +233910-243895 +243898@-11034634 +243963-244234 +244237@-11034634 +244302-244993 +245004@-8521777216 +245069@288265706837934591 +245141@49821070877786048 +245206@2252075900600448 +245271@297802724651597952 +245338@576531396999381504 +245406@144678207018238080 +245472@144680337322020864 +245543@144132849249845376 +245609@72339103509643392 +245676@2308112403363008512 +245751@9009402573488256 +245818@9009406868979968 +245885@18016606123720960 +245953@144132788852883712 +246024@72066398721933568 +246094@-586294715574385664 +246159@-9222245587125001987 +246236@-9222245999492200448 +246303@288371130822066172 +246375@4503874522058752 +246444@2252074725150720 +246509@693563138842558432 +246579@180143985092739072 +246647@4620703121876975872 +246720@144682536210534400 +246785@19791460810880 +246861@-279241597878261 +246926@1157715926150283263 +247000@2305843009213173760 +247066@-9222241184850114555 +247143@297802724651597952 +247210@576531396999381504 +247278@144678207018238080 +247344@144680337322020864 +247415@144132849249845376 +247481@72339103509643392 +247548@2308112403363008512 +247623@9009402573488256 +247690@9009406868979968 +247757@18016606123720960 +247825@144132788852883712 +247896@72066398721933568 +247966@-586294715574385664 +248031@-9222245587125001987 +248108@-9222245999492200448 +248175@288371130822066172 +248247@4503874522058752 +248316@2252074725150720 +248381@693563138842558432 +248451@180143985092739072 +248519@4620703121876975872 +248592@144682536210534400 +248657@158331686469760 +248736@-6920176633387020277 +248801@-85 +248866-252870 +252874@-5513226 +252939-253292 +253295@-11018250 +253360-259256 +259259@-11034634 +259324-269307 +269318@-4260888640 +269383@144132853418967295 +269454@49821070877786048 +269519@2252075900600448 +269584@297802724651597952 +269651@576531396999381504 +269719@144678207018238080 +269785@144680337322020864 +269856@144132849249845376 +269922@72339103509643392 +269989@2308112403363008512 +270064@9009402573488256 +270131@9009406868979968 +270198@18016606123720960 +270266@144132788852883712 +270337@72066398721933568 +270407@-586294715574385664 +270472@-9222245587125001987 +270549@-9222245999492200448 +270616@288371130822066172 +270688@4503874522058752 +270757@2252074725150720 +270822@693563138842558432 +270892@180143985092739072 +270960@4620703121876975872 +271033@144682536210534400 +271098@158331686469760 +271177@-11299464597 +271242-275271 +275282@-4260888640 +275347@144132853418967295 +275418@49821070877786048 +275483@2252075900600448 +275548@297802724651597952 +275615@576531396999381504 +275683@144678207018238080 +275749@144680337322020864 +275820@144132849249845376 +275886@72339103509643392 +275953@2308112403363008512 +276028@9009402573488256 +276095@9009406868979968 +276162@18016606123720960 +276230@144132788852883712 +276301@72066398721933568 +276371@-586294715574385664 +276436@-9222245587125001987 +276513@-9222245999492200448 +276580@288371130822066172 +276652@4503874522058752 +276721@2252074725150720 +276786@693563138842558432 +276856@180143985092739072 +276924@4620703121876975872 +276997@144682536210534400 +277062@158331686469760 +277141@-279241597878261 +277206@1157715926150283263 +277280@2305843009213173760 +277346@-9222241184850114555 +277423@297802724651597952 +277490@576531396999381504 +277558@144678207018238080 +277624@144680337322020864 +277695@144132849249845376 +277761@72339103509643392 +277828@2308112403363008512 +277903@9009402573488256 +277970@9009406868979968 +278037@18016606123720960 +278105@144132788852883712 +278176@72066398721933568 +278246@-586294715574385664 +278311@-9222245587125001987 +278388@-9222245999492200448 +278455@288371130822066172 +278527@4503874522058752 +278596@2252074725150720 +278661@693563138842558432 +278731@180143985092739072 +278799@4620703121876975872 +278872@144682536210534400 +278937@158331686469760 +279016@-21180407881924597 +279083@-169 +279148-279319 +279332@-8049881383541668856 +279404@-2706654029894120889 +279469@-86209 +279534-283548 +283552@-5513226 +283617-283971 +283974@-11018250 +284039-289935 +289938@-11034634 +290003-299986 +299997@-4260888640 +300062@144132853418967295 +300133@49821070877786048 +300198@2252075900600448 +300263@297802724651597952 +300330@576531396999381504 +300398@144678207018238080 +300464@144680337322020864 +300535@144132849249845376 +300601@72339103509643392 +300668@2308112403363008512 +300743@9009402573488256 +300810@9009406868979968 +300877@18016606123720960 +300945@144132788852883712 +301016@72066398721933568 +301086@-586294715574385664 +301151@-9222245587125001987 +301228@-9222245999492200448 +301295@288371130822066172 +301367@4503874522058752 +301436@2252074725150720 +301501@693563138842558432 +301571@180143985092739072 +301639@4620703121876975872 +301712@144682536210534400 +301777@158331686469760 +301856@-1237026083349 +301921@-5764924201711566849 +301987@-604016643 +302052@-324279651614588929 +302117@-1342077637060741801 +302182@-4612952733141434945 +302248@-4614219453205905446 +302314@-5765240881728864266 +302380@-6052996238859603971 +302445@-3026498119429801986 +302511@-2684165170372022785 +302576@-4791849795944711297 +302641@-720734279801260034 +302706@-40534873232146451 +302771@8069816526204558325 +302836@-324435133688187393 +302901@-180163777513390225 +302966@-81069746464292901 +303031@-81075789616979979 +303096@-4617315517999677477 +303161@-20267435441539074 +303227@-162139482794004483 +303292@-1441310220097224705 +303357@-4612952694482010401 +303422@-1297115862352044034 +303487@-20829148286026305 +303552@-1301831517470869 +303617@8430718539429576703 +303682@-5237687614320189443 +303747@-2594114067597628033 +303812@-3740245430785 +303877@18089092281532415 +303942@-8556220421 +304007@586066154930298367 +304072@-287665222863257468 +304137@6362460373567668223 +304211@-9186066702524186492 +304284@144397801235742848 +304350@-8646345995845566208 +304417@-9205284795160981488 +304489@298365682943330560 +304556@289358483973800192 +304624@144697933550354564 +304691@2594638538654417024 +304758@288795602454642816 +304825@581246930722522240 +304893@1157433934972256512 +304962@-9187268455798013436 +305035@2314885461828993152 +305101@4629737808955769088 +305173@2314885461828993152 +305239@-9187268455798013440 +305312@72339620920066176 +305377@2308130131376345096 +305447@144397763654779136 +305513@73744241635230848 +305580@72339348204355712 +305646@289358483680166016 +305713@289919222019129472 +305782@72339348204355712 +305848@2314854623703236736 +305920@4629771061097924616 +305993@-9185654392106188672 +306068@306280097707460616 +306135@1369094286720630656 +306203@289426782783340672 +306270@1225544267217766418 +306339@289497565584688256 +306406@316663372973060 +306486@154620786710 +306555@2306090401510850582 +306625@1154051802560202496 +306694@36589547951357952 +306759@962342158448 +306831@149533615063168 +306904@1152921504598460415 +306979@-281474976710528 +307044@205520895 +307185@128 +307929@4128238 +308068@4193416 +308272@8796093024255 +308348@1073741823 +308427@70368744177664 +308502@-8070318727352016896 +308597@-2296792930213297653 +308662@87817856271515647 +308727@1157433935899201792 +308797@-65408 +308862@72198900610896639 +308927@72198882360181888 +308992@144679241844294784 +309057@36174516703076488 +309122@2594638538654417024 +309189@288795602454642816 +309256@298365682943330560 +309323@289358483973800192 +309391@144697933550354564 +309458@1297601845971714176 +309524@1155182173544841344 +309593@2326118038056994944 +309663@4629735739033190656 +309734@288828648454098952 +309801@4629735739033190656 +309872@577059024605810696 +309940@4629735739033190656 +310011@2310629187632791584 +310081@144397763654779136 +310147@648800922985570432 +310214@72339350326595513 +310280@72339620920066176 +310345@289360691318620288 +310414@289357382012617856 +310482@72339620920066176 +310547@612524871200800896 +310615@1154051819807310336 +310684@36176131568763136 +310751@306280097707460616 +310818@1369094286720630656 +310886@289426782783340672 +310953@1225544267217766418 +311022@289497565584688256 +311089@316663372973060 +311169@154620786710 +311238@2306090401510850582 +311308@1154051802560202496 +311377@36589547951357952 +311442@962342158448 +311514@149533615063168 +311586@288230376143325183 +311659@-17592186044288 +311724@1605631 +311847@128 +312521@2063854 +312649@2096264 +312840@4398046513151 +312913@134217727 +312985@4398046511104 +313054@40532911740424192 +313141@-4593585860426595306 +313206@175635712543031295 +313272@1157433935899201792 +313342@-65408 +313407@72198900610896639 +313472@72198882360181888 +313537@144679241844294784 +313602@36174516703076488 +313667@2594638538654417024 +313734@288795602454642816 +313801@298365682943330560 +313868@289358483973800192 +313936@144697933550354564 +314003@1297601845971714176 +314069@1155182173544841344 +314138@2326118038056994944 +314208@4629735739033190656 +314279@288828648454098952 +314346@4629735739033190656 +314417@577059024605810696 +314485@4629735739033190656 +314556@2310629187632791584 +314626@144397763654779136 +314692@648800922985570432 +314759@72339350326595513 +314825@72339620920066176 +314890@289360691318620288 +314959@289357382012617856 +315027@72339620920066176 +315092@612524871200800896 +315160@1154051819807310336 +315229@36176131568763136 +315296@306280097707460616 +315363@1369094286720630656 +315431@289426782783340672 +315498@1225544267217766418 +315567@289497565584688256 +315634@316663372973060 +315714@154620786710 +315783@2306090401510850582 +315853@1154051802560202496 +315922@36589547951357952 +315987@962342158448 +316059@149533615063168 +316133@1152921504598460415 +316208@-281474976710528 +316273@406847487 +316415@128 +317160@4128238 +317299@4193416 +317504@562949953423359 +317587@2147483647 +317669@281474976710656 +317747@324263292983844864 +317837@-4593585860426595306 +317902@175635712543031295 +317968@1157433935899201792 +318038@-65408 +318103@72198900610896639 +318168@72198882360181888 +318233@144679241844294784 +318298@36174516703076488 +318363@2594638538654417024 +318430@288795602454642816 +318497@298365682943330560 +318564@289358483973800192 +318632@144697933550354564 +318699@1297601845971714176 +318765@1155182173544841344 +318834@2326118038056994944 +318904@4629735739033190656 +318975@288828648454098952 +319042@4629735739033190656 +319113@577059024605810696 +319181@4629735739033190656 +319252@2310629187632791584 +319322@144397763654779136 +319388@648800922985570432 +319455@72339350326595513 +319521@72339620920066176 +319586@289360691318620288 +319655@289357382012617856 +319723@72339620920066176 +319788@612524871200800896 +319856@1154051819807310336 +319925@36176131568763136 +319992@306280097707460616 +320059@1369094286720630656 +320127@289426782783340672 +320194@1225544267217766418 +320263@289497565584688256 +320330@316663372973060 +320410@154620786710 +320479@2306090401510850582 +320549@1154051802560202496 +320618@36589547951357952 +320683@962342158448 +320755@149533615063168 +320828@1152921504598460415 +320903@-281474976710528 +320968@205520895 +321109@128 +321853@4128238 +321992@4193416 +322196@35184372090879 +322274@1073741823 +322353@70368744177664 +322428@324263292983844864 +322518@-2296792930213297653 +322583@87817856271515647 +322648@1157433935899201792 +322718@-65408 +322783@72198900610896639 +322848@72198882360181888 +322913@144679241844294784 +322978@36174516703076488 +323043@2594638538654417024 +323110@288795602454642816 +323177@298365682943330560 +323244@289358483973800192 +323312@144697933550354564 +323379@1297601845971714176 +323445@1155182173544841344 +323514@2326118038056994944 +323584@4629735739033190656 +323655@288828648454098952 +323722@4629735739033190656 +323793@577059024605810696 +323861@4629735739033190656 +323932@2310629187632791584 +324002@144397763654779136 +324068@648800922985570432 +324135@72339350326595513 +324201@72339620920066176 +324266@289360691318620288 +324335@289357382012617856 +324403@72339620920066176 +324468@612524871200800896 +324536@1154051819807310336 +324605@36176131568763136 +324672@306280097707460616 +324739@1369094286720630656 +324807@289426782783340672 +324874@1225544267217766418 +324943@289497565584688256 +325010@316663372973060 +325090@154620786710 +325159@2306090401510850582 +325229@1154051802560202496 +325298@36589547951357952 +325363@962342158448 +325435@149533615063168 +325508@1152921504598460415 +325583@-281474976710528 +325648@205520895 +325789@128 +326533@4128238 +326672@4193416 +326876@70368744179711 +326955@1073741823 +327034@70368744177664 +327109@162131646961688576 +327197@-4593585860426595306 +327262@175635712543031295 +327328@1157433935899201792 +327398@-65408 +327463@72198900610896639 +327528@72198882360181888 +327593@144679241844294784 +327658@36174516703076488 +327723@2594638538654417024 +327790@288795602454642816 +327857@298365682943330560 +327924@289358483973800192 +327992@144697933550354564 +328059@1297601845971714176 +328125@1155182173544841344 +328194@2326118038056994944 +328264@4629735739033190656 +328335@288828648454098952 +328402@4629735739033190656 +328473@577059024605810696 +328541@4629735739033190656 +328612@2310629187632791584 +328682@144397763654779136 +328748@648800922985570432 +328815@72339350326595513 +328881@72339620920066176 +328946@289360691318620288 +329015@289357382012617856 +329083@72339620920066176 +329148@612524871200800896 +329216@1154051819807310336 +329285@36176131568763136 +329352@306280097707460616 +329419@1369094286720630656 +329487@289426782783340672 +329554@1225544267217766418 +329623@289497565584688256 +329690@316663372973060 +329770@154620786710 +329839@2306090401510850582 +329909@1154051802560202496 +329978@36589547951357952 +330043@962342158448 +330115@149533615063168 +330188@1152921504598460415 +330263@-281474976710528 +330328@406847487 +330470@128 +331215@4128238 +331354@4193416 +331559@140737488357375 +331640@2147483647 +331722@281474976710656 +331800@-8070318727352016896 +331895@-4593585860426595306 +331960@175635712543031295 +332026@1157433935899201792 +332096@-65408 +332161@72198900610896639 +332226@72198882360181888 +332291@144679241844294784 +332356@36174516703076488 +332421@2594638538654417024 +332488@288795602454642816 +332555@298365682943330560 +332622@289358483973800192 +332690@144697933550354564 +332757@1297601845971714176 +332823@1155182173544841344 +332892@2326118038056994944 +332962@4629735739033190656 +333033@288828648454098952 +333100@4629735739033190656 +333171@577059024605810696 +333239@4629735739033190656 +333310@2310629187632791584 +333380@144397763654779136 +333446@648800922985570432 +333513@72339350326595513 +333579@72339620920066176 +333644@289360691318620288 +333713@289357382012617856 +333781@72339620920066176 +333846@612524871200800896 +333914@1154051819807310336 +333983@36176131568763136 +334050@306280097707460616 +334117@1369094286720630656 +334185@289426782783340672 +334252@1225544267217766418 +334321@289497565584688256 +334388@316663372973060 +334468@154620786710 +334537@2306090401510850582 +334607@1154051802560202496 +334676@36589547951357952 +334741@962342158448 +334813@149533615063168 +334886@1152921504598460415 +334961@-281474976710528 +335026@205520895 +335167@128 +335911@4128238 +336050@4193416 +336254@8796093024255 +336330@1073741823 +336409@70368744177664 +336484@-8070318727352016896 +336579@-2296792930213297653 +336644@87817856271515647 +336709@1157433935899201792 +336779@-65408 +336844@72198900610896639 +336909@72198882360181888 +336974@144679241844294784 +337039@36174516703076488 +337104@2594638538654417024 +337171@288795602454642816 +337238@298365682943330560 +337305@289358483973800192 +337373@144697933550354564 +337440@1297601845971714176 +337506@1155182173544841344 +337575@2326118038056994944 +337645@4629735739033190656 +337716@288828648454098952 +337783@4629735739033190656 +337854@577059024605810696 +337922@4629735739033190656 +337993@2310629187632791584 +338063@144397763654779136 +338129@648800922985570432 +338196@72339350326595513 +338262@72339620920066176 +338327@289360691318620288 +338396@289357382012617856 +338464@72339620920066176 +338529@612524871200800896 +338597@1154051819807310336 +338666@36176131568763136 +338733@306280097707460616 +338800@1369094286720630656 +338868@289426782783340672 +338935@1225544267217766418 +339004@289497565584688256 +339071@316663372973060 +339151@154620786710 +339220@2306090401510850582 +339290@1154051802560202496 +339359@36589547951357952 +339424@962342158448 +339496@149533615063168 +339569@1152921504598460415 +339644@-281474976710528 +339709@205520895 +339850@128 +340594@4128238 +340733@4193416 +340937@8796093024255 +341013@1073741823 +341092@70368744177664 +341167@-8070318727352016896 +341261@-4593585860426595306 +341326@175635712543031295 +341392@1157433935899201792 +341462@-65408 +341527@72198900610896639 +341592@72198882360181888 +341657@144679241844294784 +341722@36174516703076488 +341787@2594638538654417024 +341854@288795602454642816 +341921@298365682943330560 +341988@289358483973800192 +342056@144697933550354564 +342123@1297601845971714176 +342189@1155182173544841344 +342258@2326118038056994944 +342328@4629735739033190656 +342399@288828648454098952 +342466@4629735739033190656 +342537@577059024605810696 +342605@4629735739033190656 +342676@2310629187632791584 +342746@144397763654779136 +342812@648800922985570432 +342879@72339350326595513 +342945@72339620920066176 +343010@289360691318620288 +343079@289357382012617856 +343147@72339620920066176 +343212@612524871200800896 +343280@1154051819807310336 +343349@36176131568763136 +343416@306280097707460616 +343483@1369094286720630656 +343551@289426782783340672 +343618@1225544267217766418 +343687@289497565584688256 +343754@316663372973060 +343834@154620786710 +343903@2306090401510850582 +343973@1154051802560202496 +344042@36589547951357952 +344107@962342158448 +344179@1153071038221910144 +344248@-8761569710592 +344313@-8610811783789674497 +344383@-9205287131624238960 +344448@684547143360315391 +344513@2468043239960158213 +344578@4773886249173782544 +344649@306544949959131392 +344716@-8899042219522973184 +344788@289358483973800192 +344856@144697933550354564 +344923@2594638538654417024 +344990@288795602454642816 +345057@298365682943330560 +345124@144679241986932992 +345190@4629849985012466696 +345262@4901046701156237440 +345334@4620728475085504640 +345405@153157709411125376 +345472@4620728475085504640 +345543@306315418822248576 +345611@72339348204355712 +345677@2314885461828993152 +345745@288516266422043136 +345812@-288655010827271936 +345877@146375818409672965 +345945@289357379881992320 +346013@-261675169054592 +346078@292751636819345922 +346147@578713655940546688 +346218@72198881821196416 +346283@-142984881498980224 +346348@-7349733270247896065 +346415@-8761590661056 +346480@2630172828556591103 +346549@72341611904827520 +346615@289497565585477668 +346683@-1296471267749656568 +346748@405323966468063291 +346814@3242591731744506335 +346889@8072711129098363007 +346984@149533615063168 +347052@8072711129098363007 +347147@-8070300998632865664 +347213@7493989780246499068 +347278@-2198486515712 +347343@34493964287 +347420@13469017440255 +347577@128 +348321@4128238 +348460@4193416 +348664@35184372090879 +348742@1073741823 +348821@70368744177664 +348896@324263292983844864 +348986@-35175784251381 +349051@551903428607 +349132@13469017440255 +349289@128 +350033@4128238 +350180@16380 +350376@35184372090879 +350454@1073741823 +350533@70368744177664 +350608@324263292983844864 +350698@-35175784251381 +350763@551903428607 +350844@13469017440255 +351001@128 +351745@4128238 +351884@4193416 +352088@35184372090879 +352166@1073741823 +352245@70368744177664 +352320@324263292983844864 +352410@-35175784251381 +352475@551903428607 +352556@13469017440255 +352713@128 +353457@4128238 +353596@4193416 +353800@35184372090879 +353878@1073741823 +353957@70368744177664 +354032@324263292983844864 +354121@-70351568502762 +354186@1103806857215 +354268@26663156973567 +354426@128 +355171@4128238 +355310@4193416 +355515@140737488357375 +355596@2147483647 +355678@281474976710656 +355756@-8070318727352016896 +355851@-70351568502762 +355916@1103806857215 +355998@13469017440255 +356155@128 +356899@4128238 +357038@4193416 +357242@8796093024255 +357318@1073741823 +357397@70368744177664 +357472@-8070318727352016896 +357567@-35175784251381 +357632@551903428607 +357713@13469017440255 +357870@128 +358614@4128238 +358753@4193416 +358957@8796093024255 +359033@1073741823 +359112@70368744177664 +359187@-8070318727352016896 +359281@154620786710 +359349@1153045200755425290 +359418@1154051802560202496 +359487@-85559579644919808 +359552@-5764607523036315609 +359617@81664098005176318 +359683@-547604103104 +359748@163258515249430527 +359815@2310381871134965824 +359885@4629770924196118656 +359955@1161948649723404560 +360025@2310962610771600480 +360094@2621235997648142592 +360165@3476814372190322752 +360231@145243587788146692 +360298@2310962610771600480 +360367@4764878913017250048 +360439@144398866509234240 +360504@577596002362523780 +360571@580973216878592256 +360636@288798001181261888 +360702@-8642398819976183552 +360774@580973218907586816 +360843@297308082665431104 +360909@2323892731698512128 +360980@4764878913016963136 +361045@1161946365570316252 +361115@2314920715727413312 +361185@-7926052767519440640 +361250@-9151172603660943361 +361321@72198885585518720 +361387@4647785460209418496 +361459@-17732369473568704 +361524@4958472005157392767 +361592@-34090712832 +361657@37233896192147455 +361722@1315121602006353024 +361788@40550031849308416 +361853@67514446435713344 +361923@67484398760493060 +361993@574209339036794884 +362059@492719185125632 +362140@1153071038221910144 +362209@-8761569710592 +362274@-8610811783789674497 +362344@-9205287131624238960 +362409@684547143360315391 +362474@2468043239960158213 +362539@4773886249173782544 +362610@306544949959131392 +362677@-8304567068710067712 +362749@289358484527448320 +362816@289468434868142361 +362884@7350439745158742144 +362951@288795744188563584 +363018@316943031406238080 +363085@144679241986932992 +363151@4629849985012466696 +363223@4901046701156237440 +363295@4620728475085504640 +363366@153157709411125376 +363433@4620728475085504640 +363504@306315418822248576 +363572@72339348204355712 +363638@2314885461828993152 +363706@288516266422043136 +363773@-288655010827271936 +363838@146375818409672965 +363906@289357379881992320 +363974@-261675169054592 +364039@292751636819345922 +364108@578713655940546688 +364179@72198881821196416 +364244@-142984881498980224 +364309@-7349733270247896065 +364376@-8761590661056 +364441@2630172828556591103 +364510@72341611904827520 +364576@289497565585477668 +364644@-1296471267749656568 +364709@405323966468063291 +364775@3242591731744506335 +364850@8072711129098363007 +364945@149533615063168 +365013@8072711129098363007 +365108@149533615063168 +365176@4037485862974398591 +365270@576535519127798016 +365338@-8761569710592 +365403@-8610811783789674497 +365473@-9205287131624238960 +365538@684547143360315391 +365603@2468043239960158213 +365668@4773886249173782544 +365739@306544949959131392 +365806@-8304567068710067712 +365878@289358484527448320 +365945@289468434868142361 +366013@7350439745158742144 +366080@288795744188563584 +366147@316943031406238080 +366214@144679241986932992 +366280@4629849985012466696 +366352@4901046701156237440 +366424@4620728475085504640 +366495@153157709411125376 +366562@4620728475085504640 +366633@306315418822248576 +366701@72339348204355712 +366767@2314885461828993152 +366835@288516266422043136 +366902@-288655010827271936 +366967@146375818409672965 +367035@289357379881992320 +367103@-261675169054592 +367168@292751636819345922 +367237@578713655940546688 +367308@72198881821196416 +367373@-142984881498980224 +367438@-7349733270247896065 +367505@-8761590661056 +367570@2630172828556591103 +367639@72341611904827520 +367705@289497565585477668 +367773@-1296471267749656568 +367838@405323966468063291 +367904@3242591731744506335 +367979@8072711129098363007 +368074@149533615063168 +368142@8072711129098363007 +368237@1153071038221910144 +368306@-8761569710592 +368371@-8610811783789674497 +368441@-9205287131624238960 +368506@684547143360315391 +368571@2468043239960158213 +368636@4773886249173782544 +368707@306544949959131392 +368774@-8304567068710067712 +368846@289358484527448320 +368913@289468434868142361 +368981@7350439745158742144 +369048@288795744188563584 +369115@316943031406238080 +369182@144679241986932992 +369248@4629849985012466696 +369320@4901046701156237440 +369392@4620728475085504640 +369463@153157709411125376 +369530@4620728475085504640 +369601@306315418822248576 +369669@72339348204355712 +369735@2314885461828993152 +369803@288516266422043136 +369870@-288655010827271936 +369935@146375818409672965 +370003@289357379881992320 +370071@-261675169054592 +370136@292751636819345922 +370205@578713655940546688 +370276@72198881821196416 +370341@-142984881498980224 +370406@-7349733270247896065 +370473@-8761590661056 +370538@2630172828556591103 +370607@72341611904827520 +370673@289497565585477668 +370741@-1296471267749656568 +370806@405323966468063291 +370872@3242591731744506335 +370947@8072711129098363007 +371042@149533615063168 +371110@8072711129098363007 +371205@149533615063168 +371278@1152921504598460415 +371353@-281474976710528 +371418@205520895 +371559@128 +372303@4128238 +372442@4193416 +372646@8796093024255 +372722@1073741823 +372801@70368744177664 +372876@-8070318727352016896 +372971@-35175784251381 +373036@551903428607 +373117@13469017440255 +373274@128 +374018@4128238 +374157@4193416 +374361@8796093024255 +374437@1073741823 +374516@70368744177664 +374591@-8070318727352016896 +374685@-4593585860426595306 +374750@175635712543031295 +374816@1157433935899201792 +374886@-65408 +374951@72198900610896639 +375016@72198882360181888 +375081@144679241844294784 +375146@36174516703076488 +375211@2594638538654417024 +375278@288795602454642816 +375345@298365682943330560 +375412@289358483973800192 +375480@144697933550354564 +375547@2450523350578561152 +375616@1155182173544841344 +375685@-9204227323178384256 +375757@4629735739033190656 +375828@288828648454098952 +375895@4629735739033190656 +375966@577657296908197896 +376034@144397763654779136 +376100@585503273638692992 +376170@72339348204355712 +376236@431781784909545600 +376301@288516266422043136 +376368@577591054568587520 +376436@432344542058938496 +376503@288516266422043136 +376570@4613946618645905664 +376641@72339620920041984 +376706@-558534693355392 +376771@331578074602733835 +376837@72341577545089152 +376903@-431780139294521336 +376968@389561367768727566 +377033@3242591731744506335 +377108@8072711129098363007 +377203@-2305693475598630784 +377268@94575592179499067 +377338@8072711129098363007 +377433@149533615063168 +377506@1152921504598460415 +377581@-281474976710528 +377646@205520895 +377787@128 +378531@4128238 +378678@16380 +378874@35184372090879 +378952@1073741823 +379031@70368744177664 +379106@324263292983844864 +379196@-4593601156415650805 +379261@144309526756065279 +379327@-57702815690034944 +379392@-2091502 +379457@7349646511971655679 +379523@3674824595122440959 +379588@-115405620926461441 +379653@-29193682445792373 +379719@2737963171825942476 +379784@-7494897650158403791 +379849@3629887212059662332 +379915@-3692980065387991047 +379980@3572198489197405375 +380045@-230811254086749441 +380110@-1872274801813462741 +380176@-1269461833838791921 +380241@3461174615525343377 +380306@-7478847296665866133 +380371@2457529492122404917 +380442@-8981092304396548423 +380507@4696797663855919964 +380574@864977117007147776 +380639@-1869711824167564270 +380705@-9076649886820065146 +380779@-216287053858274143 +380844@4695108801110742015 +380913@1154051961676531200 +380982@-267955373111443196 +381047@-9061170844037280769 +381117@2306973466283378176 +381187@5190400778493494400 +381256@5190438170159809664 +381323@4629775735639638015 +381388@-117013323001622492 +381453@-29366751 +381518@-29253314338076161 +381587@-4570555543251779688 +381654@-232991022433647361 +381719@6913932523380667171 +381784@618483149817 +381855@108086938682131478 +381926@1441154354691146120 +382005@-576460752336973857 +382070@33619969 +382141@107752139522047 +382314@256 +383127@16645070 +383284@32764 +383493@35184372092927 +383574@8589934591 +383660@1125899906842624 +383741@5188212676467113984 +383835@77310393355 +383903@63174090931765259 +384007@-72040143585804280 +384072@1128099196436479 +384164@6871947673599 +384320@256 +385056@4160999 +385200@16380 +385393@4398046513151 +385468@1073741823 +385546@35184372088832 +385620@162131646961688576 +385709@77310393355 +385777@15886294844375051 +385877@2033445740080005128 +385984@-158339338670072 +386049@-40534870698491905 +386114@-154628260437 +386179@9218129555212992511 +386244@6916262312931579901 +386309@-324278966796042250 +386374@-1297118606600981153 +386439@-648559303300490561 +386504@-324279651650245281 +386569@-162139825825122641 +386634@-81069912912561321 +386699@-81069762574549291 +386764@-648558272432837141 +386829@-10144095485894737 +386895@-1298444376822796291 +386960@-360367139863921217 +387025@-40534873232146451 +387090@-10144095485894667 +387156@9212111800760260605 +387221@-5764607562024521731 +387286@-2307109818426459265 +387352@-10133717674625281 +387418@-81069741396983811 +387483@-648538139966717973 +387548@-40534870702686785 +387613@7782220151264083949 +387678@-666537736945084417 +387743@-10221060091805697 +387808@-6918167844052010124 +387874@-10414651448918053 +387939@-957502830280723 +388004@-143007980940427265 +388069@1067317182479 +388147@-4088 +388212-392277 +392288@-9223372036602591169 +392356@-140703405441024 +392421@2203318743039 +392504@6871947673599 +392660@256 +393396@4160999 +393540@16380 +393733@4398046513151 +393808@1073741823 +393886@35184372088832 +393960@162131646961688576 +394049@77310393355 +394117@15886294844375051 +394217@2033445740080005128 +394324@-2251254487056376 +394389@35253099888639 +394476@6871947673599 +394632@256 +395368@4160999 +395512@16380 +395705@4398046513151 +395780@1073741823 +395858@35184372088832 +395932@162131646961688576 +396021@77310393355 +396089@15886294844375051 +396189@2033445740080005128 +396296@-281337604866040 +396361@68987977727 +396435@858993459199 +396575@128 +397233@1031927 +397364@8188 +397541@549755814911 +397610@134217727 +397680@1099511627776 +397747@40532911740424192 +397834@77310393355 +397902@8004995496476683 +397999@-2251254487056376 +398064@35253099888639 +398151@6871947673599 +398307@256 +399043@4160999 +399179@4193412 +399380@4398046513151 +399455@1073741823 +399533@35184372088832 +399607@162131646961688576 +399696@77310393355 +399764@15886294844375051 +399864@2033445740080005128 +399971@1024639423549014024 +400075@-2251254487056376 +400140@35253099888639 +400227@6871947673599 +400383@256 +401119@4160999 +401255@4193412 +401456@4398046513151 +401531@1073741823 +401609@35184372088832 +401683@162131646961688576 +401772@77310393355 +401840@15886294844375051 +401940@2033445740080005128 +402047@-2251254487056376 +402112@35253099888639 +402199@6871947673599 +402355@256 +403091@4160999 +403227@4193412 +403428@4398046513151 +403503@1073741823 +403581@35184372088832 +403655@162131646961688576 +403744@77310393355 +403812@15886294844375051 +403912@2033445740080005128 +404019@253329712288366600 +404084@9570149208162307 +404181@-576460752336973857 +404246@33619969 +404317@107752139522047 +404490@256 +405303@16645070 +405460@32764 +405669@35184372092927 +405750@8589934591 +405836@1125899906842624 +405917@5188212676467113984 +406011@77310393355 +406079@63174090931765259 +406183@8106550793227730952 +406253@9570149208162307 +406350@-576460752336973857 +406415@33619969 +406486@107752139522047 +406659@256 +407472@16645070 +407629@32764 +407838@35184372092927 +407919@8589934591 +408005@1125899906842624 +408086@5188212676467113984 +408180@77310393355 +408248@63174090931765259 +408352@8106550793227730952 +408422@9570149208162307 +408504@-6917529008313500160 +408569@9895730348032 +408643@1153045200755425290 +408712@1154051802560202496 +408781@-422226421481472 +408846@-1890947776917766145 +408941@-52778302685180 +409006@-4611686020038049793 +409071@-259 +409136-411743 +411745@-16916997 +411810-414436 +414438@-2459040163351896581 +414503@-8661502089 +414568-417203 +417205@-386370723620463109 +417270@-10769 +417335-417683 +417686@-44138516 +417751-418110 +418113@-2786817 +418178@-2962086848110593 +418243-418547 +418549-418629 +418635@-2242969314656128 +418700@-9205287174709182465 +418768@72198882360181256 +418833@-256 +418898@72339620993439250 +418963@72339620922147396 +419028@1225544251933229188 +419093@72198900743799328 +419158@316380081452816640 +419225@289358484510671104 +419293@144733117922443404 +419360@7206324557082853504 +419427@288795739893596288 +419494@149183945286686976 +419560@1157433934972256512 +419630@2314929407799854088 +419701@4620728471042687104 +419768@-9187268464421568256 +419841@4620728471042687104 +419908@-9187305847816912640 +419981@-9205287131624177536 +420051@72207144866415104 +420116@144397763654779136 +420182@2594638538653843712 +420251@144678698514108345 +420318@144679241840132224 +420384@578716967377174656 +420454@289357382012617856 +420522@144679241840132224 +420588@1188985623504224384 +420657@2308103622367511040 +420727@36176131568763136 +420794@4620728419387181064 +420860@-70092725288444 +420925@5189277108412612607 +420991@72699743330910272 +421056@648800990088153344 +421124@289497565719695616 +421191@1297053168245411859 +421283@-2593790785107263466 +421348@-133691073 +421413@2603230669035929463 +421480@-1123692276809600 +421545@24853360834248703 +421611@-9186066702524186492 +421684@144397801235742848 +421750@-8646345995845566208 +421817@-9205280397114470384 +421889@316380081452816640 +421956@289358484510671104 +422024@144733117922443404 +422091@7206324557082853504 +422158@288795739893596288 +422225@581246930722522240 +422293@2314867869944447232 +422363@-9187268455798013436 +422436@-9205287131624177536 +422504@4629737808955769088 +422576@4629770923657986176 +422643@72207144866415104 +422708@288795527309492480 +422775@1171006547277385984 +422846@144678696391868544 +422913@1440024322122514560 +422980@577032515596976640 +423048@577591054568587520 +423116@864689084117876992 +423184@577032515596976640 +423252@4613946618645905664 +423323@144679241840083456 +423390@-558534693355392 +423455@4652781917064724747 +423529@289426782783340672 +423596@1163336078745141247 +423665@2595203958735653120 +423730@-9185073778504220608 +423802@2595204235230970884 +423872@4217744053506944 +423938@4620711196415229956 +424003@-2139052035 +424068@2598867273330453887 +424134@-8971945893689336 +424199@49623158784786431 +424264@4630915381597339784 +424336@72198917806162048 +424401@2594638813791846656 +424467@2310367568550955016 +424537@85850971711772800 +424602@144679242658021632 +424668@72392949396177048 +424734@3531104684504285312 +424799@144397973034434688 +424865@146508277285405824 +424931@1157433935240691968 +425000@2314887600487334148 +425071@2314885461829517440 +425138@1157443800243667072 +425208@2314885461829517440 +425274@4629772993327857920 +425346@72339620922163328 +425411@1155208626769498128 +425480@144397764728520960 +425546@145801835673159808 +425613@72339623082262656 +425679@144679241844293760 +425745@289919222019129600 +425813@72339623082262656 +425879@577588855536910464 +425948@-9205286994184237040 +426021@-9203668790615670656 +426095@-8065938119204009980 +426163@-4380795330528 +426228@1234003959979442175 +426295@72343810928083072 +426361@144748782792738852 +426428@5621057759891425288 +426499@316663371153536 +426580@2306090401510850582 +426650@1154051802560202496 +426719@36589547951357952 +426784@962342158448 +426856@-71908060422864768 +426921-429880 +429892@31008497791 +429969@520236265283518472 +430070@8086283639265951752 +430181@8086283639265951752 +430292@-4548353590355283960 +430357@2392537302040576 +430438@481980063871 +430525@36589547949129736 +430590@-9223372036854718352 +430658@506659424576733184 +430724@9570149208162307 +430816@481980063871 +430903@8106550793227730952 +430973@9570149208162307 +431050@-43980465111041 +431115@-4649966615270850561 +431180@-4131 +431245-434662 +434680@1152921504598460415 +434755@-281474976710528 +434820@406847487 +434962@128 +435707@4128238 +435854@16380 +436051@562949953423359 +436134@2147483647 +436216@281474976710656 +436294@324263292983844864 +436384@-42 +436449-438119 +438122@-11034634 +438187-438375 +438378@-23617546 +438443-438889 +438902@8072711129098363007 +438997@149533615063168 +439064@-4260888640 +439129@144132853418967295 +439200@49821070877786048 +439265@2252075900600448 +439330@297802724651597952 +439397@576531396999381504 +439465@144678207018238080 +439531@144680337322020864 +439602@144132849249845376 +439668@72339103509643392 +439735@2308112403363008512 +439810@9009402573488256 +439877@9009406868979968 +439944@18016606123720960 +440012@144132788852883712 +440083@72066398721933568 +440153@-586294715574385664 +440218@-9222245587125001987 +440295@-9222245999492200448 +440362@288371130822066172 +440434@4503874522058752 +440503@2252074725150720 +440568@3837084474974666720 +440633@-8522823678 +440698@324540656745725971 +440767@2305913654983524608 +440836@5188212702241112192 +440930@-2451158900629636213 +440995@-4468398075415682 +441060@1170935903116320832 +441130@-8936821919575800 +441195@18084957305962495 +441263@578721349284004416 +441336@36169672500973568 +441405@144132849249845376 +441471@144678207018238080 +441537@144680337322020864 +441608@144132849249845376 +441673@281474980904960 +441746@4503599644147712 +441827@18014398576590848 +441909@288230376420147200 +441997@576460752571858944 +442085@288230376289990516 +442176@287984089842057216 +442241@4611686019501129728 +442318@4611686018964267008 +442407@1501106325680037887 +442478@2485986994306433024 +442545@2316125936178692608 +442622@79165843253568 +442700@68449153850251 +442783@-1125625096044280 +442848@17660909715455 +442934@13469017440255 +443091@128 +443835@4128238 +443974@4193416 +444178@35184372090879 +444256@1073741823 +444335@70368744177664 +444410@324263292983844864 +444500@-279241597878261 +444565@1157715926150283263 +444639@2305843009213173760 +444705@-9222241184850114555 +444782@297802724651597952 +444849@576531396999381504 +444917@144678207018238080 +444983@144680337322020864 +445054@144132849249845376 +445120@4940740235493376128 +445186@298382306673037832 +445251@2598735453316259908 +445319@2326127333448155712 +445388@162272317476570116 +445453@2305878195733398080 +445522@4611756524604491780 +445595@-17454742891724 +445660@-9151312241646067713 +445727@4611827305671589888 +445797@81065823472453632 +445885@-5781035877493 +445950-446327 +446330@-11034634 +446395-446749 +446751@-176554135 +446816-447090 +447103@-176554231 +447168-447361 +447364@-11034634 +447429-447784 +447788@-139730954 +447853-448208 +448212@-90395716812 +448277-449070 +449072@-7 +449137-449839 +449842@-18014248185626362 +449907@1125899906834433 +449972@-281474976710528 +450037@205520895 +450178@128 +450922@4128238 +451069@16380 +451265@35184372090879 +451343@1073741823 +451422@70368744177664 +451497@324263292983844864 +451587@-21 +451652-453306 +453309@-11034634 +453374-453728 +453745@1152921504598460415 +453820@-281474976710528 +453885@205520895 +454026@128 +454770@4128238 +454917@16380 +455113@35184372090879 +455191@1073741823 +455270@70368744177664 +455345@324263292983844864 +455435@-21 +455500-457152 +457159@-1515463873056472796 +457224-461300 +461304@-139730954 +461369-461724 +461731@-1515463873056472796 +461796-465870 +465887@1152921504598460415 +465962@-281474976710528 +466027@205520895 +466168@128 +466912@4128238 +467059@16380 +467255@35184372090879 +467333@1073741823 +467412@70368744177664 +467487@324263292983844864 +467577@-4594677 +467642-467716 +467718@-370260855808440 +467783-468163 +468182@-989664849883525112 +468250@2306045201543593979 +468315@1079898621836787712 +468390@8206834723895377924 +468459@-54056939693268928 +468524@-21698173206513 +468589@-6341068275337658369 +468654@-2690050 +468719-469157 +469162@-3 +469227-469429 +469433@76561339694186495 +469503@-7596439576986238976 +469568@-2217327247363 +469633@17592454611007 +469700@-47393389603175424 +469765-469984 +469997@-23141303517176 +470062-470663 +470668@-2242961845911424 +470733@-9205271878720028673 +470801@72198882360181256 +470866@-256 +470931@72339620993439250 +470996@72339620922147396 +471061@1225544251933229188 +471126@72198900743799328 +471191@298365682943330560 +471258@289358483973800192 +471326@144697933550354564 +471393@2594638538654417024 +471460@288795602454642816 +471527@1162493861445044480 +471596@1157433934972256512 +471665@-9187268455798013436 +471738@2314885461828993152 +471804@4629737808955769088 +471876@2314885461828993152 +471942@-9187268455798013440 +472015@72339620920066176 +472080@2308130131376345096 +472150@144397763654779136 +472216@73744241635230848 +472283@72339348204355712 +472349@289358483680166016 +472416@289919222019129472 +472485@72339348204355712 +472551@2314854623703236736 +472623@4629771061097924616 +472696@-9185654392106188672 +472771@306280097707460616 +472838@648800989683913280 +472906@20266455820141696 +472992@309241573462 +473062@2306090401510850582 +473132@1154051802560202496 +473201@2594106336356728832 +473293@1153045200755425290 +473362@1154051802560202496 +473431@36589547951357952 +473496@962342158448 +473568@-71908060422864768 +473633-475634 +475636@-2626574 +475701-476126 +476129@-3390337061 +476194-476553 +476557@-25166613 +476622@-11140071523 +476687@-84715194320685057 +476752@-689879142671 +476817-477185 +477189@-558923796 +477254-477556 +477558-487020 +487025@-11034682 +487090-487366 +487368@-70351568502753 +487433@1103806857215 +487515@13469017440255 +487672@128 +488416@4128238 +488563@16380 +488759@35184372090879 +488837@1073741823 +488916@70368744177664 +488991@324263292983844864 +489081@-35175784251381 +489146@551903428607 +489227@13469017440255 +489384@128 +490128@4128238 +490275@16380 +490471@35184372090879 +490549@1073741823 +490628@70368744177664 +490703@324263292983844864 +490793@11 +.