Search


Search something to see results

parseDeclarations

Parse a string as an array of declaration nodes. The nodes are allocated in the given arena, or in a new arena when none is provided

Parameters

  • declaration: string
  • Optionalarena: AstArena

    Example:


    const {arena, nodes} = parseDeclarations('color: red; background: blue');
    console.log(nodes.map((node) => arena.toObject(node)));

Returns { arena: AstArena; nodes: number[] }

  • arena: AstArena

    the arena the nodes are allocated in

  • nodes: number[]

    the declaration and comment nodes