Fix node-types bugs involving aliases and external tokens
This commit is contained in:
parent
1b5ae380ce
commit
fc19312913
3 changed files with 69 additions and 48 deletions
|
|
@ -1,3 +1,4 @@
|
|||
use super::grammars::VariableType;
|
||||
use smallbitvec::SmallBitVec;
|
||||
use std::collections::HashMap;
|
||||
use std::iter::FromIterator;
|
||||
|
|
@ -139,6 +140,16 @@ impl Rule {
|
|||
}
|
||||
}
|
||||
|
||||
impl Alias {
|
||||
pub fn kind(&self) -> VariableType {
|
||||
if self.is_named {
|
||||
VariableType::Named
|
||||
} else {
|
||||
VariableType::Anonymous
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
impl Rule {
|
||||
pub fn terminal(index: usize) -> Self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue