window.executeConcreteSyntaxQuery = function()

in playground/tree-sitter/concrete-syntax.js [486:510]


window.executeConcreteSyntaxQuery = function(pattern, node, sourceCode) {
    if (!window.ConcreteSyntax) {
        debugError('Concrete syntax WASM not initialized');
        return [];
    }

    try {
        const wrappedNode = new TreeSitterNodeWrapper(node);
        const sourceBytes = new TextEncoder().encode(sourceCode);
        
        const matches = window.ConcreteSyntax.getAllMatches(
            pattern, 
            wrappedNode, 
            sourceBytes, 
            true, // recursive
            null  // replace_node
        );
        
        debugLog('Concrete syntax matches:', matches);
        return matches;
    } catch (error) {
        debugError('Concrete syntax matching error:', error);
        return [];
    }
};