MAJOR refactoring
This commit is contained in:
parent
8952552eef
commit
13a47ec30b
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@ -42,3 +42,8 @@ jobs:
|
|||||||
crate: cargo-all-features
|
crate: cargo-all-features
|
||||||
version: latest
|
version: latest
|
||||||
- run: cargo test-all-features
|
- run: cargo test-all-features
|
||||||
|
|
||||||
|
- name: Test Parsing
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: check --package parsing
|
||||||
|
|||||||
164
Cargo.lock
generated
164
Cargo.lock
generated
@ -484,20 +484,28 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "eframe"
|
name = "eframe"
|
||||||
version = "0.17.0"
|
version = "0.18.0"
|
||||||
source = "git+https://github.com/Titaniumtown/egui.git#0e8e8b76a042115498449c9da8e0f2ccae87df82"
|
source = "git+https://github.com/Titaniumtown/egui.git#f2321e8a7cbfb11e0f076edbdd62e95528409ca1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"bytemuck",
|
||||||
"egui",
|
"egui",
|
||||||
"egui-winit",
|
"egui-winit",
|
||||||
"egui_glow",
|
"egui_glow",
|
||||||
"egui_web",
|
"glow",
|
||||||
"epi",
|
"glutin",
|
||||||
|
"js-sys",
|
||||||
|
"percent-encoding",
|
||||||
|
"tracing",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"wasm-bindgen-futures",
|
||||||
|
"web-sys",
|
||||||
|
"winit",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "egui"
|
name = "egui"
|
||||||
version = "0.17.0"
|
version = "0.18.1"
|
||||||
source = "git+https://github.com/Titaniumtown/egui.git#0e8e8b76a042115498449c9da8e0f2ccae87df82"
|
source = "git+https://github.com/Titaniumtown/egui.git#f2321e8a7cbfb11e0f076edbdd62e95528409ca1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ahash",
|
"ahash",
|
||||||
"epaint",
|
"epaint",
|
||||||
@ -507,13 +515,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "egui-winit"
|
name = "egui-winit"
|
||||||
version = "0.17.0"
|
version = "0.18.0"
|
||||||
source = "git+https://github.com/Titaniumtown/egui.git#0e8e8b76a042115498449c9da8e0f2ccae87df82"
|
source = "git+https://github.com/Titaniumtown/egui.git#f2321e8a7cbfb11e0f076edbdd62e95528409ca1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arboard",
|
"arboard",
|
||||||
"egui",
|
"egui",
|
||||||
"epi",
|
|
||||||
"glow",
|
|
||||||
"instant",
|
"instant",
|
||||||
"tracing",
|
"tracing",
|
||||||
"webbrowser",
|
"webbrowser",
|
||||||
@ -522,38 +528,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "egui_glow"
|
name = "egui_glow"
|
||||||
version = "0.17.0"
|
version = "0.18.0"
|
||||||
source = "git+https://github.com/Titaniumtown/egui.git#0e8e8b76a042115498449c9da8e0f2ccae87df82"
|
source = "git+https://github.com/Titaniumtown/egui.git#f2321e8a7cbfb11e0f076edbdd62e95528409ca1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"egui",
|
"egui",
|
||||||
"egui-winit",
|
|
||||||
"epi",
|
|
||||||
"glow",
|
"glow",
|
||||||
"glutin",
|
|
||||||
"memoffset",
|
"memoffset",
|
||||||
"tracing",
|
"tracing",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"web-sys",
|
"web-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "egui_web"
|
|
||||||
version = "0.17.0"
|
|
||||||
source = "git+https://github.com/Titaniumtown/egui.git#0e8e8b76a042115498449c9da8e0f2ccae87df82"
|
|
||||||
dependencies = [
|
|
||||||
"bytemuck",
|
|
||||||
"egui",
|
|
||||||
"egui_glow",
|
|
||||||
"epi",
|
|
||||||
"js-sys",
|
|
||||||
"percent-encoding",
|
|
||||||
"tracing",
|
|
||||||
"wasm-bindgen",
|
|
||||||
"wasm-bindgen-futures",
|
|
||||||
"web-sys",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "either"
|
name = "either"
|
||||||
version = "1.6.1"
|
version = "1.6.1"
|
||||||
@ -562,16 +548,16 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "emath"
|
name = "emath"
|
||||||
version = "0.17.0"
|
version = "0.18.0"
|
||||||
source = "git+https://github.com/Titaniumtown/egui.git#0e8e8b76a042115498449c9da8e0f2ccae87df82"
|
source = "git+https://github.com/Titaniumtown/egui.git#f2321e8a7cbfb11e0f076edbdd62e95528409ca1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "epaint"
|
name = "epaint"
|
||||||
version = "0.17.0"
|
version = "0.18.1"
|
||||||
source = "git+https://github.com/Titaniumtown/egui.git#0e8e8b76a042115498449c9da8e0f2ccae87df82"
|
source = "git+https://github.com/Titaniumtown/egui.git#f2321e8a7cbfb11e0f076edbdd62e95528409ca1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ab_glyph",
|
"ab_glyph",
|
||||||
"ahash",
|
"ahash",
|
||||||
@ -582,16 +568,6 @@ dependencies = [
|
|||||||
"parking_lot 0.12.0",
|
"parking_lot 0.12.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "epi"
|
|
||||||
version = "0.17.0"
|
|
||||||
source = "git+https://github.com/Titaniumtown/egui.git#0e8e8b76a042115498449c9da8e0f2ccae87df82"
|
|
||||||
dependencies = [
|
|
||||||
"egui",
|
|
||||||
"glow",
|
|
||||||
"tracing",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "error-code"
|
name = "error-code"
|
||||||
version = "2.3.1"
|
version = "2.3.1"
|
||||||
@ -610,8 +586,8 @@ checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "exmex"
|
name = "exmex"
|
||||||
version = "0.15.0"
|
version = "0.16.0"
|
||||||
source = "git+https://github.com/bertiqwerty/exmex.git?branch=main#4f34fb927246009b6b716b5ba8e35f045d27c239"
|
source = "git+https://github.com/bertiqwerty/exmex.git?branch=main#a854d7af15d2bb65ec0c62b60f104640c70da5b3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"num",
|
"num",
|
||||||
@ -681,7 +657,7 @@ dependencies = [
|
|||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"libc",
|
"libc",
|
||||||
"wasi 0.10.2+wasi-snapshot-preview1",
|
"wasi 0.10.0+wasi-snapshot-preview1",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -904,9 +880,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.124"
|
version = "0.2.125"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "21a41fed9d98f27ab1c6d161da622a4fa35e8a54a8adc24bbf3ddd0ef70b0e50"
|
checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libgit2-sys"
|
name = "libgit2-sys"
|
||||||
@ -954,9 +930,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.16"
|
version = "0.4.17"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8"
|
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
]
|
]
|
||||||
@ -978,9 +954,9 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
version = "2.4.1"
|
version = "2.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
|
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memmap2"
|
name = "memmap2"
|
||||||
@ -1190,18 +1166,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-complex"
|
name = "num-complex"
|
||||||
version = "0.4.0"
|
version = "0.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "26873667bbbb7c5182d4a37c1add32cdf09f841af72da53318fdb81543c15085"
|
checksum = "97fbc387afefefd5e9e39493299f3069e14a140dd34dc19b4c1c1a8fddb6a790"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num-traits",
|
"num-traits",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-integer"
|
name = "num-integer"
|
||||||
version = "0.1.44"
|
version = "0.1.45"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
|
checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
@ -1232,9 +1208,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-traits"
|
name = "num-traits"
|
||||||
version = "0.2.14"
|
version = "0.2.15"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
|
checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
]
|
]
|
||||||
@ -1351,7 +1327,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58"
|
checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lock_api",
|
"lock_api",
|
||||||
"parking_lot_core 0.9.2",
|
"parking_lot_core 0.9.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1370,9 +1346,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking_lot_core"
|
name = "parking_lot_core"
|
||||||
version = "0.9.2"
|
version = "0.9.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "995f667a6c822200b0433ac218e05582f0e2efa1b922a3fd2fbaadc5f87bab37"
|
checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"libc",
|
"libc",
|
||||||
@ -1573,7 +1549,7 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruzstd"
|
name = "ruzstd"
|
||||||
version = "0.2.4"
|
version = "0.2.4"
|
||||||
source = "git+https://github.com/KillingSpark/zstd-rs.git#66d02e41e8f88aac3f39e6f6a9ef4320073d9431"
|
source = "git+https://github.com/Titaniumtown/zstd-rs.git?branch=ringbuffer#d7f5caaf23146cd525a2a215241661ecf0aa073a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"twox-hash",
|
"twox-hash",
|
||||||
@ -1608,15 +1584,15 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.136"
|
version = "1.0.137"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789"
|
checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.79"
|
version = "1.0.80"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95"
|
checksum = "f972498cf015f7c0746cac89ebe1d6ef10c293b94175a243a2d9442c163d9944"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"ryu",
|
"ryu",
|
||||||
@ -1714,9 +1690,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.91"
|
version = "1.0.92"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d"
|
checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -1736,18 +1712,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror"
|
name = "thiserror"
|
||||||
version = "1.0.30"
|
version = "1.0.31"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417"
|
checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"thiserror-impl",
|
"thiserror-impl",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror-impl"
|
name = "thiserror-impl"
|
||||||
version = "1.0.30"
|
version = "1.0.31"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
|
checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -1765,11 +1741,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time"
|
name = "time"
|
||||||
version = "0.1.43"
|
version = "0.1.44"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
|
checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
|
"wasi 0.10.0+wasi-snapshot-preview1",
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1899,9 +1876,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-xid"
|
name = "unicode-xid"
|
||||||
version = "0.2.2"
|
version = "0.2.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "url"
|
name = "url"
|
||||||
@ -1956,9 +1933,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasi"
|
name = "wasi"
|
||||||
version = "0.10.2+wasi-snapshot-preview1"
|
version = "0.10.0+wasi-snapshot-preview1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
|
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasi"
|
name = "wasi"
|
||||||
@ -2199,9 +2176,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-sys"
|
name = "windows-sys"
|
||||||
version = "0.34.0"
|
version = "0.36.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5acdd78cb4ba54c0045ac14f62d8f94a03d10047904ae2a40afa1e99d8f70825"
|
checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows_aarch64_msvc",
|
"windows_aarch64_msvc",
|
||||||
"windows_i686_gnu",
|
"windows_i686_gnu",
|
||||||
@ -2212,33 +2189,33 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_msvc"
|
name = "windows_aarch64_msvc"
|
||||||
version = "0.34.0"
|
version = "0.36.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d"
|
checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnu"
|
name = "windows_i686_gnu"
|
||||||
version = "0.34.0"
|
version = "0.36.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed"
|
checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_msvc"
|
name = "windows_i686_msvc"
|
||||||
version = "0.34.0"
|
version = "0.36.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956"
|
checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnu"
|
name = "windows_x86_64_gnu"
|
||||||
version = "0.34.0"
|
version = "0.36.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4"
|
checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_msvc"
|
name = "windows_x86_64_msvc"
|
||||||
version = "0.34.0"
|
version = "0.36.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9"
|
checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winit"
|
name = "winit"
|
||||||
@ -2333,7 +2310,6 @@ dependencies = [
|
|||||||
"egui",
|
"egui",
|
||||||
"emath",
|
"emath",
|
||||||
"epaint",
|
"epaint",
|
||||||
"epi",
|
|
||||||
"instant",
|
"instant",
|
||||||
"itertools",
|
"itertools",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
|
|||||||
@ -17,7 +17,7 @@ debug = false
|
|||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
opt-level = "z" #optimize for size
|
opt-level = "z" #optimize for size
|
||||||
#lto = "fat" #causes issues with wasm, disabling for the time being
|
#lto = "fat" #causes issues with wasm, disabling for the time being
|
||||||
strip = true
|
strip = false
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
@ -33,7 +33,6 @@ parsing = { path = "./parsing" }
|
|||||||
eframe = { git = "https://github.com/Titaniumtown/egui.git", default-features = false }
|
eframe = { git = "https://github.com/Titaniumtown/egui.git", default-features = false }
|
||||||
egui = { git = "https://github.com/Titaniumtown/egui.git", default-features = false }
|
egui = { git = "https://github.com/Titaniumtown/egui.git", default-features = false }
|
||||||
epaint = { git = "https://github.com/Titaniumtown/egui.git", default-features = false }
|
epaint = { git = "https://github.com/Titaniumtown/egui.git", default-features = false }
|
||||||
epi = { git = "https://github.com/Titaniumtown/egui.git", default-features = false }
|
|
||||||
emath = { git = "https://github.com/Titaniumtown/egui.git", default-features = false }
|
emath = { git = "https://github.com/Titaniumtown/egui.git", default-features = false }
|
||||||
|
|
||||||
shadow-rs = { version = "0.11", default-features = false }
|
shadow-rs = { version = "0.11", default-features = false }
|
||||||
@ -41,7 +40,7 @@ const_format = { version = "0.2", default-features = false, features = ["fmt"] }
|
|||||||
cfg-if = "1"
|
cfg-if = "1"
|
||||||
lazy_static = "1"
|
lazy_static = "1"
|
||||||
tar = "0.4"
|
tar = "0.4"
|
||||||
ruzstd = { git = "https://github.com/KillingSpark/zstd-rs.git" }
|
ruzstd = { git = "https://github.com/Titaniumtown/zstd-rs.git", branch = "ringbuffer" }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
itertools = "0.10"
|
itertools = "0.10"
|
||||||
|
|||||||
@ -1,2 +1,4 @@
|
|||||||
|
#![feature(const_trait_impl)]
|
||||||
|
|
||||||
pub mod parsing;
|
pub mod parsing;
|
||||||
pub mod suggestions;
|
pub mod suggestions;
|
||||||
|
|||||||
@ -150,95 +150,11 @@ pub fn is_number(c: &char) -> bool { NUMBERS.contains(&c) }
|
|||||||
/// In the future I may want to completely rewrite this or implement this natively in exmex.
|
/// In the future I may want to completely rewrite this or implement this natively in exmex.
|
||||||
// TODO: use `split_function` here instead of this janky code
|
// TODO: use `split_function` here instead of this janky code
|
||||||
pub fn process_func_str(function_in: &str) -> String {
|
pub fn process_func_str(function_in: &str) -> String {
|
||||||
let function = function_in
|
if function_in.is_empty() {
|
||||||
.replace("log10(", "log(") // log10 -> log
|
return String::new();
|
||||||
.replace("pi", "π") // pi -> π
|
|
||||||
.replace("exp", "\u{1fc93}") // replace 'exp' with this random unicode character because it can't be parsed correctly
|
|
||||||
.replace("**", "^"); // alternate exponential representation
|
|
||||||
let function_chars: Vec<char> = function.chars().collect();
|
|
||||||
let mut output_string: String = String::new();
|
|
||||||
for (i, c) in function_chars.iter().enumerate() {
|
|
||||||
let mut add_asterisk: bool = false;
|
|
||||||
|
|
||||||
let prev_prev_prev_char = if i > 2 {
|
|
||||||
*function_chars.get(i - 3).unwrap()
|
|
||||||
} else {
|
|
||||||
' '
|
|
||||||
};
|
|
||||||
|
|
||||||
let prev_prev_char = if i > 1 {
|
|
||||||
*function_chars.get(i - 2).unwrap()
|
|
||||||
} else {
|
|
||||||
' '
|
|
||||||
};
|
|
||||||
|
|
||||||
let prev_char = if i > 0 {
|
|
||||||
*function_chars.get(i - 1).unwrap()
|
|
||||||
} else {
|
|
||||||
' '
|
|
||||||
};
|
|
||||||
|
|
||||||
let c_is_number = is_number(c);
|
|
||||||
let c_is_letter = is_letter(c);
|
|
||||||
let c_is_variable = is_variable(c);
|
|
||||||
let prev_char_is_variable = is_variable(&prev_char);
|
|
||||||
let prev_char_is_number = is_number(&prev_char);
|
|
||||||
|
|
||||||
// makes special case for log with base of a 1-2 digit number
|
|
||||||
if ((prev_prev_prev_char == 'l')
|
|
||||||
&& (prev_prev_char == 'o')
|
|
||||||
&& (prev_char == 'g')
|
|
||||||
&& c_is_number)
|
|
||||||
| ((prev_prev_char == 'c') && (prev_char == 'e') && (*c == 'i'))
|
|
||||||
{
|
|
||||||
output_string += &c.to_string();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
let c_letters_var = c_is_letter | c_is_variable;
|
|
||||||
let prev_letters_var = prev_char_is_variable | is_letter(&prev_char);
|
|
||||||
|
|
||||||
if prev_char == ')' {
|
|
||||||
// cases like `)x`, `)2`, and `)(`
|
|
||||||
if c_letters_var | c_is_number | (*c == '(') {
|
|
||||||
add_asterisk = true;
|
|
||||||
}
|
|
||||||
} else if *c == '(' {
|
|
||||||
// cases like `x(` and `2(`
|
|
||||||
if (prev_char_is_variable | prev_char_is_number) && !is_letter(&prev_prev_char) {
|
|
||||||
add_asterisk = true;
|
|
||||||
}
|
|
||||||
} else if prev_char_is_number {
|
|
||||||
// cases like `2x` and `2sin(x)`
|
|
||||||
if c_letters_var {
|
|
||||||
add_asterisk = true;
|
|
||||||
}
|
|
||||||
} else if c_is_letter {
|
|
||||||
// cases like `e2` and `xx`
|
|
||||||
if prev_char_is_number
|
|
||||||
| (prev_char_is_variable && c_is_variable)
|
|
||||||
| prev_char_is_variable
|
|
||||||
| (prev_char == 'π')
|
|
||||||
{
|
|
||||||
add_asterisk = true;
|
|
||||||
}
|
|
||||||
} else if (c_is_number | c_letters_var) && prev_letters_var {
|
|
||||||
// cases like `x2` and `xx`
|
|
||||||
add_asterisk = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if add_asterisk is true, add the asterisk
|
|
||||||
if add_asterisk {
|
|
||||||
output_string += "*";
|
|
||||||
}
|
|
||||||
|
|
||||||
// push current char to `output_string` (which is eventually returned)
|
|
||||||
output_string += &c.to_string();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
output_string
|
crate::suggestions::split_function(&function_in).join("*")
|
||||||
.replace("log(", "log10(")
|
|
||||||
.replace('\u{1fc93}', "exp")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
@ -326,6 +242,7 @@ mod tests {
|
|||||||
("pisin(x)", "π*sin(x)"),
|
("pisin(x)", "π*sin(x)"),
|
||||||
("e^sin(x)", "e^sin(x)"),
|
("e^sin(x)", "e^sin(x)"),
|
||||||
("x**2", "x^2"),
|
("x**2", "x^2"),
|
||||||
|
("(x+1)(x-3)", "(x+1)*(x-3)"),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
for (key, value) in values {
|
for (key, value) in values {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
use crate::parsing::is_number;
|
use crate::parsing::{is_letter, is_number, is_variable};
|
||||||
|
|
||||||
pub const HINT_EMPTY: Hint = Hint::Single("x^2");
|
pub const HINT_EMPTY: Hint = Hint::Single("x^2");
|
||||||
const HINT_CLOSED_PARENS: Hint = Hint::Single(")");
|
const HINT_CLOSED_PARENS: Hint = Hint::Single(")");
|
||||||
@ -13,7 +13,17 @@ macro_rules! test_print {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn split_function(input: &str) -> Vec<String> {
|
pub fn split_function(input: &str) -> Vec<String> {
|
||||||
split_function_chars(&input.chars().collect::<Vec<char>>())
|
split_function_chars(
|
||||||
|
&input
|
||||||
|
.replace("pi", "π")
|
||||||
|
.replace("**", "^")
|
||||||
|
.replace("exp", "\u{1fc93}")
|
||||||
|
.chars()
|
||||||
|
.collect::<Vec<char>>(),
|
||||||
|
)
|
||||||
|
.iter()
|
||||||
|
.map(|x| x.replace("\u{1fc93}", "exp"))
|
||||||
|
.collect::<Vec<String>>()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn split_function_chars(chars: &[char]) -> Vec<String> {
|
fn split_function_chars(chars: &[char]) -> Vec<String> {
|
||||||
@ -22,19 +32,120 @@ fn split_function_chars(chars: &[char]) -> Vec<String> {
|
|||||||
let mut split: Vec<String> = Vec::new();
|
let mut split: Vec<String> = Vec::new();
|
||||||
|
|
||||||
let mut buffer: Vec<char> = Vec::new();
|
let mut buffer: Vec<char> = Vec::new();
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
|
struct BoolSlice {
|
||||||
|
closing_parens: bool,
|
||||||
|
number: bool,
|
||||||
|
letter: bool,
|
||||||
|
variable: bool,
|
||||||
|
masked_num: bool,
|
||||||
|
masked_var: bool,
|
||||||
|
exists: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl BoolSlice {
|
||||||
|
#[inline]
|
||||||
|
fn is_variable(&self) -> bool { self.variable && !self.masked_var }
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn is_number(&self) -> bool { self.number && !self.masked_num }
|
||||||
|
}
|
||||||
|
let mut prev_char: BoolSlice = BoolSlice::default();
|
||||||
|
|
||||||
for c in chars {
|
for c in chars {
|
||||||
buffer.push(*c);
|
let mut curr_c = BoolSlice {
|
||||||
if *c == ')' {
|
closing_parens: c == &')',
|
||||||
split.push(buffer.iter().collect::<String>());
|
number: is_number(c),
|
||||||
buffer.clear();
|
letter: is_letter(c),
|
||||||
continue;
|
variable: is_variable(c),
|
||||||
}
|
masked_num: if is_number(c) {
|
||||||
|
prev_char.masked_num
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
},
|
||||||
|
masked_var: if is_variable(c) {
|
||||||
|
prev_char.masked_var
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
},
|
||||||
|
exists: true,
|
||||||
|
};
|
||||||
|
|
||||||
let buffer_string = buffer.iter().collect::<String>();
|
let buffer_string = buffer.iter().collect::<String>();
|
||||||
|
|
||||||
if ((&buffer_string == "log") | (&buffer_string == "log1")) && is_number(&c) {
|
// Check if prev_char is valid
|
||||||
continue;
|
if prev_char.exists {
|
||||||
|
// if previous char was a masked number, and current char is a number, mask current char's variable status
|
||||||
|
if prev_char.masked_num && curr_c.number {
|
||||||
|
curr_c.masked_num = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if previous char was a masked variable, and current char is a variable, mask current char's variable status
|
||||||
|
if prev_char.masked_var && curr_c.variable {
|
||||||
|
curr_c.masked_var = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if letter and not a variable (or a masked variable)
|
||||||
|
if prev_char.letter && !(prev_char.variable && !prev_char.masked_var) {
|
||||||
|
// mask number status if current char is number
|
||||||
|
if curr_c.number {
|
||||||
|
curr_c.masked_num = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// mask variable status if current char is a variable
|
||||||
|
if curr_c.variable {
|
||||||
|
curr_c.masked_var = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mut do_split = false;
|
||||||
|
|
||||||
|
if prev_char.closing_parens {
|
||||||
|
// cases like `)x`, `)2`, and `)(`
|
||||||
|
if (c == &'(')
|
||||||
|
| (curr_c.letter && !curr_c.is_variable())
|
||||||
|
| curr_c.is_variable()
|
||||||
|
| curr_c.is_number()
|
||||||
|
{
|
||||||
|
do_split = true;
|
||||||
|
}
|
||||||
|
} else if c == &'(' {
|
||||||
|
// cases like `x(` and `2(`
|
||||||
|
if (prev_char.is_variable() | prev_char.is_number()) && !prev_char.letter {
|
||||||
|
do_split = true;
|
||||||
|
}
|
||||||
|
} else if prev_char.is_number() {
|
||||||
|
// cases like `2x` and `2sin(x)`
|
||||||
|
if curr_c.is_variable() | curr_c.letter {
|
||||||
|
do_split = true;
|
||||||
|
}
|
||||||
|
} else if curr_c.is_variable() | curr_c.letter {
|
||||||
|
// cases like `e2` and `xx`
|
||||||
|
if prev_char.is_number()
|
||||||
|
| (prev_char.is_variable() && curr_c.is_variable())
|
||||||
|
| prev_char.is_variable()
|
||||||
|
{
|
||||||
|
do_split = true;
|
||||||
|
}
|
||||||
|
} else if (curr_c.is_number() | curr_c.letter | curr_c.is_variable())
|
||||||
|
&& (prev_char.is_number() | prev_char.letter)
|
||||||
|
{
|
||||||
|
// cases like `x2` and `xx`
|
||||||
|
do_split = true;
|
||||||
|
} else if curr_c.is_number() && prev_char.is_variable() {
|
||||||
|
do_split = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// split and append buffer
|
||||||
|
if do_split {
|
||||||
|
split.push(buffer_string);
|
||||||
|
buffer.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer.push(*c);
|
||||||
|
prev_char = curr_c;
|
||||||
}
|
}
|
||||||
|
|
||||||
if !buffer.is_empty() {
|
if !buffer.is_empty() {
|
||||||
@ -75,10 +186,6 @@ pub enum Hint<'a> {
|
|||||||
None,
|
None,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> std::fmt::Debug for Hint<'a> {
|
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self) }
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> std::fmt::Display for Hint<'a> {
|
impl<'a> std::fmt::Display for Hint<'a> {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
@ -95,6 +202,12 @@ impl<'a> std::fmt::Display for Hint<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a> std::fmt::Debug for Hint<'a> {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
|
std::fmt::Display::fmt(self, f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'a> Hint<'a> {
|
impl<'a> Hint<'a> {
|
||||||
pub fn is_none(&self) -> bool { matches!(self, Hint::None) }
|
pub fn is_none(&self) -> bool { matches!(self, Hint::None) }
|
||||||
|
|
||||||
@ -163,11 +276,17 @@ mod tests {
|
|||||||
.flatten()
|
.flatten()
|
||||||
.filter(|func| !SUPPORTED_FUNCTIONS.contains(&func.as_str()))
|
.filter(|func| !SUPPORTED_FUNCTIONS.contains(&func.as_str()))
|
||||||
.for_each(|key| {
|
.for_each(|key| {
|
||||||
println!("{}", key);
|
let split = super::split_function(&key);
|
||||||
if super::generate_hint(&key).is_none() {
|
|
||||||
|
if split.len() != 1 {
|
||||||
|
panic!("failed: {} (len: {}, split: {:?})", key, split.len(), split);
|
||||||
|
}
|
||||||
|
|
||||||
|
let generated_hint = super::generate_hint(&key);
|
||||||
|
if generated_hint.is_none() {
|
||||||
println!("success: {}", key);
|
println!("success: {}", key);
|
||||||
} else {
|
} else {
|
||||||
panic!("failed: {}", key);
|
panic!("failed: {} (Hint: '{}')", key, generated_hint.to_string());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -179,6 +298,7 @@ mod tests {
|
|||||||
("cos(", vec!["cos("]),
|
("cos(", vec!["cos("]),
|
||||||
("cos(x)sin(x)", vec!["cos(x)", "sin(x)"]),
|
("cos(x)sin(x)", vec!["cos(x)", "sin(x)"]),
|
||||||
("aaaaaaaaaaa", vec!["aaaaaaaaaaa"]),
|
("aaaaaaaaaaa", vec!["aaaaaaaaaaa"]),
|
||||||
|
("emax(x)", vec!["e", "max(x)"]),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
for (key, value) in values {
|
for (key, value) in values {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
use crate::consts::is_mobile;
|
use crate::consts::is_mobile;
|
||||||
use crate::function_entry::{FunctionEntry, DEFAULT_FUNCTION_ENTRY};
|
use crate::function_entry::{FunctionEntry, DEFAULT_FUNCTION_ENTRY};
|
||||||
use crate::widgets::{move_cursor_to_end, widgets_ontop, Movement};
|
use crate::widgets::{move_cursor_to_end, widgets_ontop, Movement};
|
||||||
use egui::{Button, Key, Modifiers};
|
use egui::{Button, Key, Modifiers, RichText, WidgetText};
|
||||||
use emath::vec2;
|
use emath::vec2;
|
||||||
use parsing::suggestions::Hint;
|
use parsing::suggestions::Hint;
|
||||||
use std::ops::BitXorAssign;
|
use std::ops::BitXorAssign;
|
||||||
@ -128,8 +128,8 @@ impl FunctionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Function that creates button that's used with the `button_area`
|
/// Function that creates button that's used with the `button_area`
|
||||||
fn button_area_button(text: impl Into<egui::WidgetText>) -> Button {
|
const fn button_area_button(text: String) -> Button {
|
||||||
Button::new(text.into()).frame(false)
|
Button::new_const(WidgetText::RichText(RichText::new_const(text))).frame(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// the y offset multiplier of the `buttons_area` area
|
/// the y offset multiplier of the `buttons_area` area
|
||||||
@ -144,7 +144,7 @@ impl FunctionManager {
|
|||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
// There's more than 1 function! Functions can now be deleted
|
// There's more than 1 function! Functions can now be deleted
|
||||||
if ui
|
if ui
|
||||||
.add_enabled(can_remove, button_area_button("✖"))
|
.add_enabled(can_remove, button_area_button("✖".to_owned()))
|
||||||
.on_hover_text("Delete Function")
|
.on_hover_text("Delete Function")
|
||||||
.clicked()
|
.clicked()
|
||||||
{
|
{
|
||||||
@ -153,7 +153,7 @@ impl FunctionManager {
|
|||||||
|
|
||||||
// Toggle integral being enabled or not
|
// Toggle integral being enabled or not
|
||||||
function.integral.bitxor_assign(
|
function.integral.bitxor_assign(
|
||||||
ui.add(button_area_button("∫"))
|
ui.add(button_area_button("∫".to_owned()))
|
||||||
.on_hover_text(match function.integral {
|
.on_hover_text(match function.integral {
|
||||||
true => "Don't integrate",
|
true => "Don't integrate",
|
||||||
false => "Integrate",
|
false => "Integrate",
|
||||||
@ -163,7 +163,7 @@ impl FunctionManager {
|
|||||||
|
|
||||||
// Toggle showing the derivative (even though it's already calculated this option just toggles if it's displayed or not)
|
// Toggle showing the derivative (even though it's already calculated this option just toggles if it's displayed or not)
|
||||||
function.derivative.bitxor_assign(
|
function.derivative.bitxor_assign(
|
||||||
ui.add(button_area_button("d/dx"))
|
ui.add(button_area_button("d/dx".to_owned()))
|
||||||
.on_hover_text(match function.derivative {
|
.on_hover_text(match function.derivative {
|
||||||
true => "Don't Differentiate",
|
true => "Don't Differentiate",
|
||||||
false => "Differentiate",
|
false => "Differentiate",
|
||||||
@ -172,7 +172,7 @@ impl FunctionManager {
|
|||||||
);
|
);
|
||||||
|
|
||||||
function.settings_opened.bitxor_assign(
|
function.settings_opened.bitxor_assign(
|
||||||
ui.add(button_area_button("⚙"))
|
ui.add(button_area_button("⚙".to_owned()))
|
||||||
.on_hover_text(match function.settings_opened {
|
.on_hover_text(match function.settings_opened {
|
||||||
true => "Close Settings",
|
true => "Close Settings",
|
||||||
false => "Open Settings",
|
false => "Open Settings",
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#![feature(const_mut_refs)]
|
#![feature(const_mut_refs)]
|
||||||
#![feature(let_chains)]
|
#![feature(let_chains)]
|
||||||
#![feature(stmt_expr_attributes)]
|
#![feature(stmt_expr_attributes)]
|
||||||
|
#![feature(const_trait_impl)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate static_assertions;
|
extern crate static_assertions;
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#![feature(const_mut_refs)]
|
#![feature(const_mut_refs)]
|
||||||
#![feature(let_chains)]
|
#![feature(let_chains)]
|
||||||
#![feature(stmt_expr_attributes)]
|
#![feature(stmt_expr_attributes)]
|
||||||
|
#![feature(const_trait_impl)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate static_assertions;
|
extern crate static_assertions;
|
||||||
|
|||||||
@ -2,6 +2,7 @@ use crate::consts::*;
|
|||||||
use crate::function_entry::Riemann;
|
use crate::function_entry::Riemann;
|
||||||
use crate::function_manager::FunctionManager;
|
use crate::function_manager::FunctionManager;
|
||||||
use crate::misc::{dyn_mut_iter, option_vec_printer, TextData};
|
use crate::misc::{dyn_mut_iter, option_vec_printer, TextData};
|
||||||
|
use eframe::App;
|
||||||
use egui::{
|
use egui::{
|
||||||
plot::Plot, style::Margin, vec2, Button, CentralPanel, Color32, ComboBox, Context, FontData,
|
plot::Plot, style::Margin, vec2, Button, CentralPanel, Color32, ComboBox, Context, FontData,
|
||||||
FontDefinitions, FontFamily, Frame, Key, RichText, SidePanel, Slider, TopBottomPanel, Vec2,
|
FontDefinitions, FontFamily, Frame, Key, RichText, SidePanel, Slider, TopBottomPanel, Vec2,
|
||||||
@ -136,8 +137,6 @@ impl MathApp {
|
|||||||
#[cfg(not(threading))]
|
#[cfg(not(threading))]
|
||||||
tracing::info!("Threading: Disabled");
|
tracing::info!("Threading: Disabled");
|
||||||
|
|
||||||
tracing::info!("Integration name: {}", cc.integration_info.name);
|
|
||||||
|
|
||||||
if let Some(web_info) = &cc.integration_info.web_info {
|
if let Some(web_info) = &cc.integration_info.web_info {
|
||||||
tracing::info!("Web Info: {:?}", web_info);
|
tracing::info!("Web Info: {:?}", web_info);
|
||||||
}
|
}
|
||||||
@ -382,9 +381,9 @@ impl MathApp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl epi::App for MathApp {
|
impl App for MathApp {
|
||||||
/// Called each time the UI needs repainting.
|
/// Called each time the UI needs repainting.
|
||||||
fn update(&mut self, ctx: &Context, _frame: &mut epi::Frame) {
|
fn update(&mut self, ctx: &Context, _frame: &mut eframe::Frame) {
|
||||||
// start timer
|
// start timer
|
||||||
let start = if self.opened.info {
|
let start = if self.opened.info {
|
||||||
Some(instant::Instant::now())
|
Some(instant::Instant::now())
|
||||||
|
|||||||
@ -298,7 +298,7 @@ where
|
|||||||
.map(|x| {
|
.map(|x| {
|
||||||
x.as_ref()
|
x.as_ref()
|
||||||
.map(|x_1| x_1.to_string())
|
.map(|x_1| x_1.to_string())
|
||||||
.unwrap_or_else(|| "None".to_string())
|
.unwrap_or_else(|| "None".to_owned())
|
||||||
})
|
})
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(i, x)| {
|
.map(|(i, x)| {
|
||||||
|
|||||||
@ -10,7 +10,7 @@ pub enum Movement {
|
|||||||
None,
|
None,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Movement {
|
impl const Default for Movement {
|
||||||
fn default() -> Self { Self::None }
|
fn default() -> Self { Self::None }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ pub struct AutoComplete<'a> {
|
|||||||
pub string: String,
|
pub string: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Default for AutoComplete<'a> {
|
impl<'a> const Default for AutoComplete<'a> {
|
||||||
fn default() -> AutoComplete<'a> {
|
fn default() -> AutoComplete<'a> {
|
||||||
AutoComplete {
|
AutoComplete {
|
||||||
i: 0,
|
i: 0,
|
||||||
@ -34,9 +34,14 @@ impl<'a> Default for AutoComplete<'a> {
|
|||||||
impl<'a> AutoComplete<'a> {
|
impl<'a> AutoComplete<'a> {
|
||||||
pub fn update_string(&mut self, string: &str) {
|
pub fn update_string(&mut self, string: &str) {
|
||||||
if self.string != string {
|
if self.string != string {
|
||||||
self.i = 0;
|
// catch empty strings here to avoid call to `generate_hint` and unnecessary logic
|
||||||
self.string = string.to_string();
|
if string.is_empty() {
|
||||||
self.hint = generate_hint(string);
|
*self = Self::default();
|
||||||
|
} else {
|
||||||
|
self.i = 0;
|
||||||
|
self.string = string.to_string();
|
||||||
|
self.hint = generate_hint(string);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user