Traqula
    Preparing search index...

    Class AstCoreFactory

    Implements

    Index

    Constructors

    Properties

    tracksSourceLocation: boolean

    Whether this AstFactory will track source location. Default: true. In case source location is not tracked, each generated node using this factory will be SourceLocationNodeAutoGenerate

    Methods

    • Returns a copy of the argument that is not materialized

      Type Parameters

      Parameters

      • arg: T

      Returns T

    • In case the provided Node is not yet materialized, force it to be autoGenerated.

      Type Parameters

      Parameters

      • arg: T

      Returns T

    • A simple filter that will only execute the provided callback when the provided SourceLocation expects the generator steps to autoGenerate.

      Parameters

      Returns void

    • Given a value and some mapper from objects to objects, map all containing items in case it is an array, otherwise map the provided value in case it is an object, finally, do nothing.

      Parameters

      • value: unknown

        the value to map

      • mapper: (some: object) => any

        the function mapping an object to another object.

      Returns any

    • Create a SourceLocation that indicates a given range of the current range should be replaced by a new source.

      Parameters

      • newSource: string
      • subLoc: SourceLocation
      • start: number
      • end: number
      • startOnNew: number = 0
      • endOnNew: number = newSource.length

      Returns SourceLocation

    • Create a SourceLocation that indicates this node, representing a range of characters in the original string, should be replaced by some string during generation.

      Parameters

      • newSource: string
      • start: number
      • end: number

      Returns SourceLocation