traverseASTNode

API / publicodes / traverseASTNode

function traverseASTNode(fn, node): ASTNode<
  | "rule"
  | "reference"
  | "arrondi"
  | "barème"
  | "durée"
  | "grille"
  | "est non applicable"
  | "est non défini"
  | "inversion"
  | "operation"
  | "une possibilité"
  | "contexte"
  | "simplifier unité"
  | "résoudre référence circulaire"
  | "taux progressif"
  | "unité"
  | "variations"
  | "condition"
  | "constant"
  | "replacementRule"
  | "variable manquante"
| "texte">

Apply a transform function on children. Not recursive.

Parameters

ParameterType
fnASTTransformer
nodeASTNode< | "rule" | "reference" | "arrondi" | "barème" | "durée" | "grille" | "est non applicable" | "est non défini" | "inversion" | "operation" | "une possibilité" | "contexte" | "simplifier unité" | "résoudre référence circulaire" | "taux progressif" | "unité" | "variations" | "condition" | "constant" | "replacementRule" | "variable manquante" | "texte">

Returns

ASTNode< | "rule" | "reference" | "arrondi" | "barème" | "durée" | "grille" | "est non applicable" | "est non défini" | "inversion" | "operation" | "une possibilité" | "contexte" | "simplifier unité" | "résoudre référence circulaire" | "taux progressif" | "unité" | "variations" | "condition" | "constant" | "replacementRule" | "variable manquante" | "texte">

Defined in

packages/core/src/AST/index.ts:132