See long block comment in codegen.rs. In brief, I think we actually want to compile to a trie with priority-intervals, a sort of hybrid of a priority tree and a trie representing decisions keyed on match-ops (PatternInsts). The reasons are: 1. The lexicographic ordering that is fundamental to the FSM-building in the Peepmatic view of the problem is sort of fundamentally limited w.r.t. our notion of rule priorities. See the example in the block comment. 2. While the FSM is nice for interpreter-based execution, when compiling to a language with structured control flow, what we really want is a tree; otherwise, if we want to form DAGs to share substructure, we need something like a "diamond-recovery" algorithm that finds common suffixes of *input match-op sequences*, and then we need to incorporate something like phi-nodes in order to allow captures from either side of the diamond to be used. 3. One of the main advantages of the automaton/transducer approach, namely sharing suffixes of the *output* sequence (emitting partial output at each state transition), is unfortunately not applicable if we allow the overall function to be partial. Otherwise, there is always the possibility that we fail at the last match op, so we cannot allow any external constructors to be called until we reach the final state anyway. 4. Pragmatically, I found I was having to significantly edit the peepmatic_automata implementation to adapt to this use-case (compilation to Rust), and it seemed more practical to design the data structure we want than to try to shoehorn the existing thing into the new problem. WIP, hopefully working soon.
200 lines
5.0 KiB
TOML
200 lines
5.0 KiB
TOML
# This file is automatically @generated by Cargo.
|
|
# It is not intended for manual editing.
|
|
version = 3
|
|
|
|
[[package]]
|
|
name = "aho-corasick"
|
|
version = "0.7.18"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
|
|
dependencies = [
|
|
"memchr",
|
|
]
|
|
|
|
[[package]]
|
|
name = "atty"
|
|
version = "0.2.14"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
|
|
dependencies = [
|
|
"hermit-abi",
|
|
"libc",
|
|
"winapi",
|
|
]
|
|
|
|
[[package]]
|
|
name = "cfg-if"
|
|
version = "1.0.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|
|
|
[[package]]
|
|
name = "env_logger"
|
|
version = "0.8.4"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3"
|
|
dependencies = [
|
|
"atty",
|
|
"humantime",
|
|
"log",
|
|
"regex",
|
|
"termcolor",
|
|
]
|
|
|
|
[[package]]
|
|
name = "hermit-abi"
|
|
version = "0.1.19"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
|
|
dependencies = [
|
|
"libc",
|
|
]
|
|
|
|
[[package]]
|
|
name = "humantime"
|
|
version = "2.1.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
|
|
|
[[package]]
|
|
name = "isle"
|
|
version = "0.1.0"
|
|
dependencies = [
|
|
"env_logger",
|
|
"log",
|
|
"thiserror",
|
|
]
|
|
|
|
[[package]]
|
|
name = "libc"
|
|
version = "0.2.97"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6"
|
|
|
|
[[package]]
|
|
name = "log"
|
|
version = "0.4.14"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
|
|
dependencies = [
|
|
"cfg-if",
|
|
]
|
|
|
|
[[package]]
|
|
name = "memchr"
|
|
version = "2.4.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc"
|
|
|
|
[[package]]
|
|
name = "proc-macro2"
|
|
version = "1.0.28"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612"
|
|
dependencies = [
|
|
"unicode-xid",
|
|
]
|
|
|
|
[[package]]
|
|
name = "quote"
|
|
version = "1.0.9"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
|
|
dependencies = [
|
|
"proc-macro2",
|
|
]
|
|
|
|
[[package]]
|
|
name = "regex"
|
|
version = "1.5.4"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
|
|
dependencies = [
|
|
"aho-corasick",
|
|
"memchr",
|
|
"regex-syntax",
|
|
]
|
|
|
|
[[package]]
|
|
name = "regex-syntax"
|
|
version = "0.6.25"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
|
|
|
|
[[package]]
|
|
name = "syn"
|
|
version = "1.0.75"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "b7f58f7e8eaa0009c5fec437aabf511bd9933e4b2d7407bd05273c01a8906ea7"
|
|
dependencies = [
|
|
"proc-macro2",
|
|
"quote",
|
|
"unicode-xid",
|
|
]
|
|
|
|
[[package]]
|
|
name = "termcolor"
|
|
version = "1.1.2"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"
|
|
dependencies = [
|
|
"winapi-util",
|
|
]
|
|
|
|
[[package]]
|
|
name = "thiserror"
|
|
version = "1.0.26"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2"
|
|
dependencies = [
|
|
"thiserror-impl",
|
|
]
|
|
|
|
[[package]]
|
|
name = "thiserror-impl"
|
|
version = "1.0.26"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745"
|
|
dependencies = [
|
|
"proc-macro2",
|
|
"quote",
|
|
"syn",
|
|
]
|
|
|
|
[[package]]
|
|
name = "unicode-xid"
|
|
version = "0.2.2"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
|
|
|
[[package]]
|
|
name = "winapi"
|
|
version = "0.3.9"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
|
dependencies = [
|
|
"winapi-i686-pc-windows-gnu",
|
|
"winapi-x86_64-pc-windows-gnu",
|
|
]
|
|
|
|
[[package]]
|
|
name = "winapi-i686-pc-windows-gnu"
|
|
version = "0.4.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
|
|
|
[[package]]
|
|
name = "winapi-util"
|
|
version = "0.1.5"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
|
|
dependencies = [
|
|
"winapi",
|
|
]
|
|
|
|
[[package]]
|
|
name = "winapi-x86_64-pc-windows-gnu"
|
|
version = "0.4.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|