diff --git a/src/new-parser.typ b/src/new-parser.typ index 54cddf5..0ff37d8 100644 --- a/src/new-parser.typ +++ b/src/new-parser.typ @@ -367,14 +367,14 @@ param-parser = parameter-parser(param-parser, line.slice(match.end)) } else { // it's a variable or a function alias args = none - finished-definition = true - let p = line.slice(match.end) - let curry = line.slice(match.end).match(curry-matcher) - if curry != none { + if curry != none { // is function alias curry-info = (name: curry.captures.first()) + param-parser.state = "running" param-parser = parameter-parser(param-parser, line.slice(match.end + curry.end)) // param-parser.curry = (name: curry.captures.first(), rest: state.unfinished-param.slice(processed-chars + curry.end)) + } else { // is variable + finished-definition = true } } } diff --git a/tests/new-parser/currying.typ b/tests/new-parser/currying.typ index 9949aa2..8feda68 100644 --- a/tests/new-parser/currying.typ +++ b/tests/new-parser/currying.typ @@ -22,6 +22,29 @@ ) +#let src = ``` +/// Doc +#let aey = text.with( + 1pt, weight: 200 +) +```.text + +#assert.eq( + parse-module(src).functions.at(0), + ( + name: "aey", + description: "Doc", + args: (:), + parent: ( + name: "text", + pos: ("1pt",), + named: (weight: "200") + ), + return-types: none + ), +) + + // Parent resolving #let src = ``` @@ -55,3 +78,4 @@ let my-text( ), ) +