forked from Orchid/orchid
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user