From 355429f69132083b2a8409ad1985d9d2854443cb Mon Sep 17 00:00:00 2001 From: youzichuan Date: Wed, 13 Aug 2025 15:51:32 +0800 Subject: [PATCH] chore: fix some minor issues in comments Signed-off-by: youzichuan --- internal/ast/visitor.go | 2 +- internal/format/util.go | 2 +- internal/nodebuilder/types.go | 2 +- internal/transformers/declarations/transform.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/ast/visitor.go b/internal/ast/visitor.go index cc3fd76f20..b0b7db54d9 100644 --- a/internal/ast/visitor.go +++ b/internal/ast/visitor.go @@ -19,7 +19,7 @@ type NodeVisitorHooks struct { VisitNodes func(nodes *NodeList, v *NodeVisitor) *NodeList // Overrides visiting a NodeList. Only invoked by the VisitEachChild method on a given Node subtype. VisitModifiers func(nodes *ModifierList, v *NodeVisitor) *ModifierList // Overrides visiting a ModifierList. Only invoked by the VisitEachChild method on a given Node subtype. VisitEmbeddedStatement func(node *Statement, v *NodeVisitor) *Statement // Overrides visiting a Node when it is the embedded statement body of an iteration statement, `if` statement, or `with` statement. Only invoked by the VisitEachChild method on a given Node subtype. - VisitIterationBody func(node *Statement, v *NodeVisitor) *Statement // Overrides visiting a Node when it is the embedded statement body body of an iteration statement. Only invoked by the VisitEachChild method on a given Node subtype. + VisitIterationBody func(node *Statement, v *NodeVisitor) *Statement // Overrides visiting a Node when it is the embedded statement body of an iteration statement. Only invoked by the VisitEachChild method on a given Node subtype. VisitParameters func(nodes *ParameterList, v *NodeVisitor) *ParameterList // Overrides visiting a ParameterList. Only invoked by the VisitEachChild method on a given Node subtype. VisitFunctionBody func(node *BlockOrExpression, v *NodeVisitor) *BlockOrExpression // Overrides visiting a function body. Only invoked by the VisitEachChild method on a given Node subtype. VisitTopLevelStatements func(nodes *StatementList, v *NodeVisitor) *StatementList // Overrides visiting a variable environment. Only invoked by the VisitEachChild method on a given Node subtype. diff --git a/internal/format/util.go b/internal/format/util.go index a7b08f2899..4db94b1709 100644 --- a/internal/format/util.go +++ b/internal/format/util.go @@ -83,7 +83,7 @@ func getLineStartPositionForPosition(position int, sourceFile *ast.SourceFile) i /** * Tests whether `child` is a grammar error on `parent`. - * In strada, this also checked node arrays, but it is never acually called with one in practice. + * In strada, this also checked node arrays, but it is never actually called with one in practice. */ func isGrammarError(parent *ast.Node, child *ast.Node) bool { if ast.IsTypeParameterDeclaration(parent) { diff --git a/internal/nodebuilder/types.go b/internal/nodebuilder/types.go index bc492ce855..77de1f385d 100644 --- a/internal/nodebuilder/types.go +++ b/internal/nodebuilder/types.go @@ -1,4 +1,4 @@ -// Exports interfaces and types defining the node builder - concrete implmentations are on top of the checker, but these types and interfaces are used by the emit resolver in the printer +// Exports interfaces and types defining the node builder - concrete implementations are on top of the checker, but these types and interfaces are used by the emit resolver in the printer package nodebuilder import ( diff --git a/internal/transformers/declarations/transform.go b/internal/transformers/declarations/transform.go index 2f81b28a72..ce7645ff54 100644 --- a/internal/transformers/declarations/transform.go +++ b/internal/transformers/declarations/transform.go @@ -931,7 +931,7 @@ func (tx *DeclarationTransformer) visitDeclarationStatements(input *ast.Node) *a statement := tx.Factory().NewVariableStatement(modList, tx.Factory().NewVariableDeclarationList(ast.NodeFlagsConst, tx.Factory().NewNodeList([]*ast.Node{varDecl}))) assignment := tx.Factory().UpdateExportAssignment(input.AsExportAssignment(), input.Modifiers(), input.Type(), newId) - // Remove coments from the export declaration and copy them onto the synthetic _default declaration + // Remove comments from the export declaration and copy them onto the synthetic _default declaration tx.preserveJsDoc(statement, input) tx.removeAllComments(assignment) return tx.Factory().NewSyntaxList([]*ast.Node{statement, assignment})