pub struct Choice { /* private fields */ }Implementations§
Source§impl Choice
impl Choice
Sourcepub fn is_sticky(&self) -> bool
pub fn is_sticky(&self) -> bool
true for a sticky (+) choice, false for a once-only (*) one.
B0.7 fix (docs/b0-sequencing.md §B0.7, issue #1176): the bullet
token is wrapped in a nested CHOICE_BULLET node
(choice.rs::choice: p.start_node(CHOICE_BULLET); p.bump(); …),
never a direct token of CHOICE itself — support::token only
looks at direct children, so the original B0.5/B0.6 implementation
(support::token(&self.syntax, PLUS)) always returned false. Every
choice line in the corpus was silently lowering as once-only; caught
by B0.7’s choice_point_lowers_to_choice_set_with_sticky_and_once
test, the first real exercise of a sticky (+) choice line.
pub fn label(&self) -> Option<Label>
pub fn guard(&self) -> Option<ChoiceGuard>
pub fn body(&self) -> Option<ChoiceBody>
Source§impl Choice
impl Choice
pub fn start_content(&self) -> Option<ChoiceStartContent>
pub fn bracket_content(&self) -> Option<ChoiceBracketContent>
pub fn inner_content(&self) -> Option<ChoiceInnerContent>
Trait Implementations§
Source§impl AstNode for Choice
impl AstNode for Choice
Source§fn can_cast(kind: SyntaxKind) -> bool
fn can_cast(kind: SyntaxKind) -> bool
Returns
true for a node with a SyntaxKind this type can wrap.Source§fn cast(node: SyntaxNode) -> Option<Self>
fn cast(node: SyntaxNode) -> Option<Self>
Try to cast a generic
SyntaxNode into this typed wrapper.Source§fn syntax(&self) -> &SyntaxNode
fn syntax(&self) -> &SyntaxNode
Access the underlying
SyntaxNode.impl Eq for Choice
impl StructuralPartialEq for Choice
Auto Trait Implementations§
impl !RefUnwindSafe for Choice
impl !Send for Choice
impl !Sync for Choice
impl !UnwindSafe for Choice
impl Freeze for Choice
impl Unpin for Choice
impl UnsafeUnpin for Choice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more