tokay-lang / tokay

Tokay is a programming language designed for ad-hoc parsing, inspired by awk.
https://tokay.dev
MIT License
236 stars 7 forks source link

bug: Use of generic within implicit parselet fails to compile #130

Open phorward opened 6 months ago

phorward commented 6 months ago

This little program

Test : @<T: 'x'> {
    Pos<(T | 'X')>
}

Test

fails to compile:

thread 'main' panicked at src/compiler/iml/imlvalue.rs:355:52:
IndexMap: key not found
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The problem is that (T | 'X') is made into an implicit parselet, which references generic T, but T is not a generic of that implicit parselet. Unfortuntately, this issue is a conceptual problem with the current compiler. It cannot be bypassed right now.

phorward commented 6 months ago

The problem can be seen as part of #128