tree-sitters/javascript/test/tags/functions.js
2023-12-21 14:00:00 +01:00

23 lines
426 B
JavaScript

function foo() {
// ^ definition.function
}
foo()
// <- reference.call
{ source: $ => repeat($._expression) }
// ^ definition.function
// ^ reference.call
let plus1 = x => x + 1
// ^ definition.function
let plus2 = function(x) { return x + 2 }
// ^ definition.function
function *gen() { }
// ^ definition.function
async function* foo() { yield 1; }
// ^ definition.function