From 32aba7cdb3ddf362d87dacd7adb099a83fbe1a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=94=84=EB=A6=AC=EB=A7=88?= Date: Thu, 19 Sep 2024 00:13:24 -0400 Subject: [PATCH] tests --- apps/chat/contract/chat_contract.dib | 64 +- apps/chat/contract/chat_contract.fsx | 1185 +-- apps/chat/contract/chat_contract.rs | 338 +- apps/chat/contract/chat_contract.spi | 59 +- apps/chat/contract/tests/src/main.rs | 20 +- apps/parser/DibParser.dib | 2 +- apps/parser/DibParser.dib.html | 6 +- apps/parser/DibParser.dib.ipynb | 6 +- apps/parser/DibParser.fs | 2 +- apps/spiral/Eval.dib | 24 +- apps/spiral/Eval.dib.html | 75 +- apps/spiral/Eval.dib.ipynb | 39 +- apps/spiral/Eval.fs | 19 +- apps/spiral/Supervisor.dib | 87 +- apps/spiral/Supervisor.dib.html | 1077 +-- apps/spiral/Supervisor.dib.ipynb | 1077 +-- apps/spiral/Supervisor.fs | 57 +- apps/spiral/builder/build.ps1 | 7 +- apps/spiral/builder/spiral_builder.dib | 54 +- apps/spiral/builder/spiral_builder.dib.html | 265 +- apps/spiral/builder/spiral_builder.dib.ipynb | 265 +- apps/spiral/builder/spiral_builder.fsx | 7121 +++++++++--------- apps/spiral/builder/spiral_builder.rs | 2877 +++---- apps/spiral/builder/spiral_builder.spi | 54 +- apps/spiral/supervisor.ts | 2 +- apps/spiral/wasm/build.ps1 | 2 +- lib/fsharp/Common.ts | 8 +- lib/fsharp/common.py | 4 +- lib/spiral/async_.ts | 2 +- lib/spiral/build.ps1 | 2 +- lib/spiral/common.dib.html | 12 +- lib/spiral/common.dib.ipynb | 12 +- lib/spiral/common.py | 16 +- lib/spiral/common.ts | 20 +- lib/spiral/crypto.py | 12 +- lib/spiral/crypto.ts | 20 +- lib/spiral/date_time.ts | 22 +- lib/spiral/file_system.dib | 9 +- lib/spiral/file_system.fsx | 232 +- lib/spiral/file_system.py | 146 +- lib/spiral/file_system.rs | 78 +- lib/spiral/file_system.spi | 9 +- lib/spiral/file_system.ts | 73 +- lib/spiral/file_system_contract.rs | 62 +- lib/spiral/file_system_wasm.rs | 60 +- lib/spiral/lib.fsx | 7 + lib/spiral/lib.ps1 | 30 +- lib/spiral/lib.py | 14 +- lib/spiral/lib.ts | 24 +- lib/spiral/networking.ts | 20 +- lib/spiral/optionm'.dib | 12 + lib/spiral/optionm'.dib.html | 113 +- lib/spiral/optionm'.dib.ipynb | 27 + lib/spiral/optionm'.spi | 7 + lib/spiral/package.spiproj | 2 +- lib/spiral/platform.ts | 4 +- lib/spiral/reflection.dib | 12 +- lib/spiral/reflection.dib.html | 12 +- lib/spiral/reflection.dib.ipynb | 12 +- lib/spiral/reflection.spi | 12 +- lib/spiral/resultm.dib | 4 +- lib/spiral/resultm.dib.html | 4 +- lib/spiral/resultm.dib.ipynb | 4 +- lib/spiral/resultm.spi | 4 +- lib/spiral/runtime.dib.html | 11 +- lib/spiral/runtime.dib.ipynb | 11 +- lib/spiral/runtime.py | 262 +- lib/spiral/runtime.ts | 32 +- lib/spiral/rust/testing.dib.html | 122 +- lib/spiral/rust/testing.dib.ipynb | 122 +- lib/spiral/sm'.dib | 14 +- lib/spiral/sm'.dib.html | 14 +- lib/spiral/sm'.dib.ipynb | 14 +- lib/spiral/sm'.spi | 12 +- lib/spiral/{real_sm'.spir => sm'_real.spir} | 4 +- lib/spiral/sm.py | 76 +- lib/spiral/sm.ts | 18 +- lib/spiral/stream.dib | 24 +- lib/spiral/stream.dib.html | 158 +- lib/spiral/stream.dib.ipynb | 59 +- lib/spiral/stream.spi | 11 +- lib/spiral/threading.ts | 8 +- lib/spiral/threading_.py | 12 +- lib/spiral/trace.ts | 20 +- scripts/core.ps1 | 7 +- 85 files changed, 9227 insertions(+), 7691 deletions(-) rename lib/spiral/{real_sm'.spir => sm'_real.spir} (99%) diff --git a/apps/chat/contract/chat_contract.dib b/apps/chat/contract/chat_contract.dib index 87063b8a7..aa15472a9 100644 --- a/apps/chat/contract/chat_contract.dib +++ b/apps/chat/contract/chat_contract.dib @@ -272,6 +272,42 @@ trace Debug (fun () => "") id #!markdown +### get_account_info + +#!spiral + +inl get_account_info + (state : rust.ref state) + (account_id : near.account_id) + : optionm'.option' (sm'.std_string * (u64 * u32)) + = + inl account_map : rust.ref (near.lookup_map near.account_id sm'.std_string) = + !\($'$"&!state.2"') + + inl alias_map : rust.ref (near.lookup_map sm'.std_string (mapm.hash_map near.account_id (u64 * u32))) = + !\($'$"&!state.1"') + + !\\(account_id, $'"let result = !account_map.get(&$0).and_then(|alias| { //"') : () + !\($'" !alias_map //"') : () + !\($'" .get(alias) //"') : () + !\($'" .map(|accounts| { //"') : () + !\($'" let result = (alias.clone(), *accounts.get(&!account_id).unwrap()); //"') : () + !\($'" (result.0, result.1.0, result.1.1) //"') : () + !\($'" }) //"') : () + !\($'"}); //"') : () + + inl result = !\($'"result"') + + trace Debug + fun () => $'$"chat_contract.get_account_info"' + fun () => { account_id result } + + trace Debug (fun () => "") id + + result + +#!markdown + ### main #!spiral @@ -368,31 +404,17 @@ inl main () = !\($'"pub fn get_account_info( //"') : () !\($'" &self, //"') : () !\($'" account_id: near_sdk::AccountId, //"') : () - !\($'") -> Option<(String, (u64, u32))> { //"') : () - - inl account_map : rust.ref (near.lookup_map near.account_id sm'.std_string) = - !\($'$"&self.0.2"') - - inl alias_map : rust.ref (near.lookup_map sm'.std_string (mapm.hash_map near.account_id (u64 * u32))) = - !\($'$"&self.0.1"') + !\($'") -> Option<(String, u64, u32)> { //"') : () + inl state = !\($'$"&self.0"') inl account_id : near.account_id = !\($'$"account_id"') - trace Debug - fun () => $'$"chat_contract.get_account_info"' - fun () => { account_id } + inl result = account_id |> get_account_info state + $'let _result = !result in _result |> (fun x -> Fable.Core.RustInterop.emitRustExpr x "$0 } // 4") // 3' : () - trace Debug (fun () => "") id - - !\\(account_id, $'" !account_map.get(&$0).and_then(|alias| { //"') : () - !\($'" !alias_map //"') : () - !\($'" .get(alias) //"') : () - !\($'" .map(|accounts| (alias.clone(), *accounts.get(&!account_id).unwrap())) //"') : () - !\($'" }) //"') : () + !\($'"} // 2"') : () - !\($'"} //"') : () - - !\($'"} //"') : () + !\($'"} // 1"') : () 2 @@ -466,7 +488,7 @@ inl main () = // !\($'"} // b"') : () !\($'"fn _main() //"') : () - !\($'"{ //"') : () + !\($'"{ { //"') : () inl rec loop' i' = if i' <= n diff --git a/apps/chat/contract/chat_contract.fsx b/apps/chat/contract/chat_contract.fsx index f4cc2fd8c..ee74628e2 100644 --- a/apps/chat/contract/chat_contract.fsx +++ b/apps/chat/contract/chat_contract.fsx @@ -2683,519 +2683,575 @@ and closure17 () () : unit = _v641 let v692 : (string -> unit) = v17.l0 v692 v639 -and closure18 (v0 : near_sdk_AccountId) () : unit = - let v1 : unit = () - let v2 : (unit -> unit) = closure3() - let v3 : unit = (fun () -> v2 (); v1) () - let struct (v17 : Mut0, v18 : Mut1, v19 : Mut2, v20 : Mut3, v21 : Mut4, v22 : int64 option) = TraceState.trace_state.Value - let v35 : unit = () - let v36 : unit = (fun () -> v2 (); v35) () - let struct (v50 : Mut0, v51 : Mut1, v52 : Mut2, v53 : Mut3, v54 : Mut4, v55 : int64 option) = TraceState.trace_state.Value - let v68 : US0 = v54.l0 - let v69 : bool = v52.l0 - let v70 : bool = v69 = false - let v73 : bool = - if v70 then +and closure18 (v0 : near_sdk_AccountId, v1 : struct (std_string_String * uint64 * uint32) option) () : unit = + let v2 : unit = () + let v3 : (unit -> unit) = closure3() + let v4 : unit = (fun () -> v3 (); v2) () + let struct (v18 : Mut0, v19 : Mut1, v20 : Mut2, v21 : Mut3, v22 : Mut4, v23 : int64 option) = TraceState.trace_state.Value + let v36 : unit = () + let v37 : unit = (fun () -> v3 (); v36) () + let struct (v51 : Mut0, v52 : Mut1, v53 : Mut2, v54 : Mut3, v55 : Mut4, v56 : int64 option) = TraceState.trace_state.Value + let v69 : US0 = v55.l0 + let v70 : bool = v53.l0 + let v71 : bool = v70 = false + let v74 : bool = + if v71 then false else - let v71 : int32 = [ US0_0, 0; US0_1, 1; US0_2, 2; US0_3, 3; US0_4, 4 ] |> Map |> Map.find v68 - let v72 : bool = 1 >= v71 - v72 - if v73 then - let v74 : unit = () - let v75 : (unit -> unit) = closure7(v17) - let v76 : unit = (fun () -> v75 (); v74) () - let v79 : unit = () - let v80 : unit = (fun () -> v2 (); v79) () - let struct (v94 : Mut0, v95 : Mut1, v96 : Mut2, v97 : Mut3, v98 : Mut4, v99 : int64 option) = TraceState.trace_state.Value - let v112 : unit = () + let v72 : int32 = [ US0_0, 0; US0_1, 1; US0_2, 2; US0_3, 3; US0_4, 4 ] |> Map |> Map.find v69 + let v73 : bool = 1 >= v72 + v73 + if v74 then + let v75 : unit = () + let v76 : (unit -> unit) = closure7(v18) + let v77 : unit = (fun () -> v76 (); v75) () + let v80 : unit = () + let v81 : unit = (fun () -> v3 (); v80) () + let struct (v95 : Mut0, v96 : Mut1, v97 : Mut2, v98 : Mut3, v99 : Mut4, v100 : int64 option) = TraceState.trace_state.Value + let v113 : unit = () #if FABLE_COMPILER || WASM || CONTRACT #if FABLE_COMPILER_RUST && !WASM && !CONTRACT - let v113 : US3 option = None - let _v113 = ref v113 - let v114 : US3 option ref = _v113 - let v115 : (US3 option -> US3 option ref) = closure8(v114) - let v116 : unit = () - let v117 : (unit -> unit) = closure9(v99, v115) - let v118 : unit = (fun () -> v117 (); v116) () - let v121 : US3 option = _v113.Value - let v132 : US3 = US3_1 - let v133 : US3 = v121 |> Option.defaultValue v132 - let v173 : System.DateTime = - match v133 with + let v114 : US3 option = None + let _v114 = ref v114 + let v115 : US3 option ref = _v114 + let v116 : (US3 option -> US3 option ref) = closure8(v115) + let v117 : unit = () + let v118 : (unit -> unit) = closure9(v100, v116) + let v119 : unit = (fun () -> v118 (); v117) () + let v122 : US3 option = _v114.Value + let v133 : US3 = US3_1 + let v134 : US3 = v122 |> Option.defaultValue v133 + let v174 : System.DateTime = + match v134 with | US3_1 -> (* None *) - let v169 : System.DateTime = System.DateTime.Now - v169 - | US3_0(v137) -> (* Some *) - let v138 : System.DateTime = System.DateTime.Now - let v141 : (System.DateTime -> int64) = _.Ticks - let v142 : int64 = v141 v138 - let v145 : int64 = v142 - v137 - let v146 : (int64 -> System.TimeSpan) = System.TimeSpan - let v147 : System.TimeSpan = v146 v145 - let v150 : (System.TimeSpan -> int32) = _.Hours - let v151 : int32 = v150 v147 - let v154 : (System.TimeSpan -> int32) = _.Minutes - let v155 : int32 = v154 v147 - let v158 : (System.TimeSpan -> int32) = _.Seconds - let v159 : int32 = v158 v147 - let v162 : (System.TimeSpan -> int32) = _.Milliseconds - let v163 : int32 = v162 v147 - let v166 : System.DateTime = System.DateTime (1, 1, 1, v151, v155, v159, v163) - v166 - let v174 : string = method5() - let v177 : (string -> string) = v173.ToString - let v178 : string = v177 v174 - let _v112 = v178 + let v170 : System.DateTime = System.DateTime.Now + v170 + | US3_0(v138) -> (* Some *) + let v139 : System.DateTime = System.DateTime.Now + let v142 : (System.DateTime -> int64) = _.Ticks + let v143 : int64 = v142 v139 + let v146 : int64 = v143 - v138 + let v147 : (int64 -> System.TimeSpan) = System.TimeSpan + let v148 : System.TimeSpan = v147 v146 + let v151 : (System.TimeSpan -> int32) = _.Hours + let v152 : int32 = v151 v148 + let v155 : (System.TimeSpan -> int32) = _.Minutes + let v156 : int32 = v155 v148 + let v159 : (System.TimeSpan -> int32) = _.Seconds + let v160 : int32 = v159 v148 + let v163 : (System.TimeSpan -> int32) = _.Milliseconds + let v164 : int32 = v163 v148 + let v167 : System.DateTime = System.DateTime (1, 1, 1, v152, v156, v160, v164) + v167 + let v175 : string = method5() + let v178 : (string -> string) = v174.ToString + let v179 : string = v178 v175 + let _v113 = v179 #endif #if FABLE_COMPILER_RUST && WASM - let v181 : US3 option = None - let _v181 = ref v181 - let v182 : US3 option ref = _v181 - let v183 : (US3 option -> US3 option ref) = closure8(v182) - let v184 : unit = () - let v185 : (unit -> unit) = closure9(v99, v183) - let v186 : unit = (fun () -> v185 (); v184) () - let v189 : US3 option = _v181.Value - let v200 : US3 = US3_1 - let v201 : US3 = v189 |> Option.defaultValue v200 - let v241 : System.DateTime = - match v201 with + let v182 : US3 option = None + let _v182 = ref v182 + let v183 : US3 option ref = _v182 + let v184 : (US3 option -> US3 option ref) = closure8(v183) + let v185 : unit = () + let v186 : (unit -> unit) = closure9(v100, v184) + let v187 : unit = (fun () -> v186 (); v185) () + let v190 : US3 option = _v182.Value + let v201 : US3 = US3_1 + let v202 : US3 = v190 |> Option.defaultValue v201 + let v242 : System.DateTime = + match v202 with | US3_1 -> (* None *) - let v237 : System.DateTime = System.DateTime.Now - v237 - | US3_0(v205) -> (* Some *) - let v206 : System.DateTime = System.DateTime.Now - let v209 : (System.DateTime -> int64) = _.Ticks - let v210 : int64 = v209 v206 - let v213 : int64 = v210 - v205 - let v214 : (int64 -> System.TimeSpan) = System.TimeSpan - let v215 : System.TimeSpan = v214 v213 - let v218 : (System.TimeSpan -> int32) = _.Hours - let v219 : int32 = v218 v215 - let v222 : (System.TimeSpan -> int32) = _.Minutes - let v223 : int32 = v222 v215 - let v226 : (System.TimeSpan -> int32) = _.Seconds - let v227 : int32 = v226 v215 - let v230 : (System.TimeSpan -> int32) = _.Milliseconds - let v231 : int32 = v230 v215 - let v234 : System.DateTime = System.DateTime (1, 1, 1, v219, v223, v227, v231) - v234 - let v242 : string = method5() - let v245 : (string -> string) = v241.ToString - let v246 : string = v245 v242 - let _v112 = v246 + let v238 : System.DateTime = System.DateTime.Now + v238 + | US3_0(v206) -> (* Some *) + let v207 : System.DateTime = System.DateTime.Now + let v210 : (System.DateTime -> int64) = _.Ticks + let v211 : int64 = v210 v207 + let v214 : int64 = v211 - v206 + let v215 : (int64 -> System.TimeSpan) = System.TimeSpan + let v216 : System.TimeSpan = v215 v214 + let v219 : (System.TimeSpan -> int32) = _.Hours + let v220 : int32 = v219 v216 + let v223 : (System.TimeSpan -> int32) = _.Minutes + let v224 : int32 = v223 v216 + let v227 : (System.TimeSpan -> int32) = _.Seconds + let v228 : int32 = v227 v216 + let v231 : (System.TimeSpan -> int32) = _.Milliseconds + let v232 : int32 = v231 v216 + let v235 : System.DateTime = System.DateTime (1, 1, 1, v220, v224, v228, v232) + v235 + let v243 : string = method5() + let v246 : (string -> string) = v242.ToString + let v247 : string = v246 v243 + let _v113 = v247 #endif #if FABLE_COMPILER_RUST && CONTRACT - let v249 : string = $"near_sdk::env::block_timestamp()" - let v250 : uint64 = Fable.Core.RustInterop.emitRustExpr () v249 - let v251 : US3 option = None - let _v251 = ref v251 - let v252 : US3 option ref = _v251 - let v253 : (US3 option -> US3 option ref) = closure8(v252) - let v254 : unit = () - let v255 : (unit -> unit) = closure9(v99, v253) - let v256 : unit = (fun () -> v255 (); v254) () - let v259 : US3 option = _v251.Value - let v270 : US3 = US3_1 - let v271 : US3 = v259 |> Option.defaultValue v270 - let v280 : uint64 = - match v271 with + let v250 : string = $"near_sdk::env::block_timestamp()" + let v251 : uint64 = Fable.Core.RustInterop.emitRustExpr () v250 + let v252 : US3 option = None + let _v252 = ref v252 + let v253 : US3 option ref = _v252 + let v254 : (US3 option -> US3 option ref) = closure8(v253) + let v255 : unit = () + let v256 : (unit -> unit) = closure9(v100, v254) + let v257 : unit = (fun () -> v256 (); v255) () + let v260 : US3 option = _v252.Value + let v271 : US3 = US3_1 + let v272 : US3 = v260 |> Option.defaultValue v271 + let v281 : uint64 = + match v272 with | US3_1 -> (* None *) - v250 - | US3_0(v275) -> (* Some *) - let v276 : (int64 -> uint64) = uint64 - let v277 : uint64 = v276 v275 - let v278 : uint64 = v250 - v277 - v278 - let v281 : uint64 = v280 / 1000000000UL - let v282 : uint64 = v281 % 60UL - let v283 : uint64 = v281 / 60UL - let v284 : uint64 = v283 % 60UL - let v285 : uint64 = v281 / 3600UL - let v286 : uint64 = v285 % 24UL - let v287 : string = $"format!(\"{{:02}}:{{:02}}:{{:02}}\", $0, $1, $2)" - let v288 : std_string_String = Fable.Core.RustInterop.emitRustExpr struct (v286, v284, v282) v287 - let v289 : string = "fable_library_rust::String_::fromString($0)" - let v290 : string = Fable.Core.RustInterop.emitRustExpr v288 v289 - let _v112 = v290 + v251 + | US3_0(v276) -> (* Some *) + let v277 : (int64 -> uint64) = uint64 + let v278 : uint64 = v277 v276 + let v279 : uint64 = v251 - v278 + v279 + let v282 : uint64 = v281 / 1000000000UL + let v283 : uint64 = v282 % 60UL + let v284 : uint64 = v282 / 60UL + let v285 : uint64 = v284 % 60UL + let v286 : uint64 = v282 / 3600UL + let v287 : uint64 = v286 % 24UL + let v288 : string = $"format!(\"{{:02}}:{{:02}}:{{:02}}\", $0, $1, $2)" + let v289 : std_string_String = Fable.Core.RustInterop.emitRustExpr struct (v287, v285, v283) v288 + let v290 : string = "fable_library_rust::String_::fromString($0)" + let v291 : string = Fable.Core.RustInterop.emitRustExpr v289 v290 + let _v113 = v291 #endif #if FABLE_COMPILER_TYPESCRIPT - let v291 : US3 option = None - let _v291 = ref v291 - let v292 : US3 option ref = _v291 - let v293 : (US3 option -> US3 option ref) = closure8(v292) - let v294 : unit = () - let v295 : (unit -> unit) = closure9(v99, v293) - let v296 : unit = (fun () -> v295 (); v294) () - let v299 : US3 option = _v291.Value - let v310 : US3 = US3_1 - let v311 : US3 = v299 |> Option.defaultValue v310 - let v351 : System.DateTime = - match v311 with + let v292 : US3 option = None + let _v292 = ref v292 + let v293 : US3 option ref = _v292 + let v294 : (US3 option -> US3 option ref) = closure8(v293) + let v295 : unit = () + let v296 : (unit -> unit) = closure9(v100, v294) + let v297 : unit = (fun () -> v296 (); v295) () + let v300 : US3 option = _v292.Value + let v311 : US3 = US3_1 + let v312 : US3 = v300 |> Option.defaultValue v311 + let v352 : System.DateTime = + match v312 with | US3_1 -> (* None *) - let v347 : System.DateTime = System.DateTime.Now - v347 - | US3_0(v315) -> (* Some *) - let v316 : System.DateTime = System.DateTime.Now - let v319 : (System.DateTime -> int64) = _.Ticks - let v320 : int64 = v319 v316 - let v323 : int64 = v320 - v315 - let v324 : (int64 -> System.TimeSpan) = System.TimeSpan - let v325 : System.TimeSpan = v324 v323 - let v328 : (System.TimeSpan -> int32) = _.Hours - let v329 : int32 = v328 v325 - let v332 : (System.TimeSpan -> int32) = _.Minutes - let v333 : int32 = v332 v325 - let v336 : (System.TimeSpan -> int32) = _.Seconds - let v337 : int32 = v336 v325 - let v340 : (System.TimeSpan -> int32) = _.Milliseconds - let v341 : int32 = v340 v325 - let v344 : System.DateTime = System.DateTime (1, 1, 1, v329, v333, v337, v341) - v344 - let v352 : string = method6() - let v355 : (string -> string) = v351.ToString - let v356 : string = v355 v352 - let _v112 = v356 + let v348 : System.DateTime = System.DateTime.Now + v348 + | US3_0(v316) -> (* Some *) + let v317 : System.DateTime = System.DateTime.Now + let v320 : (System.DateTime -> int64) = _.Ticks + let v321 : int64 = v320 v317 + let v324 : int64 = v321 - v316 + let v325 : (int64 -> System.TimeSpan) = System.TimeSpan + let v326 : System.TimeSpan = v325 v324 + let v329 : (System.TimeSpan -> int32) = _.Hours + let v330 : int32 = v329 v326 + let v333 : (System.TimeSpan -> int32) = _.Minutes + let v334 : int32 = v333 v326 + let v337 : (System.TimeSpan -> int32) = _.Seconds + let v338 : int32 = v337 v326 + let v341 : (System.TimeSpan -> int32) = _.Milliseconds + let v342 : int32 = v341 v326 + let v345 : System.DateTime = System.DateTime (1, 1, 1, v330, v334, v338, v342) + v345 + let v353 : string = method6() + let v356 : (string -> string) = v352.ToString + let v357 : string = v356 v353 + let _v113 = v357 #endif #if FABLE_COMPILER_PYTHON - let v359 : US3 option = None - let _v359 = ref v359 - let v360 : US3 option ref = _v359 - let v361 : (US3 option -> US3 option ref) = closure8(v360) - let v362 : unit = () - let v363 : (unit -> unit) = closure9(v99, v361) - let v364 : unit = (fun () -> v363 (); v362) () - let v367 : US3 option = _v359.Value - let v378 : US3 = US3_1 - let v379 : US3 = v367 |> Option.defaultValue v378 - let v419 : System.DateTime = - match v379 with + let v360 : US3 option = None + let _v360 = ref v360 + let v361 : US3 option ref = _v360 + let v362 : (US3 option -> US3 option ref) = closure8(v361) + let v363 : unit = () + let v364 : (unit -> unit) = closure9(v100, v362) + let v365 : unit = (fun () -> v364 (); v363) () + let v368 : US3 option = _v360.Value + let v379 : US3 = US3_1 + let v380 : US3 = v368 |> Option.defaultValue v379 + let v420 : System.DateTime = + match v380 with | US3_1 -> (* None *) - let v415 : System.DateTime = System.DateTime.Now - v415 - | US3_0(v383) -> (* Some *) - let v384 : System.DateTime = System.DateTime.Now - let v387 : (System.DateTime -> int64) = _.Ticks - let v388 : int64 = v387 v384 - let v391 : int64 = v388 - v383 - let v392 : (int64 -> System.TimeSpan) = System.TimeSpan - let v393 : System.TimeSpan = v392 v391 - let v396 : (System.TimeSpan -> int32) = _.Hours - let v397 : int32 = v396 v393 - let v400 : (System.TimeSpan -> int32) = _.Minutes - let v401 : int32 = v400 v393 - let v404 : (System.TimeSpan -> int32) = _.Seconds - let v405 : int32 = v404 v393 - let v408 : (System.TimeSpan -> int32) = _.Milliseconds - let v409 : int32 = v408 v393 - let v412 : System.DateTime = System.DateTime (1, 1, 1, v397, v401, v405, v409) - v412 - let v420 : string = method6() - let v423 : (string -> string) = v419.ToString - let v424 : string = v423 v420 - let _v112 = v424 + let v416 : System.DateTime = System.DateTime.Now + v416 + | US3_0(v384) -> (* Some *) + let v385 : System.DateTime = System.DateTime.Now + let v388 : (System.DateTime -> int64) = _.Ticks + let v389 : int64 = v388 v385 + let v392 : int64 = v389 - v384 + let v393 : (int64 -> System.TimeSpan) = System.TimeSpan + let v394 : System.TimeSpan = v393 v392 + let v397 : (System.TimeSpan -> int32) = _.Hours + let v398 : int32 = v397 v394 + let v401 : (System.TimeSpan -> int32) = _.Minutes + let v402 : int32 = v401 v394 + let v405 : (System.TimeSpan -> int32) = _.Seconds + let v406 : int32 = v405 v394 + let v409 : (System.TimeSpan -> int32) = _.Milliseconds + let v410 : int32 = v409 v394 + let v413 : System.DateTime = System.DateTime (1, 1, 1, v398, v402, v406, v410) + v413 + let v421 : string = method6() + let v424 : (string -> string) = v420.ToString + let v425 : string = v424 v421 + let _v113 = v425 #endif #else - let v427 : US3 option = None - let _v427 = ref v427 - let v428 : US3 option ref = _v427 - let v429 : (US3 option -> US3 option ref) = closure8(v428) - let v430 : unit = () - let v431 : (unit -> unit) = closure9(v99, v429) - let v432 : unit = (fun () -> v431 (); v430) () - let v435 : US3 option = _v427.Value - let v446 : US3 = US3_1 - let v447 : US3 = v435 |> Option.defaultValue v446 - let v487 : System.DateTime = - match v447 with + let v428 : US3 option = None + let _v428 = ref v428 + let v429 : US3 option ref = _v428 + let v430 : (US3 option -> US3 option ref) = closure8(v429) + let v431 : unit = () + let v432 : (unit -> unit) = closure9(v100, v430) + let v433 : unit = (fun () -> v432 (); v431) () + let v436 : US3 option = _v428.Value + let v447 : US3 = US3_1 + let v448 : US3 = v436 |> Option.defaultValue v447 + let v488 : System.DateTime = + match v448 with | US3_1 -> (* None *) - let v483 : System.DateTime = System.DateTime.Now - v483 - | US3_0(v451) -> (* Some *) - let v452 : System.DateTime = System.DateTime.Now - let v455 : (System.DateTime -> int64) = _.Ticks - let v456 : int64 = v455 v452 - let v459 : int64 = v456 - v451 - let v460 : (int64 -> System.TimeSpan) = System.TimeSpan - let v461 : System.TimeSpan = v460 v459 - let v464 : (System.TimeSpan -> int32) = _.Hours - let v465 : int32 = v464 v461 - let v468 : (System.TimeSpan -> int32) = _.Minutes - let v469 : int32 = v468 v461 - let v472 : (System.TimeSpan -> int32) = _.Seconds - let v473 : int32 = v472 v461 - let v476 : (System.TimeSpan -> int32) = _.Milliseconds - let v477 : int32 = v476 v461 - let v480 : System.DateTime = System.DateTime (1, 1, 1, v465, v469, v473, v477) - v480 - let v488 : string = method6() - let v491 : (string -> string) = v487.ToString - let v492 : string = v491 v488 - let _v112 = v492 - #endif - let v495 : string = _v112 + let v484 : System.DateTime = System.DateTime.Now + v484 + | US3_0(v452) -> (* Some *) + let v453 : System.DateTime = System.DateTime.Now + let v456 : (System.DateTime -> int64) = _.Ticks + let v457 : int64 = v456 v453 + let v460 : int64 = v457 - v452 + let v461 : (int64 -> System.TimeSpan) = System.TimeSpan + let v462 : System.TimeSpan = v461 v460 + let v465 : (System.TimeSpan -> int32) = _.Hours + let v466 : int32 = v465 v462 + let v469 : (System.TimeSpan -> int32) = _.Minutes + let v470 : int32 = v469 v462 + let v473 : (System.TimeSpan -> int32) = _.Seconds + let v474 : int32 = v473 v462 + let v477 : (System.TimeSpan -> int32) = _.Milliseconds + let v478 : int32 = v477 v462 + let v481 : System.DateTime = System.DateTime (1, 1, 1, v466, v470, v474, v478) + v481 + let v489 : string = method6() + let v492 : (string -> string) = v488.ToString + let v493 : string = v492 v489 + let _v113 = v493 + #endif + let v496 : string = _v113 - let v565 : string = "Debug" - let v566 : (unit -> string) = v565.ToLower - let v567 : string = v566 () - let v570 : string = v567.PadLeft (7, ' ') - let v584 : unit = () + let v566 : string = "Debug" + let v567 : (unit -> string) = v566.ToLower + let v568 : string = v567 () + let v571 : string = v568.PadLeft (7, ' ') + let v585 : unit = () #if FABLE_COMPILER || WASM || CONTRACT #if FABLE_COMPILER_RUST && !WASM && !CONTRACT - let v585 : string = "inline_colorization::color_bright_blue" - let v586 : Ref = Fable.Core.RustInterop.emitRustExpr () v585 - let v587 : string = "&*$0" - let v588 : Ref = Fable.Core.RustInterop.emitRustExpr v570 v587 - let v589 : string = "inline_colorization::color_reset" - let v590 : Ref = Fable.Core.RustInterop.emitRustExpr () v589 - let v591 : string = "\"{v586}{v588}{v590}\"" - let v592 : string = @$"format!(" + v591 + ")" - let v593 : std_string_String = Fable.Core.RustInterop.emitRustExpr () v592 - let v594 : string = "fable_library_rust::String_::fromString($0)" - let v595 : string = Fable.Core.RustInterop.emitRustExpr v593 v594 - let _v584 = v595 + let v586 : string = "inline_colorization::color_bright_blue" + let v587 : Ref = Fable.Core.RustInterop.emitRustExpr () v586 + let v588 : string = "&*$0" + let v589 : Ref = Fable.Core.RustInterop.emitRustExpr v571 v588 + let v590 : string = "inline_colorization::color_reset" + let v591 : Ref = Fable.Core.RustInterop.emitRustExpr () v590 + let v592 : string = "\"{v587}{v589}{v591}\"" + let v593 : string = @$"format!(" + v592 + ")" + let v594 : std_string_String = Fable.Core.RustInterop.emitRustExpr () v593 + let v595 : string = "fable_library_rust::String_::fromString($0)" + let v596 : string = Fable.Core.RustInterop.emitRustExpr v594 v595 + let _v585 = v596 #endif #if FABLE_COMPILER_RUST && WASM - let v596 : string = "inline_colorization::color_bright_blue" - let v597 : Ref = Fable.Core.RustInterop.emitRustExpr () v596 - let v598 : string = "&*$0" - let v599 : Ref = Fable.Core.RustInterop.emitRustExpr v570 v598 - let v600 : string = "inline_colorization::color_reset" - let v601 : Ref = Fable.Core.RustInterop.emitRustExpr () v600 - let v602 : string = "\"{v597}{v599}{v601}\"" - let v603 : string = @$"format!(" + v602 + ")" - let v604 : std_string_String = Fable.Core.RustInterop.emitRustExpr () v603 - let v605 : string = "fable_library_rust::String_::fromString($0)" - let v606 : string = Fable.Core.RustInterop.emitRustExpr v604 v605 - let _v584 = v606 + let v597 : string = "inline_colorization::color_bright_blue" + let v598 : Ref = Fable.Core.RustInterop.emitRustExpr () v597 + let v599 : string = "&*$0" + let v600 : Ref = Fable.Core.RustInterop.emitRustExpr v571 v599 + let v601 : string = "inline_colorization::color_reset" + let v602 : Ref = Fable.Core.RustInterop.emitRustExpr () v601 + let v603 : string = "\"{v598}{v600}{v602}\"" + let v604 : string = @$"format!(" + v603 + ")" + let v605 : std_string_String = Fable.Core.RustInterop.emitRustExpr () v604 + let v606 : string = "fable_library_rust::String_::fromString($0)" + let v607 : string = Fable.Core.RustInterop.emitRustExpr v605 v606 + let _v585 = v607 #endif #if FABLE_COMPILER_RUST && CONTRACT - let v607 : string = "inline_colorization::color_bright_blue" - let v608 : Ref = Fable.Core.RustInterop.emitRustExpr () v607 - let v609 : string = "&*$0" - let v610 : Ref = Fable.Core.RustInterop.emitRustExpr v570 v609 - let v611 : string = "inline_colorization::color_reset" - let v612 : Ref = Fable.Core.RustInterop.emitRustExpr () v611 - let v613 : string = "\"{v608}{v610}{v612}\"" - let v614 : string = @$"format!(" + v613 + ")" - let v615 : std_string_String = Fable.Core.RustInterop.emitRustExpr () v614 - let v616 : string = "fable_library_rust::String_::fromString($0)" - let v617 : string = Fable.Core.RustInterop.emitRustExpr v615 v616 - let _v584 = v617 + let v608 : string = "inline_colorization::color_bright_blue" + let v609 : Ref = Fable.Core.RustInterop.emitRustExpr () v608 + let v610 : string = "&*$0" + let v611 : Ref = Fable.Core.RustInterop.emitRustExpr v571 v610 + let v612 : string = "inline_colorization::color_reset" + let v613 : Ref = Fable.Core.RustInterop.emitRustExpr () v612 + let v614 : string = "\"{v609}{v611}{v613}\"" + let v615 : string = @$"format!(" + v614 + ")" + let v616 : std_string_String = Fable.Core.RustInterop.emitRustExpr () v615 + let v617 : string = "fable_library_rust::String_::fromString($0)" + let v618 : string = Fable.Core.RustInterop.emitRustExpr v616 v617 + let _v585 = v618 #endif #if FABLE_COMPILER_TYPESCRIPT - let v618 : string = "\u001b[94m" - let v619 : string = method7() - let v620 : string = v618 + v570 - let v621 : string = v620 + v619 - let _v584 = v621 + let v619 : string = "\u001b[94m" + let v620 : string = method7() + let v621 : string = v619 + v571 + let v622 : string = v621 + v620 + let _v585 = v622 #endif #if FABLE_COMPILER_PYTHON - let v622 : string = "\u001b[94m" - let v623 : string = method7() - let v624 : string = v622 + v570 - let v625 : string = v624 + v623 - let _v584 = v625 + let v623 : string = "\u001b[94m" + let v624 : string = method7() + let v625 : string = v623 + v571 + let v626 : string = v625 + v624 + let _v585 = v626 #endif #else - let v626 : string = "\u001b[94m" - let v627 : string = method7() - let v628 : string = v626 + v570 - let v629 : string = v628 + v627 - let _v584 = v629 - #endif - let v630 : string = _v584 - let v636 : int64 = v94.l0 - let v637 : string = method8() - let v638 : Mut3 = {l0 = v637} : Mut3 - let v639 : string = "{ " - let v640 : string = $"{v639}" - let v643 : unit = () - let v644 : (unit -> unit) = closure10(v638, v640) - let v645 : unit = (fun () -> v644 (); v643) () - let v648 : string = "account_id" - let v649 : string = $"{v648}" - let v652 : unit = () - let v653 : (unit -> unit) = closure10(v638, v649) - let v654 : unit = (fun () -> v653 (); v652) () - let v657 : string = " = " - let v658 : string = $"{v657}" - let v661 : unit = () - let v662 : (unit -> unit) = closure10(v638, v658) - let v663 : unit = (fun () -> v662 (); v661) () - let v666 : unit = () + let v627 : string = "\u001b[94m" + let v628 : string = method7() + let v629 : string = v627 + v571 + let v630 : string = v629 + v628 + let _v585 = v630 + #endif + let v631 : string = _v585 + let v637 : int64 = v95.l0 + let v638 : string = method8() + let v639 : Mut3 = {l0 = v638} : Mut3 + let v640 : string = "{ " + let v641 : string = $"{v640}" + let v644 : unit = () + let v645 : (unit -> unit) = closure10(v639, v641) + let v646 : unit = (fun () -> v645 (); v644) () + let v649 : string = "account_id" + let v650 : string = $"{v649}" + let v653 : unit = () + let v654 : (unit -> unit) = closure10(v639, v650) + let v655 : unit = (fun () -> v654 (); v653) () + let v658 : string = " = " + let v659 : string = $"{v658}" + let v662 : unit = () + let v663 : (unit -> unit) = closure10(v639, v659) + let v664 : unit = (fun () -> v663 (); v662) () + let v667 : unit = () #if FABLE_COMPILER || WASM || CONTRACT #if FABLE_COMPILER_RUST && !WASM && !CONTRACT - let v667 : string = "format!(\"{:#?}\", $0)" - let v668 : std_string_String = Fable.Core.RustInterop.emitRustExpr v0 v667 - let v669 : string = "fable_library_rust::String_::fromString($0)" - let v670 : string = Fable.Core.RustInterop.emitRustExpr v668 v669 - let _v666 = v670 + let v668 : string = "format!(\"{:#?}\", $0)" + let v669 : std_string_String = Fable.Core.RustInterop.emitRustExpr v0 v668 + let v670 : string = "fable_library_rust::String_::fromString($0)" + let v671 : string = Fable.Core.RustInterop.emitRustExpr v669 v670 + let _v667 = v671 #endif #if FABLE_COMPILER_RUST && WASM - let v671 : string = "format!(\"{:#?}\", $0)" - let v672 : std_string_String = Fable.Core.RustInterop.emitRustExpr v0 v671 - let v673 : string = "fable_library_rust::String_::fromString($0)" - let v674 : string = Fable.Core.RustInterop.emitRustExpr v672 v673 - let _v666 = v674 + let v672 : string = "format!(\"{:#?}\", $0)" + let v673 : std_string_String = Fable.Core.RustInterop.emitRustExpr v0 v672 + let v674 : string = "fable_library_rust::String_::fromString($0)" + let v675 : string = Fable.Core.RustInterop.emitRustExpr v673 v674 + let _v667 = v675 #endif #if FABLE_COMPILER_RUST && CONTRACT - let v675 : string = "format!(\"{:#?}\", $0)" - let v676 : std_string_String = Fable.Core.RustInterop.emitRustExpr v0 v675 - let v677 : string = "fable_library_rust::String_::fromString($0)" - let v678 : string = Fable.Core.RustInterop.emitRustExpr v676 v677 - let _v666 = v678 + let v676 : string = "format!(\"{:#?}\", $0)" + let v677 : std_string_String = Fable.Core.RustInterop.emitRustExpr v0 v676 + let v678 : string = "fable_library_rust::String_::fromString($0)" + let v679 : string = Fable.Core.RustInterop.emitRustExpr v677 v678 + let _v667 = v679 #endif #if FABLE_COMPILER_TYPESCRIPT - let v679 : string = $"%A{v0}" - let _v666 = v679 + let v680 : string = $"%A{v0}" + let _v667 = v680 #endif #if FABLE_COMPILER_PYTHON - let v682 : string = $"%A{v0}" - let _v666 = v682 + let v683 : string = $"%A{v0}" + let _v667 = v683 #endif #else - let v685 : string = $"%A{v0}" - let _v666 = v685 + let v686 : string = $"%A{v0}" + let _v667 = v686 + #endif + let v689 : string = _v667 + let v694 : string = $"{v689}" + let v697 : unit = () + let v698 : (unit -> unit) = closure10(v639, v694) + let v699 : unit = (fun () -> v698 (); v697) () + let v702 : string = "; " + let v703 : string = $"{v702}" + let v706 : unit = () + let v707 : (unit -> unit) = closure10(v639, v703) + let v708 : unit = (fun () -> v707 (); v706) () + let v711 : string = "result" + let v712 : string = $"{v711}" + let v715 : unit = () + let v716 : (unit -> unit) = closure10(v639, v712) + let v717 : unit = (fun () -> v716 (); v715) () + let v720 : string = $"{v658}" + let v723 : unit = () + let v724 : (unit -> unit) = closure10(v639, v720) + let v725 : unit = (fun () -> v724 (); v723) () + let v728 : unit = () + +#if FABLE_COMPILER || WASM || CONTRACT + +#if FABLE_COMPILER_RUST && !WASM && !CONTRACT + let v729 : string = "format!(\"{:#?}\", $0)" + let v730 : std_string_String = Fable.Core.RustInterop.emitRustExpr v1 v729 + let v731 : string = "fable_library_rust::String_::fromString($0)" + let v732 : string = Fable.Core.RustInterop.emitRustExpr v730 v731 + let _v728 = v732 #endif - let v688 : string = _v666 - let v693 : string = $"{v688}" - let v696 : unit = () - let v697 : (unit -> unit) = closure10(v638, v693) - let v698 : unit = (fun () -> v697 (); v696) () - let v701 : string = " }" - let v702 : string = $"{v701}" - let v705 : unit = () - let v706 : (unit -> unit) = closure10(v638, v702) - let v707 : unit = (fun () -> v706 (); v705) () - let v710 : string = v638.l0 - let v711 : string = $"chat_contract.get_account_info" - let v712 : bool = v711 = "" - let v769 : string = - if v712 then - let v713 : string = "" - v713 +#if FABLE_COMPILER_RUST && WASM + let v733 : string = "format!(\"{:#?}\", $0)" + let v734 : std_string_String = Fable.Core.RustInterop.emitRustExpr v1 v733 + let v735 : string = "fable_library_rust::String_::fromString($0)" + let v736 : string = Fable.Core.RustInterop.emitRustExpr v734 v735 + let _v728 = v736 + #endif +#if FABLE_COMPILER_RUST && CONTRACT + let v737 : string = "format!(\"{:#?}\", $0)" + let v738 : std_string_String = Fable.Core.RustInterop.emitRustExpr v1 v737 + let v739 : string = "fable_library_rust::String_::fromString($0)" + let v740 : string = Fable.Core.RustInterop.emitRustExpr v738 v739 + let _v728 = v740 + #endif +#if FABLE_COMPILER_TYPESCRIPT + let v741 : string = $"%A{v1}" + let _v728 = v741 + #endif +#if FABLE_COMPILER_PYTHON + let v744 : string = $"%A{v1}" + let _v728 = v744 + #endif +#else + let v747 : string = $"%A{v1}" + let _v728 = v747 + #endif + let v750 : string = _v728 + let v755 : string = $"{v750}" + let v758 : unit = () + let v759 : (unit -> unit) = closure10(v639, v755) + let v760 : unit = (fun () -> v759 (); v758) () + let v763 : string = " }" + let v764 : string = $"{v763}" + let v767 : unit = () + let v768 : (unit -> unit) = closure10(v639, v764) + let v769 : unit = (fun () -> v768 (); v767) () + let v772 : string = v639.l0 + let v773 : string = $"chat_contract.get_account_info" + let v774 : bool = v773 = "" + let v831 : string = + if v774 then + let v775 : string = "" + v775 else - let v714 : string = $"{v495} {v630} #{v636} %s{v711} / {v710}" - let v717 : char list = [] - let v718 : (char list -> (char [])) = List.toArray - let v719 : (char []) = v718 v717 - let v722 : string = v714.TrimStart v719 - let v740 : char list = [] - let v741 : char list = '/' :: v740 - let v744 : char list = ' ' :: v741 - let v747 : (char list -> (char [])) = List.toArray - let v748 : (char []) = v747 v744 - let v751 : string = v722.TrimEnd v748 - v751 - let v770 : (string -> unit) = closure11() - let v771 : unit = () + let v776 : string = $"{v496} {v631} #{v637} %s{v773} / {v772}" + let v779 : char list = [] + let v780 : (char list -> (char [])) = List.toArray + let v781 : (char []) = v780 v779 + let v784 : string = v776.TrimStart v781 + let v802 : char list = [] + let v803 : char list = '/' :: v802 + let v806 : char list = ' ' :: v803 + let v809 : (char list -> (char [])) = List.toArray + let v810 : (char []) = v809 v806 + let v813 : string = v784.TrimEnd v810 + v813 + let v832 : (string -> unit) = closure11() + let v833 : unit = () #if FABLE_COMPILER || WASM || CONTRACT #if FABLE_COMPILER_RUST && !WASM && !CONTRACT - let v772 : string = @"println!(""{}"", $0)" - Fable.Core.RustInterop.emitRustExpr v769 v772 - let _v771 = () + let v834 : string = @"println!(""{}"", $0)" + Fable.Core.RustInterop.emitRustExpr v831 v834 + let _v833 = () #endif #if FABLE_COMPILER_RUST && WASM - let v773 : string = @"println!(""{}"", $0)" - Fable.Core.RustInterop.emitRustExpr v769 v773 - let _v771 = () + let v835 : string = @"println!(""{}"", $0)" + Fable.Core.RustInterop.emitRustExpr v831 v835 + let _v833 = () #endif #if FABLE_COMPILER_RUST && CONTRACT - let v774 : string = v20.l0 - let v775 : bool = v774 = "" - let v783 : string = - if v775 then - v769 + let v836 : string = v21.l0 + let v837 : bool = v836 = "" + let v845 : string = + if v837 then + v831 else - let v776 : bool = v769 = "" - if v776 then - let v777 : string = v20.l0 - v777 + let v838 : bool = v831 = "" + if v838 then + let v839 : string = v21.l0 + v839 else - let v778 : string = v20.l0 - let v779 : string = "\n" - let v780 : string = v778 + v779 - let v781 : string = v780 + v769 - v781 - let v784 : string = "&*$0" - let v785 : Ref = Fable.Core.RustInterop.emitRustExpr v783 v784 - let v786 : string = $"$0.chars()" - let v787 : Mut<_> = Fable.Core.RustInterop.emitRustExpr v785 v786 - let v788 : string = "v787" - let v789 : _ = Fable.Core.RustInterop.emitRustExpr () v788 - let v790 : string = "v789.collect::>()" - let v791 : Vec = Fable.Core.RustInterop.emitRustExpr () v790 - let v792 : string = "$0.chunks(15000).map(|x| x.into_iter().map(|x| x.clone()).collect::>()).collect::>()" - let v793 : Vec> = Fable.Core.RustInterop.emitRustExpr v791 v792 - let v794 : string = "true; let _vec_map : Vec<_> = $0.into_iter().map(|x| { //" - let v795 : bool = Fable.Core.RustInterop.emitRustExpr v793 v794 - let v796 : string = "x" - let v797 : Vec = Fable.Core.RustInterop.emitRustExpr () v796 - let v798 : string = "String::from_iter($0)" - let v799 : std_string_String = Fable.Core.RustInterop.emitRustExpr v797 v798 - let v800 : string = "true; $0 }).collect::>()" - let v801 : bool = Fable.Core.RustInterop.emitRustExpr v799 v800 - let v802 : string = "_vec_map" - let v803 : Vec = Fable.Core.RustInterop.emitRustExpr () v802 - let v804 : string = "$0.len()" - let v805 : unativeint = Fable.Core.RustInterop.emitRustExpr v803 v804 - let v806 : (unativeint -> int32) = int32 - let v807 : int32 = v806 v805 - let v808 : string = "" - let v809 : bool = v769 <> v808 - let v813 : bool = - if v809 then - let v812 : bool = v807 <= 1 - v812 + let v840 : string = v21.l0 + let v841 : string = "\n" + let v842 : string = v840 + v841 + let v843 : string = v842 + v831 + v843 + let v846 : string = "&*$0" + let v847 : Ref = Fable.Core.RustInterop.emitRustExpr v845 v846 + let v848 : string = $"$0.chars()" + let v849 : Mut<_> = Fable.Core.RustInterop.emitRustExpr v847 v848 + let v850 : string = "v849" + let v851 : _ = Fable.Core.RustInterop.emitRustExpr () v850 + let v852 : string = "v851.collect::>()" + let v853 : Vec = Fable.Core.RustInterop.emitRustExpr () v852 + let v854 : string = "$0.chunks(15000).map(|x| x.into_iter().map(|x| x.clone()).collect::>()).collect::>()" + let v855 : Vec> = Fable.Core.RustInterop.emitRustExpr v853 v854 + let v856 : string = "true; let _vec_map : Vec<_> = $0.into_iter().map(|x| { //" + let v857 : bool = Fable.Core.RustInterop.emitRustExpr v855 v856 + let v858 : string = "x" + let v859 : Vec = Fable.Core.RustInterop.emitRustExpr () v858 + let v860 : string = "String::from_iter($0)" + let v861 : std_string_String = Fable.Core.RustInterop.emitRustExpr v859 v860 + let v862 : string = "true; $0 }).collect::>()" + let v863 : bool = Fable.Core.RustInterop.emitRustExpr v861 v862 + let v864 : string = "_vec_map" + let v865 : Vec = Fable.Core.RustInterop.emitRustExpr () v864 + let v866 : string = "$0.len()" + let v867 : unativeint = Fable.Core.RustInterop.emitRustExpr v865 v866 + let v868 : (unativeint -> int32) = int32 + let v869 : int32 = v868 v867 + let v870 : string = "" + let v871 : bool = v831 <> v870 + let v875 : bool = + if v871 then + let v874 : bool = v869 <= 1 + v874 else false - if v813 then - v20.l0 <- v783 + if v875 then + v21.l0 <- v845 () else - v20.l0 <- v808 - let v814 : string = "true; $0.into_iter().for_each(|x| { //" - let v815 : bool = Fable.Core.RustInterop.emitRustExpr v803 v814 - let v816 : string = "x" - let v817 : std_string_String = Fable.Core.RustInterop.emitRustExpr () v816 - let v818 : string = $"near_sdk::log!(\"{{}}\", $0)" - Fable.Core.RustInterop.emitRustExpr v817 v818 - let v819 : string = $"true;" - let v820 : bool = Fable.Core.RustInterop.emitRustExpr () v819 - let v821 : string = "true; }}); { //" - let v822 : bool = Fable.Core.RustInterop.emitRustExpr () v821 + v21.l0 <- v870 + let v876 : string = "true; $0.into_iter().for_each(|x| { //" + let v877 : bool = Fable.Core.RustInterop.emitRustExpr v865 v876 + let v878 : string = "x" + let v879 : std_string_String = Fable.Core.RustInterop.emitRustExpr () v878 + let v880 : string = $"near_sdk::log!(\"{{}}\", $0)" + Fable.Core.RustInterop.emitRustExpr v879 v880 + let v881 : string = $"true;" + let v882 : bool = Fable.Core.RustInterop.emitRustExpr () v881 + let v883 : string = "true; }}); { //" + let v884 : bool = Fable.Core.RustInterop.emitRustExpr () v883 () - let _v771 = () + let _v833 = () #endif #if FABLE_COMPILER_TYPESCRIPT - v770 v769 - let _v771 = () + v832 v831 + let _v833 = () #endif #if FABLE_COMPILER_PYTHON - v770 v769 - let _v771 = () + v832 v831 + let _v833 = () #endif #else - v770 v769 - let _v771 = () + v832 v831 + let _v833 = () #endif - _v771 - let v823 : (string -> unit) = v18.l0 - v823 v769 + _v833 + let v885 : (string -> unit) = v19.l0 + v885 v831 and closure19 () () : unit = let v0 : unit = () let v1 : (unit -> unit) = closure3() @@ -4995,132 +5051,143 @@ and closure0 () () : unit = Fable.Core.RustInterop.emitRustExpr () v4291 let v4292 : string = " account_id: near_sdk::AccountId, //" Fable.Core.RustInterop.emitRustExpr () v4292 - let v4293 : string = ") -> Option<(String, (u64, u32))> { //" + let v4293 : string = ") -> Option<(String, u64, u32)> { //" Fable.Core.RustInterop.emitRustExpr () v4293 - let v4294 : string = $"&self.0.2" - let v4295 : Ref> = Fable.Core.RustInterop.emitRustExpr () v4294 - let v4296 : string = $"&self.0.1" - let v4297 : Ref>> = Fable.Core.RustInterop.emitRustExpr () v4296 - let v4298 : string = $"account_id" - let v4299 : near_sdk_AccountId = Fable.Core.RustInterop.emitRustExpr () v4298 - let v4300 : unit = () - let v4301 : (unit -> unit) = closure18(v4299) - let v4302 : unit = (fun () -> v4301 (); v4300) () - let v5126 : unit = () - let v5127 : (unit -> unit) = closure19() - let v5128 : unit = (fun () -> v5127 (); v5126) () - let v5822 : string = " v4295.get(&$0).and_then(|alias| { //" - Fable.Core.RustInterop.emitRustExpr v4299 v5822 - let v5823 : string = " v4297 //" - Fable.Core.RustInterop.emitRustExpr () v5823 - let v5824 : string = " .get(alias) //" - Fable.Core.RustInterop.emitRustExpr () v5824 - let v5825 : string = " .map(|accounts| (alias.clone(), *accounts.get(&v4299).unwrap())) //" - Fable.Core.RustInterop.emitRustExpr () v5825 - let v5826 : string = " }) //" - Fable.Core.RustInterop.emitRustExpr () v5826 - let v5827 : string = "} //" - Fable.Core.RustInterop.emitRustExpr () v5827 - let v5828 : string = "} //" - Fable.Core.RustInterop.emitRustExpr () v5828 - let v5829 : string = "} /* c" - Fable.Core.RustInterop.emitRustExpr () v5829 - let v5830 : string = "true; // ??? / i: 6uy / i': 1uy / acc: 9uy / n: 2uy" - let v5831 : bool = Fable.Core.RustInterop.emitRustExpr () v5830 - let v5832 : string = "true; */ // ???? / i: 6uy / i': 2uy / acc: 9uy / n: 2uy" - let v5833 : bool = Fable.Core.RustInterop.emitRustExpr () v5832 - let v5834 : string = "#[near_sdk::near_bindgen] //" - Fable.Core.RustInterop.emitRustExpr () v5834 - let v5835 : string = "impl State { //" - Fable.Core.RustInterop.emitRustExpr () v5835 - let v5836 : string = "pub fn get_alias_map( //" - Fable.Core.RustInterop.emitRustExpr () v5836 - let v5837 : string = " &self, //" - Fable.Core.RustInterop.emitRustExpr () v5837 - let v5838 : string = " alias: String, //" - Fable.Core.RustInterop.emitRustExpr () v5838 - let v5839 : string = ") -> Option> { //" - Fable.Core.RustInterop.emitRustExpr () v5839 - let v5840 : string = $"&self.0.1" - let v5841 : Ref>> = Fable.Core.RustInterop.emitRustExpr () v5840 - let v5842 : string = $"alias" - let v5843 : std_string_String = Fable.Core.RustInterop.emitRustExpr () v5842 - let v5844 : unit = () - let v5845 : (unit -> unit) = closure20(v5843) - let v5846 : unit = (fun () -> v5845 (); v5844) () - let v6670 : unit = () - let v6671 : (unit -> unit) = closure21() - let v6672 : unit = (fun () -> v6671 (); v6670) () - let v7366 : string = " v5841.get(&$0).cloned() //" - Fable.Core.RustInterop.emitRustExpr v5843 v7366 - let v7367 : string = "} //" - Fable.Core.RustInterop.emitRustExpr () v7367 - let v7368 : string = "} //" - Fable.Core.RustInterop.emitRustExpr () v7368 - let v7369 : string = "} /* c" - Fable.Core.RustInterop.emitRustExpr () v7369 - let v7370 : string = "true; // ??? / i: 7uy / i': 1uy / acc: 11uy / n: 2uy" - let v7371 : bool = Fable.Core.RustInterop.emitRustExpr () v7370 - let v7372 : string = "true; */ // ???? / i: 7uy / i': 2uy / acc: 11uy / n: 2uy" - let v7373 : bool = Fable.Core.RustInterop.emitRustExpr () v7372 - let v7374 : string = "#[near_sdk::near_bindgen] //" - Fable.Core.RustInterop.emitRustExpr () v7374 - let v7375 : string = "impl State { //" - Fable.Core.RustInterop.emitRustExpr () v7375 - let v7376 : string = "#[result_serializer(borsh)] //" - Fable.Core.RustInterop.emitRustExpr () v7376 - let v7377 : string = "pub fn get_alias_map_borsh( //" - Fable.Core.RustInterop.emitRustExpr () v7377 - let v7378 : string = " &self, //" - Fable.Core.RustInterop.emitRustExpr () v7378 - let v7379 : string = " #[serializer(borsh)] alias: String, //" - Fable.Core.RustInterop.emitRustExpr () v7379 - let v7380 : string = ") -> Option> { //" - Fable.Core.RustInterop.emitRustExpr () v7380 - let v7381 : string = " self.get_alias_map(alias) //" - Fable.Core.RustInterop.emitRustExpr () v7381 - let v7382 : string = "} //" - Fable.Core.RustInterop.emitRustExpr () v7382 - let v7383 : string = "} /* c" - Fable.Core.RustInterop.emitRustExpr () v7383 - let v7384 : string = "true; // ??? / i: 8uy / i': 1uy / acc: 13uy / n: 1uy" - let v7385 : bool = Fable.Core.RustInterop.emitRustExpr () v7384 - let v7386 : string = "true; */ // ???? / i: 8uy / i': 2uy / acc: 13uy / n: 1uy" - let v7387 : bool = Fable.Core.RustInterop.emitRustExpr () v7386 - let v7388 : string = "fn _main() //" - Fable.Core.RustInterop.emitRustExpr () v7388 - let v7389 : string = "{ //" - Fable.Core.RustInterop.emitRustExpr () v7389 - let v7390 : string = "true; { (); // ?? / i': 1uy / n: 14uy" - let v7391 : bool = Fable.Core.RustInterop.emitRustExpr () v7390 - let v7392 : string = "true; { (); // ?? / i': 2uy / n: 14uy" - let v7393 : bool = Fable.Core.RustInterop.emitRustExpr () v7392 - let v7394 : string = "true; { (); // ?? / i': 3uy / n: 14uy" - let v7395 : bool = Fable.Core.RustInterop.emitRustExpr () v7394 - let v7396 : string = "true; { (); // ?? / i': 4uy / n: 14uy" - let v7397 : bool = Fable.Core.RustInterop.emitRustExpr () v7396 - let v7398 : string = "true; { (); // ?? / i': 5uy / n: 14uy" - let v7399 : bool = Fable.Core.RustInterop.emitRustExpr () v7398 - let v7400 : string = "true; { (); // ?? / i': 6uy / n: 14uy" - let v7401 : bool = Fable.Core.RustInterop.emitRustExpr () v7400 - let v7402 : string = "true; { (); // ?? / i': 7uy / n: 14uy" - let v7403 : bool = Fable.Core.RustInterop.emitRustExpr () v7402 - let v7404 : string = "true; { (); // ?? / i': 8uy / n: 14uy" - let v7405 : bool = Fable.Core.RustInterop.emitRustExpr () v7404 - let v7406 : string = "true; { (); // ?? / i': 9uy / n: 14uy" - let v7407 : bool = Fable.Core.RustInterop.emitRustExpr () v7406 - let v7408 : string = "true; { (); // ?? / i': 10uy / n: 14uy" - let v7409 : bool = Fable.Core.RustInterop.emitRustExpr () v7408 - let v7410 : string = "true; { (); // ?? / i': 11uy / n: 14uy" - let v7411 : bool = Fable.Core.RustInterop.emitRustExpr () v7410 - let v7412 : string = "true; { (); // ?? / i': 12uy / n: 14uy" - let v7413 : bool = Fable.Core.RustInterop.emitRustExpr () v7412 - let v7414 : string = "true; { (); // ?? / i': 13uy / n: 14uy" - let v7415 : bool = Fable.Core.RustInterop.emitRustExpr () v7414 - let v7416 : string = "true; { (); // ?? / i': 14uy / n: 14uy" - let v7417 : bool = Fable.Core.RustInterop.emitRustExpr () v7416 - let v7418 : string = "true; { { (); // ? / i': 15uy / n: 14uy" - let v7419 : bool = Fable.Core.RustInterop.emitRustExpr () v7418 + let v4294 : string = $"&self.0" + let v4295 : Ref> * near_sdk_store_LookupMap)> = Fable.Core.RustInterop.emitRustExpr () v4294 + let v4296 : string = $"account_id" + let v4297 : near_sdk_AccountId = Fable.Core.RustInterop.emitRustExpr () v4296 + let v4298 : string = $"&v4295.2" + let v4299 : Ref> = Fable.Core.RustInterop.emitRustExpr () v4298 + let v4300 : string = $"&v4295.1" + let v4301 : Ref>> = Fable.Core.RustInterop.emitRustExpr () v4300 + let v4302 : string = "let result = v4299.get(&$0).and_then(|alias| { //" + Fable.Core.RustInterop.emitRustExpr v4297 v4302 + let v4303 : string = " v4301 //" + Fable.Core.RustInterop.emitRustExpr () v4303 + let v4304 : string = " .get(alias) //" + Fable.Core.RustInterop.emitRustExpr () v4304 + let v4305 : string = " .map(|accounts| { //" + Fable.Core.RustInterop.emitRustExpr () v4305 + let v4306 : string = " let result = (alias.clone(), *accounts.get(&v4297).unwrap()); //" + Fable.Core.RustInterop.emitRustExpr () v4306 + let v4307 : string = " (result.0, result.1.0, result.1.1) //" + Fable.Core.RustInterop.emitRustExpr () v4307 + let v4308 : string = " }) //" + Fable.Core.RustInterop.emitRustExpr () v4308 + let v4309 : string = "}); //" + Fable.Core.RustInterop.emitRustExpr () v4309 + let v4310 : string = "result" + let v4311 : struct (std_string_String * uint64 * uint32) option = Fable.Core.RustInterop.emitRustExpr () v4310 + let v4312 : unit = () + let v4313 : (unit -> unit) = closure18(v4297, v4311) + let v4314 : unit = (fun () -> v4313 (); v4312) () + let v5199 : unit = () + let v5200 : (unit -> unit) = closure19() + let v5201 : unit = (fun () -> v5200 (); v5199) () + let _result = v4311 in _result |> (fun x -> Fable.Core.RustInterop.emitRustExpr x "$0 } // 4") // 3 + let v5895 : string = "} // 2" + Fable.Core.RustInterop.emitRustExpr () v5895 + let v5896 : string = "} // 1" + Fable.Core.RustInterop.emitRustExpr () v5896 + let v5897 : string = "} /* c" + Fable.Core.RustInterop.emitRustExpr () v5897 + let v5898 : string = "true; // ??? / i: 6uy / i': 1uy / acc: 9uy / n: 2uy" + let v5899 : bool = Fable.Core.RustInterop.emitRustExpr () v5898 + let v5900 : string = "true; */ // ???? / i: 6uy / i': 2uy / acc: 9uy / n: 2uy" + let v5901 : bool = Fable.Core.RustInterop.emitRustExpr () v5900 + let v5902 : string = "#[near_sdk::near_bindgen] //" + Fable.Core.RustInterop.emitRustExpr () v5902 + let v5903 : string = "impl State { //" + Fable.Core.RustInterop.emitRustExpr () v5903 + let v5904 : string = "pub fn get_alias_map( //" + Fable.Core.RustInterop.emitRustExpr () v5904 + let v5905 : string = " &self, //" + Fable.Core.RustInterop.emitRustExpr () v5905 + let v5906 : string = " alias: String, //" + Fable.Core.RustInterop.emitRustExpr () v5906 + let v5907 : string = ") -> Option> { //" + Fable.Core.RustInterop.emitRustExpr () v5907 + let v5908 : string = $"&self.0.1" + let v5909 : Ref>> = Fable.Core.RustInterop.emitRustExpr () v5908 + let v5910 : string = $"alias" + let v5911 : std_string_String = Fable.Core.RustInterop.emitRustExpr () v5910 + let v5912 : unit = () + let v5913 : (unit -> unit) = closure20(v5911) + let v5914 : unit = (fun () -> v5913 (); v5912) () + let v6738 : unit = () + let v6739 : (unit -> unit) = closure21() + let v6740 : unit = (fun () -> v6739 (); v6738) () + let v7434 : string = " v5909.get(&$0).cloned() //" + Fable.Core.RustInterop.emitRustExpr v5911 v7434 + let v7435 : string = "} //" + Fable.Core.RustInterop.emitRustExpr () v7435 + let v7436 : string = "} //" + Fable.Core.RustInterop.emitRustExpr () v7436 + let v7437 : string = "} /* c" + Fable.Core.RustInterop.emitRustExpr () v7437 + let v7438 : string = "true; // ??? / i: 7uy / i': 1uy / acc: 11uy / n: 2uy" + let v7439 : bool = Fable.Core.RustInterop.emitRustExpr () v7438 + let v7440 : string = "true; */ // ???? / i: 7uy / i': 2uy / acc: 11uy / n: 2uy" + let v7441 : bool = Fable.Core.RustInterop.emitRustExpr () v7440 + let v7442 : string = "#[near_sdk::near_bindgen] //" + Fable.Core.RustInterop.emitRustExpr () v7442 + let v7443 : string = "impl State { //" + Fable.Core.RustInterop.emitRustExpr () v7443 + let v7444 : string = "#[result_serializer(borsh)] //" + Fable.Core.RustInterop.emitRustExpr () v7444 + let v7445 : string = "pub fn get_alias_map_borsh( //" + Fable.Core.RustInterop.emitRustExpr () v7445 + let v7446 : string = " &self, //" + Fable.Core.RustInterop.emitRustExpr () v7446 + let v7447 : string = " #[serializer(borsh)] alias: String, //" + Fable.Core.RustInterop.emitRustExpr () v7447 + let v7448 : string = ") -> Option> { //" + Fable.Core.RustInterop.emitRustExpr () v7448 + let v7449 : string = " self.get_alias_map(alias) //" + Fable.Core.RustInterop.emitRustExpr () v7449 + let v7450 : string = "} //" + Fable.Core.RustInterop.emitRustExpr () v7450 + let v7451 : string = "} /* c" + Fable.Core.RustInterop.emitRustExpr () v7451 + let v7452 : string = "true; // ??? / i: 8uy / i': 1uy / acc: 13uy / n: 1uy" + let v7453 : bool = Fable.Core.RustInterop.emitRustExpr () v7452 + let v7454 : string = "true; */ // ???? / i: 8uy / i': 2uy / acc: 13uy / n: 1uy" + let v7455 : bool = Fable.Core.RustInterop.emitRustExpr () v7454 + let v7456 : string = "fn _main() //" + Fable.Core.RustInterop.emitRustExpr () v7456 + let v7457 : string = "{ { //" + Fable.Core.RustInterop.emitRustExpr () v7457 + let v7458 : string = "true; { (); // ?? / i': 1uy / n: 14uy" + let v7459 : bool = Fable.Core.RustInterop.emitRustExpr () v7458 + let v7460 : string = "true; { (); // ?? / i': 2uy / n: 14uy" + let v7461 : bool = Fable.Core.RustInterop.emitRustExpr () v7460 + let v7462 : string = "true; { (); // ?? / i': 3uy / n: 14uy" + let v7463 : bool = Fable.Core.RustInterop.emitRustExpr () v7462 + let v7464 : string = "true; { (); // ?? / i': 4uy / n: 14uy" + let v7465 : bool = Fable.Core.RustInterop.emitRustExpr () v7464 + let v7466 : string = "true; { (); // ?? / i': 5uy / n: 14uy" + let v7467 : bool = Fable.Core.RustInterop.emitRustExpr () v7466 + let v7468 : string = "true; { (); // ?? / i': 6uy / n: 14uy" + let v7469 : bool = Fable.Core.RustInterop.emitRustExpr () v7468 + let v7470 : string = "true; { (); // ?? / i': 7uy / n: 14uy" + let v7471 : bool = Fable.Core.RustInterop.emitRustExpr () v7470 + let v7472 : string = "true; { (); // ?? / i': 8uy / n: 14uy" + let v7473 : bool = Fable.Core.RustInterop.emitRustExpr () v7472 + let v7474 : string = "true; { (); // ?? / i': 9uy / n: 14uy" + let v7475 : bool = Fable.Core.RustInterop.emitRustExpr () v7474 + let v7476 : string = "true; { (); // ?? / i': 10uy / n: 14uy" + let v7477 : bool = Fable.Core.RustInterop.emitRustExpr () v7476 + let v7478 : string = "true; { (); // ?? / i': 11uy / n: 14uy" + let v7479 : bool = Fable.Core.RustInterop.emitRustExpr () v7478 + let v7480 : string = "true; { (); // ?? / i': 12uy / n: 14uy" + let v7481 : bool = Fable.Core.RustInterop.emitRustExpr () v7480 + let v7482 : string = "true; { (); // ?? / i': 13uy / n: 14uy" + let v7483 : bool = Fable.Core.RustInterop.emitRustExpr () v7482 + let v7484 : string = "true; { (); // ?? / i': 14uy / n: 14uy" + let v7485 : bool = Fable.Core.RustInterop.emitRustExpr () v7484 + let v7486 : string = "true; { { (); // ? / i': 15uy / n: 14uy" + let v7487 : bool = Fable.Core.RustInterop.emitRustExpr () v7486 () let v0 : (unit -> unit) = closure0() v0 |> ignore diff --git a/apps/chat/contract/chat_contract.rs b/apps/chat/contract/chat_contract.rs index 6a4eabc09..c597c5061 100644 --- a/apps/chat/contract/chat_contract.rs +++ b/apps/chat/contract/chat_contract.rs @@ -1221,12 +1221,16 @@ mod module_31a2fc18 { ((patternInput.1.clone()).l0.get().clone())(string("")) } } - pub fn closure18(v0_1: near_sdk::AccountId, unitVar: ()) { - fn v2() { + pub fn closure18( + v0_1: near_sdk::AccountId, + v1: Option<(std::string::String, u64, u32)>, + unitVar: (), + ) { + fn v3() { Chat_contract::closure3((), ()); } - let v3: () = { - v2(); + let v4: () = { + v3(); () }; let patternInput: ( @@ -1237,9 +1241,9 @@ mod module_31a2fc18 { LrcPtr, Option, ) = getValue(Chat_contract::TraceState::trace_state().get().clone()); - let v20: LrcPtr = patternInput.3.clone(); - let v36: () = { - v2(); + let v21: LrcPtr = patternInput.3.clone(); + let v37: () = { + v3(); () }; let patternInput_1: ( @@ -1250,13 +1254,13 @@ mod module_31a2fc18 { LrcPtr, Option, ) = getValue(Chat_contract::TraceState::trace_state().get().clone()); - let v68: Chat_contract::US0 = (patternInput_1.4.clone()).l0.get().clone(); + let v69: Chat_contract::US0 = (patternInput_1.4.clone()).l0.get().clone(); if if (patternInput_1.2.clone()).l0.get().clone() == false { false } else { 1_i32 >= find( - v68, + v69, ofSeq(ofList(ofArray(new_array(&[ LrcPtr::new((Chat_contract::US0::US0_0, 0_i32)), LrcPtr::new((Chat_contract::US0::US0_1, 1_i32)), @@ -1266,12 +1270,12 @@ mod module_31a2fc18 { ])))), ) } { - let v76: () = { + let v77: () = { Chat_contract::closure7(patternInput.0.clone(), ()); () }; - let v80: () = { - v2(); + let v81: () = { + v3(); () }; let patternInput_2: ( @@ -1282,139 +1286,160 @@ mod module_31a2fc18 { LrcPtr, Option, ) = getValue(Chat_contract::TraceState::trace_state().get().clone()); - let v250: u64 = near_sdk::env::block_timestamp(); - let _v251: LrcPtr>> = + let v251: u64 = near_sdk::env::block_timestamp(); + let _v252: LrcPtr>> = refCell(None::); - let v256: () = { + let v257: () = { Chat_contract::closure9( patternInput_2.5.clone(), Func1::new({ - let _v251 = _v251.clone(); + let _v252 = _v252.clone(); move |v: Option| { - Chat_contract::closure8(_v251.clone(), v) + Chat_contract::closure8(_v252.clone(), v) } }), (), ); () }; - let v271: Chat_contract::US3 = - defaultValue(Chat_contract::US3::US3_1, _v251.get().clone()); - let v281: u64 = match &v271 { - Chat_contract::US3::US3_0(v271_0_0) => { - v250 - match &v271 { + let v272: Chat_contract::US3 = + defaultValue(Chat_contract::US3::US3_1, _v252.get().clone()); + let v282: u64 = match &v272 { + Chat_contract::US3::US3_0(v272_0_0) => { + v251 - match &v272 { Chat_contract::US3::US3_0(x) => x.clone(), _ => unreachable!(), } as u64 } - _ => v250, + _ => v251, } / 1000000000_u64; - let v282: u64 = v281 % 60_u64; - let v284: u64 = v281 / 60_u64 % 60_u64; - let v286: u64 = v281 / 3600_u64 % 24_u64; - let v288: std::string::String = format!("{:02}:{:02}:{:02}", v286, v284, v282); - let v290: string = fable_library_rust::String_::fromString(v288); - let v570: string = padLeft(toLower(string("Debug")), 7_i32, ' '); - let v608: &str = inline_colorization::color_bright_blue; - let v610: &str = &*v570; - let v612: &str = inline_colorization::color_reset; - let v614: string = string("format!(\"{v608}{v610}{v612}\")"); - let v615: std::string::String = format!("{v608}{v610}{v612}"); - let v617: string = fable_library_rust::String_::fromString(v615); - let v636: i64 = (patternInput_2.0.clone()).l0.get().clone(); - let v638: LrcPtr = LrcPtr::new(Chat_contract::Mut3 { + let v283: u64 = v282 % 60_u64; + let v285: u64 = v282 / 60_u64 % 60_u64; + let v287: u64 = v282 / 3600_u64 % 24_u64; + let v289: std::string::String = format!("{:02}:{:02}:{:02}", v287, v285, v283); + let v291: string = fable_library_rust::String_::fromString(v289); + let v571: string = padLeft(toLower(string("Debug")), 7_i32, ' '); + let v609: &str = inline_colorization::color_bright_blue; + let v611: &str = &*v571; + let v613: &str = inline_colorization::color_reset; + let v615: string = string("format!(\"{v609}{v611}{v613}\")"); + let v616: std::string::String = format!("{v609}{v611}{v613}"); + let v618: string = fable_library_rust::String_::fromString(v616); + let v637: i64 = (patternInput_2.0.clone()).l0.get().clone(); + let v639: LrcPtr = LrcPtr::new(Chat_contract::Mut3 { l0: MutCell::new(Chat_contract::method8()), }); - let v645: () = { - Chat_contract::closure10(v638.clone(), sprintf!("{}", string("{ ")), ()); + let v646: () = { + Chat_contract::closure10(v639.clone(), sprintf!("{}", string("{ ")), ()); () }; - let v654: () = { + let v655: () = { Chat_contract::closure10( - v638.clone(), + v639.clone(), sprintf!("{}", string("account_id")), (), ); () }; - let v663: () = { - Chat_contract::closure10(v638.clone(), sprintf!("{}", string(" = ")), ()); + let v664: () = { + Chat_contract::closure10(v639.clone(), sprintf!("{}", string(" = ")), ()); () }; - let v676: std::string::String = format!("{:#?}", v0_1); - let v698: () = { + let v677: std::string::String = format!("{:#?}", v0_1); + let v699: () = { Chat_contract::closure10( - v638.clone(), - sprintf!("{}", fable_library_rust::String_::fromString(v676)), + v639.clone(), + sprintf!("{}", fable_library_rust::String_::fromString(v677)), (), ); () }; - let v707: () = { - Chat_contract::closure10(v638.clone(), sprintf!("{}", string(" }")), ()); + let v708: () = { + Chat_contract::closure10(v639.clone(), sprintf!("{}", string("; ")), ()); () }; - let v769: string = trimEndChars( + let v717: () = { + Chat_contract::closure10(v639.clone(), sprintf!("{}", string("result")), ()); + () + }; + let v725: () = { + Chat_contract::closure10(v639.clone(), sprintf!("{}", string(" = ")), ()); + () + }; + let v738: std::string::String = format!("{:#?}", v1); + let v760: () = { + Chat_contract::closure10( + v639.clone(), + sprintf!("{}", fable_library_rust::String_::fromString(v738)), + (), + ); + () + }; + let v769: () = { + Chat_contract::closure10(v639.clone(), sprintf!("{}", string(" }")), ()); + () + }; + let v831: string = trimEndChars( trimStartChars( sprintf!( "{} {} #{} {} / {}", - v290, - v617, - v636, + v291, + v618, + v637, string("chat_contract.get_account_info"), - v638.l0.get().clone() + v639.l0.get().clone() ), toArray(empty::()), ), toArray(ofArray(new_array(&[' ', '/']))), ); - let v783: string = if v20.l0.get().clone() == string("") { - v769.clone() + let v845: string = if v21.l0.get().clone() == string("") { + v831.clone() } else { - if v769.clone() == string("") { - v20.l0.get().clone() + if v831.clone() == string("") { + v21.l0.get().clone() } else { - append(append(v20.l0.get().clone(), string("\n")), v769.clone()) + append(append(v21.l0.get().clone(), string("\n")), v831.clone()) } }; - let v785: &str = &*v783.clone(); - let v787 = v785.chars(); - let v789 = v787; - let v791: Vec = v789.collect::>(); - let v793: Vec> = v791 + let v847: &str = &*v845.clone(); + let v849 = v847.chars(); + let v851 = v849; + let v853: Vec = v851.collect::>(); + let v855: Vec> = v853 .chunks(15000) .map(|x| x.into_iter().map(|x| x.clone()).collect::>()) .collect::>(); - let v795: bool = true; - let _vec_map: Vec<_> = v793 + let v857: bool = true; + let _vec_map: Vec<_> = v855 .into_iter() .map(|x| { //; - let v797: Vec = x; - let v799: std::string::String = String::from_iter(v797); - let v801: bool = true; - v799 + let v859: Vec = x; + let v861: std::string::String = String::from_iter(v859); + let v863: bool = true; + v861 }) .collect::>(); - let v803: Vec = _vec_map; - if if v769.clone() != string("") { - v803.clone().len() as i32 <= 1_i32 + let v865: Vec = _vec_map; + if if v831.clone() != string("") { + v865.clone().len() as i32 <= 1_i32 } else { false } { - v20.l0.set(v783); + v21.l0.set(v845); () } else { - v20.l0.set(string("")); + v21.l0.set(string("")); { - let v815: bool = true; - v803.into_iter().for_each(|x| { + let v877: bool = true; + v865.into_iter().for_each(|x| { //; - let v817: std::string::String = x; - near_sdk::log!("{}", v817); + let v879: std::string::String = x; + near_sdk::log!("{}", v879); { - let v820: bool = true; - let v822: bool = true; + let v882: bool = true; + let v884: bool = true; } }); { @@ -1424,7 +1449,7 @@ mod module_31a2fc18 { } } (); - ((patternInput.1.clone()).l0.get().clone())(v769) + ((patternInput.1.clone()).l0.get().clone())(v831) } } pub fn closure19(unitVar: (), unitVar_1: ()) { @@ -2300,39 +2325,56 @@ mod module_31a2fc18 { //; &self, //; account_id: near_sdk::AccountId, //; - ) -> Option<(String, (u64, u32))> { + ) -> Option<(String, u64, u32)> { //; { - let v4295: &near_sdk::store::LookupMap< + let v4295: &( + u32, + near_sdk::store::LookupMap< + std::string::String, + std::collections::HashMap, + >, + near_sdk::store::LookupMap, + ) = &self.0; + let v4297: near_sdk::AccountId = account_id; + let v4299: &near_sdk::store::LookupMap< near_sdk::AccountId, std::string::String, - > = &self.0 .2; - let v4297: &near_sdk::store::LookupMap< + > = &v4295.2; + let v4301: &near_sdk::store::LookupMap< std::string::String, std::collections::HashMap, - > = &self.0 .1; - let v4299: near_sdk::AccountId = account_id; - let v4302: () = { - Chat_contract::closure18(v4299.clone(), ()); - () - }; - let v5128: () = { - Chat_contract::closure19((), ()); - () - }; - v4295.get(&v4299).and_then(|alias| { //; - v4297 //; - .get(alias) //; - .map(|accounts| (alias.clone(), *accounts.get(&v4299).unwrap())) //; - }) //; - } //; - } //; + > = &v4295.1; + let result = v4299.get(&v4297.clone()).and_then(|alias| { + //; + v4301 //; + .get(alias) //; + .map(|accounts| { + //; + let result = (alias.clone(), *accounts.get(&v4297).unwrap()); //; + (result.0, result.1 .0, result.1 .1) //; + }) //; + }); //; + { + let v4311: Option<(std::string::String, u64, u32)> = result; + let v4314: () = { + Chat_contract::closure18(v4297, v4311.clone(), ()); + () + }; + let v5201: () = { + Chat_contract::closure19((), ()); + () + }; + v4311 + } // 4; + } // 2; + } // 1; } /* c; { - let v5831: + let v5899: bool = true; // ??? / i: 6uy / i': 1uy / acc: 9uy / n: 2uy; - let v5833: + let v5901: bool = true; */ // ???? / i: 6uy / i': 2uy / acc: 9uy / n: 2uy; @@ -2346,28 +2388,28 @@ mod module_31a2fc18 { ) -> Option> { //; { - let v5841: &near_sdk::store::LookupMap< + let v5909: &near_sdk::store::LookupMap< std::string::String, std::collections::HashMap, > = &self.0 .1; - let v5843: std::string::String = alias; - let v5846: () = { - Chat_contract::closure20(v5843.clone(), ()); + let v5911: std::string::String = alias; + let v5914: () = { + Chat_contract::closure20(v5911.clone(), ()); () }; - let v6672: () = { + let v6740: () = { Chat_contract::closure21((), ()); () }; - v5841.get(&v5843).cloned() //; + v5909.get(&v5911).cloned() //; } //; } //; } /* c; { - let v7371: + let v7439: bool = true; // ??? / i: 7uy / i': 1uy / acc: 11uy / n: 2uy; - let v7373: + let v7441: bool = true; */ // ???? / i: 7uy / i': 2uy / acc: 11uy / n: 2uy; @@ -2385,64 +2427,66 @@ mod module_31a2fc18 { } //; } /* c; { - let v7385: + let v7453: bool = true; // ??? / i: 8uy / i': 1uy / acc: 13uy / n: 1uy; - let v7387: + let v7455: bool = true; */ // ???? / i: 8uy / i': 2uy / acc: 13uy / n: 1uy; fn _main() //; { - //; { - let v7391: bool = true; + //; { - (); // ?? / i': 1uy / n: 14uy; - let v7393: bool = true; + let v7459: bool = true; { - (); // ?? / i': 2uy / n: 14uy; - let v7395: bool = true; + (); // ?? / i': 1uy / n: 14uy; + let v7461: bool = true; { - (); // ?? / i': 3uy / n: 14uy; - let v7397: bool = true; + (); // ?? / i': 2uy / n: 14uy; + let v7463: bool = true; { - (); // ?? / i': 4uy / n: 14uy; - let v7399: bool = true; + (); // ?? / i': 3uy / n: 14uy; + let v7465: bool = true; { - (); // ?? / i': 5uy / n: 14uy; - let v7401: bool = true; + (); // ?? / i': 4uy / n: 14uy; + let v7467: bool = true; { - (); // ?? / i': 6uy / n: 14uy; - let v7403: bool = true; + (); // ?? / i': 5uy / n: 14uy; + let v7469: bool = true; { - (); // ?? / i': 7uy / n: 14uy; - let v7405: bool = true; + (); // ?? / i': 6uy / n: 14uy; + let v7471: bool = true; { - (); // ?? / i': 8uy / n: 14uy; - let v7407: bool = true; + (); // ?? / i': 7uy / n: 14uy; + let v7473: bool = true; { - (); // ?? / i': 9uy / n: 14uy; - let v7409: bool = true; + (); // ?? / i': 8uy / n: 14uy; + let v7475: bool = true; { - (); // ?? / i': 10uy / n: 14uy; - let v7411: bool = true; + (); // ?? / i': 9uy / n: 14uy; + let v7477: bool = true; { - (); // ?? / i': 11uy / n: 14uy; - let v7413: bool = true; + (); // ?? / i': 10uy / n: 14uy; + let v7479: bool = true; { - (); // ?? / i': 12uy / n: 14uy; - let v7415: bool = true; + (); // ?? / i': 11uy / n: 14uy; + let v7481: bool = true; { - (); // ?? / i': 13uy / n: 14uy; - let v7417: bool = true; + (); // ?? / i': 12uy / n: 14uy; + let v7483: bool = true; { - (); // ?? / i': 14uy / n: 14uy; - let v7419: bool = true; + (); // ?? / i': 13uy / n: 14uy; + let v7485: bool = true; { + (); // ?? / i': 14uy / n: 14uy; + let v7487: bool = true; { - (); // ? / i': 15uy / n: 14uy; - () + { + (); // ? / i': 15uy / n: 14uy; + () + } } } } diff --git a/apps/chat/contract/chat_contract.spi b/apps/chat/contract/chat_contract.spi index 9651a74f2..717dcdea6 100644 --- a/apps/chat/contract/chat_contract.spi +++ b/apps/chat/contract/chat_contract.spi @@ -125,6 +125,37 @@ inl claim_alias (state : rust.ref (rust.mut' state)) (alias : sm'.std_string) : !\($'" !alias_map.insert(!alias, new_alias_account_map); //"') : () +/// ### get_account_info +inl get_account_info + (state : rust.ref state) + (account_id : near.account_id) + : optionm'.option' (sm'.std_string * (u64 * u32)) + = + inl account_map : rust.ref (near.lookup_map near.account_id sm'.std_string) = + !\($'$"&!state.2"') + + inl alias_map : rust.ref (near.lookup_map sm'.std_string (mapm.hash_map near.account_id (u64 * u32))) = + !\($'$"&!state.1"') + + !\\(account_id, $'"let result = !account_map.get(&$0).and_then(|alias| { //"') : () + !\($'" !alias_map //"') : () + !\($'" .get(alias) //"') : () + !\($'" .map(|accounts| { //"') : () + !\($'" let result = (alias.clone(), *accounts.get(&!account_id).unwrap()); //"') : () + !\($'" (result.0, result.1.0, result.1.1) //"') : () + !\($'" }) //"') : () + !\($'"}); //"') : () + + inl result = !\($'"result"') + + trace Debug + fun () => $'$"chat_contract.get_account_info"' + fun () => { account_id result } + + trace Debug (fun () => "") id + + result + /// ### main ///! _ @@ -218,31 +249,17 @@ inl main () = !\($'"pub fn get_account_info( //"') : () !\($'" &self, //"') : () !\($'" account_id: near_sdk::AccountId, //"') : () - !\($'") -> Option<(String, (u64, u32))> { //"') : () - - inl account_map : rust.ref (near.lookup_map near.account_id sm'.std_string) = - !\($'$"&self.0.2"') - - inl alias_map : rust.ref (near.lookup_map sm'.std_string (mapm.hash_map near.account_id (u64 * u32))) = - !\($'$"&self.0.1"') + !\($'") -> Option<(String, u64, u32)> { //"') : () + inl state = !\($'$"&self.0"') inl account_id : near.account_id = !\($'$"account_id"') - trace Debug - fun () => $'$"chat_contract.get_account_info"' - fun () => { account_id } - - trace Debug (fun () => "") id + inl result = account_id |> get_account_info state + $'let _result = !result in _result |> (fun x -> Fable.Core.RustInterop.emitRustExpr x "$0 } // 4") // 3' : () - !\\(account_id, $'" !account_map.get(&$0).and_then(|alias| { //"') : () - !\($'" !alias_map //"') : () - !\($'" .get(alias) //"') : () - !\($'" .map(|accounts| (alias.clone(), *accounts.get(&!account_id).unwrap())) //"') : () - !\($'" }) //"') : () + !\($'"} // 2"') : () - !\($'"} //"') : () - - !\($'"} //"') : () + !\($'"} // 1"') : () 2 @@ -316,7 +333,7 @@ inl main () = // !\($'"} // b"') : () !\($'"fn _main() //"') : () - !\($'"{ //"') : () + !\($'"{ { //"') : () inl rec loop' i' = if i' <= n diff --git a/apps/chat/contract/tests/src/main.rs b/apps/chat/contract/tests/src/main.rs index ddcc3429f..53050431f 100644 --- a/apps/chat/contract/tests/src/main.rs +++ b/apps/chat/contract/tests/src/main.rs @@ -96,7 +96,7 @@ async fn main() -> anyhow::Result<()> { print_usd(result); // get_account_info(account1) - let result: Option<(String, (u64, u32))> = account1 + let result: Option<(String, u64, u32)> = account1 .view(contract_id, "get_account_info") .args_json(near_sdk::serde_json::json!({ "account_id": account1.id(), @@ -105,7 +105,7 @@ async fn main() -> anyhow::Result<()> { .json()?; println!("\n\nget_account_info(account1): {result:#?}"); match result { - Some((alias, (_, index))) => { + Some((alias, _, index)) => { assert_eq!(alias, "alias1"); assert_eq!(index, 0); } @@ -154,7 +154,7 @@ async fn main() -> anyhow::Result<()> { print_usd(result); // get_account_info(account2) - let result: Option<(String, (u64, u32))> = account2 + let result: Option<(String, u64, u32)> = account2 .view(contract_id, "get_account_info") .args_json(near_sdk::serde_json::json!({ "account_id": account2.id(), @@ -163,7 +163,7 @@ async fn main() -> anyhow::Result<()> { .json()?; println!("\n\nget_account_info(account2): {result:#?}"); match result { - Some((alias, (_, index))) => { + Some((alias, _, index)) => { assert_eq!(alias, "alias2"); assert_eq!(index, 0); } @@ -206,7 +206,7 @@ async fn main() -> anyhow::Result<()> { print_usd(result); // get_account_info(account2) - let result: Option<(String, (u64, u32))> = account2 + let result: Option<(String, u64, u32)> = account2 .view(contract_id, "get_account_info") .args_json(near_sdk::serde_json::json!({ "account_id": account2.id(), @@ -215,7 +215,7 @@ async fn main() -> anyhow::Result<()> { .json()?; println!("\n\nget_account_info(account2): {result:#?}"); match result { - Some((alias, (_, index))) => { + Some((alias, _, index)) => { assert_eq!(alias, "alias1"); assert_eq!(index, 1); } @@ -287,7 +287,7 @@ async fn main() -> anyhow::Result<()> { print_usd(result); // get_account_info(account1) - let result: Option<(String, (u64, u32))> = account1 + let result: Option<(String, u64, u32)> = account1 .view(contract_id, "get_account_info") .args_json(near_sdk::serde_json::json!({ "account_id": account1.id(), @@ -296,7 +296,7 @@ async fn main() -> anyhow::Result<()> { .json()?; println!("\n\nget_account_info(account1): {result:#?}"); match result { - Some((alias, (_, index))) => { + Some((alias, _, index)) => { assert_eq!(alias, "alias2"); assert_eq!(index, 0); } @@ -365,7 +365,7 @@ async fn main() -> anyhow::Result<()> { print_usd(result); // get_account_info(account1) - let result: Option<(String, (u64, u32))> = account1 + let result: Option<(String, u64, u32)> = account1 .view(contract_id, "get_account_info") .args_json(near_sdk::serde_json::json!({ "account_id": account1.id(), @@ -374,7 +374,7 @@ async fn main() -> anyhow::Result<()> { .json()?; println!("\n\nget_account_info(account1): {result:#?}"); match result { - Some((alias, (_, index))) => { + Some((alias, _, index)) => { assert_eq!(alias, "alias1"); assert_eq!(index, 1); } diff --git a/apps/parser/DibParser.dib b/apps/parser/DibParser.dib index f1c57bcd8..094abaef6 100644 --- a/apps/parser/DibParser.dib +++ b/apps/parser/DibParser.dib @@ -828,7 +828,7 @@ let inline writeDibCode output path = async { let pathDir = path |> System.IO.Path.GetDirectoryName let fileNameWithoutExt = match output, path |> System.IO.Path.GetFileNameWithoutExtension with - | Spir, fileNameWithoutExt -> $"real_{fileNameWithoutExt}" + | Spir, fileNameWithoutExt -> $"{fileNameWithoutExt}_real" | _, fileNameWithoutExt -> fileNameWithoutExt let outputPath = pathDir $"{fileNameWithoutExt}.{output |> string |> SpiralSm.to_lower}" do! result |> SpiralFileSystem.write_all_text_async outputPath diff --git a/apps/parser/DibParser.dib.html b/apps/parser/DibParser.dib.html index d62135729..fbff38af4 100644 --- a/apps/parser/DibParser.dib.html +++ b/apps/parser/DibParser.dib.html @@ -9141,7 +9141,7 @@

writeDibCodelet pathDir = path |> System.IO.Path.GetDirectoryName let fileNameWithoutExt = match output, path |> System.IO.Path.GetFileNameWithoutExtension with - | Spir, fileNameWithoutExt -> $"real_{fileNameWithoutExt}" + | Spir, fileNameWithoutExt -> $"{fileNameWithoutExt}_real" | _, fileNameWithoutExt -> fileNameWithoutExt let outputPath = pathDir </> $"{fileNameWithoutExt}.{output |> string |> SpiralSm.to_lower}" do! result |> SpiralFileSystem.write_all_text_async outputPath @@ -9333,8 +9333,8 @@

main

diff --git a/apps/parser/DibParser.dib.ipynb b/apps/parser/DibParser.dib.ipynb index 742715ece..20cc66caf 100644 --- a/apps/parser/DibParser.dib.ipynb +++ b/apps/parser/DibParser.dib.ipynb @@ -1553,7 +1553,7 @@ " let pathDir = path |> System.IO.Path.GetDirectoryName\n", " let fileNameWithoutExt =\n", " match output, path |> System.IO.Path.GetFileNameWithoutExtension with\n", - " | Spir, fileNameWithoutExt -> $\"real_{fileNameWithoutExt}\"\n", + " | Spir, fileNameWithoutExt -> $\"{fileNameWithoutExt}_real\"\n", " | _, fileNameWithoutExt -> fileNameWithoutExt\n", " let outputPath = pathDir $\"{fileNameWithoutExt}.{output |> string |> SpiralSm.to_lower}\"\n", " do! result |> SpiralFileSystem.write_all_text_async outputPath\n", @@ -1725,8 +1725,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "00:00:05 \u001B[94m debug\u001B[0m #1 writeDibCode / output: Fs / path: DibParser.dib\n", - "00:00:05 \u001B[94m debug\u001B[0m #2 parseDibCode / output: Fs / file: DibParser.dib\n" + "00:00:06 \u001B[94m debug\u001B[0m #1 writeDibCode / output: Fs / path: DibParser.dib\n", + "00:00:06 \u001B[94m debug\u001B[0m #2 parseDibCode / output: Fs / file: DibParser.dib\n" ] } ], diff --git a/apps/parser/DibParser.fs b/apps/parser/DibParser.fs index 26d6b570d..91611261e 100644 --- a/apps/parser/DibParser.fs +++ b/apps/parser/DibParser.fs @@ -260,7 +260,7 @@ module {moduleName} =" let pathDir = path |> System.IO.Path.GetDirectoryName let fileNameWithoutExt = match output, path |> System.IO.Path.GetFileNameWithoutExtension with - | Spir, fileNameWithoutExt -> $"real_{fileNameWithoutExt}" + | Spir, fileNameWithoutExt -> $"{fileNameWithoutExt}_real" | _, fileNameWithoutExt -> fileNameWithoutExt let outputPath = pathDir $"{fileNameWithoutExt}.{output |> string |> SpiralSm.to_lower}" do! result |> SpiralFileSystem.write_all_text_async outputPath diff --git a/apps/spiral/Eval.dib b/apps/spiral/Eval.dib index 4de8e8829..c6ec3be08 100644 --- a/apps/spiral/Eval.dib +++ b/apps/spiral/Eval.dib @@ -163,6 +163,14 @@ let mutable allCode = "" #!markdown +### allPackages + +#!fsharp + +let mutable allPackages : string [] = [||] + +#!markdown + ## allCodeReal #!fsharp @@ -220,7 +228,7 @@ let inline startTokenRangeWatcher () = let tokensPath = codeDir "tokens.json" if tokensPath |> File.Exists |> not then let spiralCodePath = codeDir "main.spi" - let spiralRealCodePath = codeDir "real_main.spir" + let spiralRealCodePath = codeDir "main_real.spir" let spiralExists = spiralCodePath |> System.IO.File.Exists let spiralRealExists = spiralRealCodePath |> System.IO.File.Exists if spiralExists |> not && spiralRealExists |> not @@ -248,7 +256,7 @@ let inline startTokenRangeWatcher () = |> FSharp.Control.AsyncSeq.iterAsyncParallel (fun (ticks, event) -> match event with | FileSystem.FileSystemChange.Changed (codePath, _) - when [ "main.spi"; "real_main.spir" ] + when [ "main.spi"; "main_real.spir" ] |> List.contains (System.IO.Path.GetFileName codePath) -> async { @@ -731,6 +739,16 @@ let inline eval else None ) + let packages = + lines + |> Array.choose (fun line -> + if line |> SpiralSm.starts_with "//// package=" + then line |> SpiralSm.split "=" |> Array.skip 1 |> SpiralSm.concat "" |> Some + else None + ) + + allPackages <- packages |> Array.append allPackages |> Array.distinct + let timeout = lines |> Array.tryPick (fun line -> @@ -807,7 +825,7 @@ let inline eval else Supervisor.Spi (newAllCode, if allCodeReal = "" then None else Some allCodeReal) - |> Supervisor.buildCode backend isCache timeout cancellationToken + |> Supervisor.buildCode backend allPackages isCache timeout cancellationToken return backend, result }) |> Async.Parallel diff --git a/apps/spiral/Eval.dib.html b/apps/spiral/Eval.dib.html index 8e74244b8..323ab9ff3 100644 --- a/apps/spiral/Eval.dib.html +++ b/apps/spiral/Eval.dib.html @@ -7842,7 +7842,7 @@

allCode

@@ -7854,7 +7854,7 @@

allCodeRealIn [ ]: @@ -7879,7 +7879,7 @@

traceToggleIn [ ]: @@ -7904,6 +7904,31 @@

getParentProcessIdIn [ ]: + + + +