InterpolationVisitor class

Given an interpolation, find all of its chunks, validate that they are only simple variable substitutions or else Intl.plural/gender calls, and keep track of the pieces of text so that other parts of the program can deal with the simple string sections and the generated parts separately. Note that this is a SimpleAstVisitor, so it only traverses one level of children rather than automatically recursing. If we find a plural or gender, which requires recursion, we do it with a separate special-purpose visitor.

Inheritance
  • Object
  • SimpleAstVisitor
  • InterpolationVisitor

Constructors

InterpolationVisitor(Message message, MessageExtraction extraction)

Properties

arguments List
no setter
extractedMessage String
no setter
extraction MessageExtraction
The message extraction in which we are running.
final
hashCode int
The hash code for this object.
no setterinherited
message → Message
final
pieces List
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

handleSimpleInterpolation(InterpolationExpression node) → void
lookForPluralOrGender(InterpolationExpression node) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
visitAdjacentStrings(AdjacentStrings node) → void
override
visitAnnotation(Annotation node) → dynamic
inherited
visitArgumentList(ArgumentList node) → dynamic
inherited
visitAsExpression(AsExpression node) → dynamic
inherited
visitAssertInitializer(AssertInitializer node) → dynamic
inherited
visitAssertStatement(AssertStatement node) → dynamic
inherited
visitAssignedVariablePattern(AssignedVariablePattern node) → dynamic
inherited
visitAssignmentExpression(AssignmentExpression node) → dynamic
inherited
visitAugmentationImportDirective(AugmentationImportDirective node) → dynamic
inherited
visitAugmentedExpression(AugmentedExpression node) → dynamic
inherited
visitAugmentedInvocation(AugmentedInvocation node) → dynamic
inherited
visitAwaitExpression(AwaitExpression node) → dynamic
inherited
visitBinaryExpression(BinaryExpression node) → dynamic
inherited
visitBlock(Block node) → dynamic
inherited
visitBlockFunctionBody(BlockFunctionBody node) → dynamic
inherited
visitBooleanLiteral(BooleanLiteral node) → dynamic
inherited
visitBreakStatement(BreakStatement node) → dynamic
inherited
visitCascadeExpression(CascadeExpression node) → dynamic
inherited
visitCaseClause(CaseClause node) → dynamic
inherited
visitCastPattern(CastPattern node) → dynamic
inherited
visitCatchClause(CatchClause node) → dynamic
inherited
visitCatchClauseParameter(CatchClauseParameter node) → dynamic
inherited
visitClassDeclaration(ClassDeclaration node) → dynamic
inherited
visitClassTypeAlias(ClassTypeAlias node) → dynamic
inherited
visitComment(Comment node) → dynamic
inherited
visitCommentReference(CommentReference node) → dynamic
inherited
visitCompilationUnit(CompilationUnit node) → dynamic
inherited
visitConditionalExpression(ConditionalExpression node) → dynamic
inherited
visitConfiguration(Configuration node) → dynamic
inherited
visitConstantPattern(ConstantPattern node) → dynamic
inherited
visitConstructorDeclaration(ConstructorDeclaration node) → dynamic
inherited
visitConstructorFieldInitializer(ConstructorFieldInitializer node) → dynamic
inherited
visitConstructorName(ConstructorName node) → dynamic
inherited
visitConstructorReference(ConstructorReference node) → dynamic
inherited
visitConstructorSelector(ConstructorSelector node) → dynamic
inherited
visitContinueStatement(ContinueStatement node) → dynamic
inherited
visitDeclaredIdentifier(DeclaredIdentifier node) → dynamic
inherited
visitDeclaredVariablePattern(DeclaredVariablePattern node) → dynamic
inherited
visitDefaultFormalParameter(DefaultFormalParameter node) → dynamic
inherited
visitDoStatement(DoStatement node) → dynamic
inherited
visitDottedName(DottedName node) → dynamic
inherited
visitDoubleLiteral(DoubleLiteral node) → dynamic
inherited
visitEmptyFunctionBody(EmptyFunctionBody node) → dynamic
inherited
visitEmptyStatement(EmptyStatement node) → dynamic
inherited
visitEnumConstantArguments(EnumConstantArguments node) → dynamic
inherited
visitEnumConstantDeclaration(EnumConstantDeclaration node) → dynamic
inherited
visitEnumDeclaration(EnumDeclaration node) → dynamic
inherited
visitExportDirective(ExportDirective node) → dynamic
inherited
visitExpressionFunctionBody(ExpressionFunctionBody node) → dynamic
inherited
visitExpressionStatement(ExpressionStatement node) → dynamic
inherited
visitExtendsClause(ExtendsClause node) → dynamic
inherited
visitExtensionDeclaration(ExtensionDeclaration node) → dynamic
inherited
visitExtensionOnClause(ExtensionOnClause node) → dynamic
inherited
visitExtensionOverride(ExtensionOverride node) → dynamic
inherited
visitExtensionTypeDeclaration(ExtensionTypeDeclaration node) → dynamic
inherited
visitFieldDeclaration(FieldDeclaration node) → dynamic
inherited
visitFieldFormalParameter(FieldFormalParameter node) → dynamic
inherited
visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) → dynamic
inherited
visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) → dynamic
inherited
visitForEachPartsWithPattern(ForEachPartsWithPattern node) → dynamic
inherited
visitForElement(ForElement node) → dynamic
inherited
visitFormalParameterList(FormalParameterList node) → dynamic
inherited
visitForPartsWithDeclarations(ForPartsWithDeclarations node) → dynamic
inherited
visitForPartsWithExpression(ForPartsWithExpression node) → dynamic
inherited
visitForPartsWithPattern(ForPartsWithPattern node) → dynamic
inherited
visitForStatement(ForStatement node) → dynamic
inherited
visitFunctionDeclaration(FunctionDeclaration node) → dynamic
inherited
visitFunctionDeclarationStatement(FunctionDeclarationStatement node) → dynamic
inherited
visitFunctionExpression(FunctionExpression node) → dynamic
inherited
visitFunctionExpressionInvocation(FunctionExpressionInvocation node) → dynamic
inherited
visitFunctionReference(FunctionReference node) → dynamic
inherited
visitFunctionTypeAlias(FunctionTypeAlias node) → dynamic
inherited
visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) → dynamic
inherited
visitGenericFunctionType(GenericFunctionType node) → dynamic
inherited
visitGenericTypeAlias(GenericTypeAlias node) → dynamic
inherited
visitGuardedPattern(GuardedPattern node) → dynamic
inherited
visitHideCombinator(HideCombinator node) → dynamic
inherited
visitIfElement(IfElement node) → dynamic
inherited
visitIfStatement(IfStatement node) → dynamic
inherited
visitImplementsClause(ImplementsClause node) → dynamic
inherited
visitImplicitCallReference(ImplicitCallReference node) → dynamic
inherited
visitImportDirective(ImportDirective node) → dynamic
inherited
visitImportPrefixReference(ImportPrefixReference node) → dynamic
inherited
visitIndexExpression(IndexExpression node) → dynamic
inherited
visitInstanceCreationExpression(InstanceCreationExpression node) → dynamic
inherited
visitIntegerLiteral(IntegerLiteral node) → dynamic
inherited
visitInterpolationExpression(InterpolationExpression node) → void
override
visitInterpolationString(InterpolationString node) → void
override
visitIsExpression(IsExpression node) → dynamic
inherited
visitLabel(Label node) → dynamic
inherited
visitLabeledStatement(LabeledStatement node) → dynamic
inherited
visitLibraryAugmentationDirective(LibraryAugmentationDirective node) → dynamic
inherited
visitLibraryDirective(LibraryDirective node) → dynamic
inherited
visitLibraryIdentifier(LibraryIdentifier node) → dynamic
inherited
visitListLiteral(ListLiteral node) → dynamic
inherited
visitListPattern(ListPattern node) → dynamic
inherited
visitLogicalAndPattern(LogicalAndPattern node) → dynamic
inherited
visitLogicalOrPattern(LogicalOrPattern node) → dynamic
inherited
visitMapLiteralEntry(MapLiteralEntry node) → dynamic
inherited
visitMapPattern(MapPattern node) → dynamic
inherited
visitMapPatternEntry(MapPatternEntry node) → dynamic
inherited
visitMethodDeclaration(MethodDeclaration node) → dynamic
inherited
visitMethodInvocation(MethodInvocation node) → dynamic
inherited
visitMixinDeclaration(MixinDeclaration node) → dynamic
inherited
visitMixinOnClause(MixinOnClause node) → dynamic
inherited
visitNamedExpression(NamedExpression node) → dynamic
inherited
visitNamedType(NamedType node) → dynamic
inherited
visitNativeClause(NativeClause node) → dynamic
inherited
visitNativeFunctionBody(NativeFunctionBody node) → dynamic
inherited
visitNullAssertPattern(NullAssertPattern node) → dynamic
inherited
visitNullCheckPattern(NullCheckPattern node) → dynamic
inherited
visitNullLiteral(NullLiteral node) → dynamic
inherited
visitObjectPattern(ObjectPattern node) → dynamic
inherited
visitOnClause(OnClause node) → dynamic
inherited
visitParenthesizedExpression(ParenthesizedExpression node) → dynamic
inherited
visitParenthesizedPattern(ParenthesizedPattern node) → dynamic
inherited
visitPartDirective(PartDirective node) → dynamic
inherited
visitPartOfDirective(PartOfDirective node) → dynamic
inherited
visitPatternAssignment(PatternAssignment node) → dynamic
inherited
visitPatternField(PatternField node) → dynamic
inherited
visitPatternFieldName(PatternFieldName node) → dynamic
inherited
visitPatternVariableDeclaration(PatternVariableDeclaration node) → dynamic
inherited
visitPatternVariableDeclarationStatement(PatternVariableDeclarationStatement node) → dynamic
inherited
visitPostfixExpression(PostfixExpression node) → dynamic
inherited
visitPrefixedIdentifier(PrefixedIdentifier node) → dynamic
inherited
visitPrefixExpression(PrefixExpression node) → dynamic
inherited
visitPropertyAccess(PropertyAccess node) → dynamic
inherited
visitRecordLiteral(RecordLiteral node) → dynamic
inherited
visitRecordPattern(RecordPattern node) → dynamic
inherited
visitRecordTypeAnnotation(RecordTypeAnnotation node) → dynamic
inherited
visitRecordTypeAnnotationNamedField(RecordTypeAnnotationNamedField node) → dynamic
inherited
visitRecordTypeAnnotationNamedFields(RecordTypeAnnotationNamedFields node) → dynamic
inherited
visitRecordTypeAnnotationPositionalField(RecordTypeAnnotationPositionalField node) → dynamic
inherited
visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) → dynamic
inherited
visitRelationalPattern(RelationalPattern node) → dynamic
inherited
visitRepresentationConstructorName(RepresentationConstructorName node) → dynamic
inherited
visitRepresentationDeclaration(RepresentationDeclaration node) → dynamic
inherited
visitRestPatternElement(RestPatternElement node) → dynamic
inherited
visitRethrowExpression(RethrowExpression node) → dynamic
inherited
visitReturnStatement(ReturnStatement node) → dynamic
inherited
visitScriptTag(ScriptTag node) → dynamic
inherited
visitSetOrMapLiteral(SetOrMapLiteral node) → dynamic
inherited
visitShowCombinator(ShowCombinator node) → dynamic
inherited
visitSimpleFormalParameter(SimpleFormalParameter node) → dynamic
inherited
visitSimpleIdentifier(SimpleIdentifier node) → dynamic
inherited
visitSimpleStringLiteral(SimpleStringLiteral node) → void
override
visitSpreadElement(SpreadElement node) → dynamic
inherited
visitStringInterpolation(StringInterpolation node) → void
override
visitSuperConstructorInvocation(SuperConstructorInvocation node) → dynamic
inherited
visitSuperExpression(SuperExpression node) → dynamic
inherited
visitSuperFormalParameter(SuperFormalParameter node) → dynamic
inherited
visitSwitchCase(SwitchCase node) → dynamic
inherited
visitSwitchDefault(SwitchDefault node) → dynamic
inherited
visitSwitchExpression(SwitchExpression node) → dynamic
inherited
visitSwitchExpressionCase(SwitchExpressionCase node) → dynamic
inherited
visitSwitchPatternCase(SwitchPatternCase node) → dynamic
inherited
visitSwitchStatement(SwitchStatement node) → dynamic
inherited
visitSymbolLiteral(SymbolLiteral node) → dynamic
inherited
visitThisExpression(ThisExpression node) → dynamic
inherited
visitThrowExpression(ThrowExpression node) → dynamic
inherited
visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) → dynamic
inherited
visitTryStatement(TryStatement node) → dynamic
inherited
visitTypeArgumentList(TypeArgumentList node) → dynamic
inherited
visitTypeLiteral(TypeLiteral node) → dynamic
inherited
visitTypeParameter(TypeParameter node) → dynamic
inherited
visitTypeParameterList(TypeParameterList node) → dynamic
inherited
visitVariableDeclaration(VariableDeclaration node) → dynamic
inherited
visitVariableDeclarationList(VariableDeclarationList node) → dynamic
inherited
visitVariableDeclarationStatement(VariableDeclarationStatement node) → dynamic
inherited
visitWhenClause(WhenClause node) → dynamic
inherited
visitWhileStatement(WhileStatement node) → dynamic
inherited
visitWildcardPattern(WildcardPattern node) → dynamic
inherited
visitWithClause(WithClause node) → dynamic
inherited
visitYieldStatement(YieldStatement node) → dynamic
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited