lang: basic module syntax grammar
This commit is contained in:
parent
f6da90a354
commit
946ac879a7
7 changed files with 136 additions and 8 deletions
|
@ -111,7 +111,7 @@ impl Marker {
|
|||
}
|
||||
}
|
||||
|
||||
fn complete_node(mut self, p: &mut Parser, kind: NodeKind) -> CompletedMarker {
|
||||
fn close_node(mut self, p: &mut Parser, kind: NodeKind) -> CompletedMarker {
|
||||
self.bomb.defuse();
|
||||
match &mut p.events[self.pos] {
|
||||
Event::Start { kind: slot, .. } => *slot = kind.clone(),
|
||||
|
@ -127,11 +127,11 @@ impl Marker {
|
|||
}
|
||||
|
||||
pub(crate) fn complete(self, p: &mut Parser<'_, '_>, kind: SyntaxKind) -> CompletedMarker {
|
||||
self.complete_node(p, NodeKind::Syntax(kind))
|
||||
self.close_node(p, NodeKind::Syntax(kind))
|
||||
}
|
||||
|
||||
pub(crate) fn error(self, p: &mut Parser, kind: SyntaxError) -> CompletedMarker {
|
||||
self.complete_node(p, NodeKind::Error(kind))
|
||||
self.close_node(p, NodeKind::Error(kind))
|
||||
}
|
||||
|
||||
pub(crate) fn abandon(mut self, p: &mut Parser<'_, '_>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue