Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix TerminalNode getter #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix TerminalNode getter
newca12 committed Aug 27, 2022
commit 368db002392a569763cc292778b833e99ba47b52
5 changes: 3 additions & 2 deletions templates/Rust.stg
Original file line number Diff line number Diff line change
@@ -962,8 +962,9 @@ fn <t.name>(&self) -> Option\<Rc\<TerminalNode\<'input,<parser.name>ContextType>
ContextTokenListGetterDecl(t) ::=<<
/// Retrieves all `TerminalNode`s corresponding to token <t.name> in current rule
fn <t.name>_all(&self) -> Vec\<Rc\<TerminalNode\<'input,<parser.name>ContextType>\>> where Self:Sized{
self.children_of_type()
}>>
self.get_tokens(<t.name>)
}
>>
ContextTokenListIndexedGetterDecl(t) ::= <<
/// Retrieves 'i's TerminalNode corresponding to token <t.name>, starting from 0.
/// Returns `None` if number of children corresponding to token <t.name> is less or equal than `i`.