Custom lexers can now terminate operators

New constraint: custom lexer output is dropped whenever it is used to terminate an operator nested inside another custom lexer, because the recursive call has to return exactly one lexeme
This commit is contained in:
2026-01-25 17:52:18 +01:00
parent b9f1bb74d7
commit c461f82de1
17 changed files with 333 additions and 142 deletions

View File

@@ -35,7 +35,11 @@ impl Atomic for StrAtom {
type Variant = OwnedVariant;
type Data = ();
fn reg_reqs() -> MethodSetBuilder<Self> {
MethodSetBuilder::new().handle::<StringGetValMethod>().handle::<ToStringMethod>()
MethodSetBuilder::new()
.handle::<StringGetValMethod>()
.handle::<ToStringMethod>()
.handle::<GetTagIdMethod>()
.handle::<GetImplMethod>()
}
}
impl StrAtom {
@@ -70,7 +74,7 @@ impl Supports<ToStringMethod> for StrAtom {
}
impl Supports<GetTagIdMethod> for StrAtom {
async fn handle(&self, _: GetTagIdMethod) -> <GetTagIdMethod as Request>::Response {
Sym::literal("std::string::StrAtom").await.to_api()
sym!(std::string::StrAtom).to_api()
}
}
impl Supports<GetImplMethod> for StrAtom {
@@ -126,7 +130,7 @@ impl Supports<ToStringMethod> for IntStrAtom {
}
impl Supports<GetTagIdMethod> for IntStrAtom {
async fn handle(&self, _: GetTagIdMethod) -> <GetTagIdMethod as Request>::Response {
Sym::literal("std::string::IntStrAtom").await.to_api()
sym!(std::string::IntStrAtom).to_api()
}
}
impl Supports<GetImplMethod> for IntStrAtom {