pub enum UnknownSemanticPolicy {
AssumeTrue,
AssumeFalse,
Error,
}Expand description
Policy for semantic predicate coordinates that have no runtime implementation.
ANTLR grammars may embed target-language predicates that the metadata
generator could not translate into a ParserPredicate table entry. When
recognition reaches such a coordinate the runtime cannot know the grammar
author’s intent, so the caller chooses how to proceed.
The default is Self::AssumeTrue, matching the historical behavior of
this runtime. That default is deprecated and will change to Self::Error
in a future minor release; grammars relying on unconditional predicates
should opt in explicitly.
Variants§
AssumeTrue
Treat the predicate as passing, as if it were absent from the grammar.
AssumeFalse
Treat the predicate as failing, removing the guarded alternative.
Error
Fail the parse with AntlrError::Unsupported naming every unknown
coordinate that recognition evaluated.
Trait Implementations§
Source§impl Clone for UnknownSemanticPolicy
impl Clone for UnknownSemanticPolicy
Source§fn clone(&self) -> UnknownSemanticPolicy
fn clone(&self) -> UnknownSemanticPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more