From 76cb9c2a39d477a64824a985ade40507e3bbade1 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Fri, 13 Feb 2026 21:34:48 -0800 Subject: feat(vanilla): add testing infrastructure and tests (NK-wjnczv) --- .../css-tree/lib/syntax/node/Function.js | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 vanilla/node_modules/css-tree/lib/syntax/node/Function.js (limited to 'vanilla/node_modules/css-tree/lib/syntax/node/Function.js') diff --git a/vanilla/node_modules/css-tree/lib/syntax/node/Function.js b/vanilla/node_modules/css-tree/lib/syntax/node/Function.js new file mode 100644 index 0000000..1fdc414 --- /dev/null +++ b/vanilla/node_modules/css-tree/lib/syntax/node/Function.js @@ -0,0 +1,41 @@ +import { + Function as FunctionToken, + RightParenthesis +} from '../../tokenizer/index.js'; + + +export const name = 'Function'; +export const walkContext = 'function'; +export const structure = { + name: String, + children: [[]] +}; + +// ) +export function parse(readSequence, recognizer) { + const start = this.tokenStart; + const name = this.consumeFunctionName(); + const nameLowerCase = name.toLowerCase(); + let children; + + children = recognizer.hasOwnProperty(nameLowerCase) + ? recognizer[nameLowerCase].call(this, recognizer) + : readSequence.call(this, recognizer); + + if (!this.eof) { + this.eat(RightParenthesis); + } + + return { + type: 'Function', + loc: this.getLocation(start, this.tokenStart), + name, + children + }; +} + +export function generate(node) { + this.token(FunctionToken, node.name + '('); + this.children(node); + this.token(RightParenthesis, ')'); +} -- cgit v1.2.3