jgm / typst-hs

Haskell library for parsing and evaluating typst
Other
44 stars 5 forks source link

`set` rule followed by `if-else` statement is incorrectly interpreted #23

Closed ntjess closed 11 months ago

ntjess commented 11 months ago
#let fn() = {
  set text(fill: red)
  if true [
    test
  ] else [
    test2
  ]
}

#fn()

Produces the pandoc error:

unexpected end of input
expecting end of input
Identifier "else" not found

According to typst, this is a set rule followed by an independent if-statement. I suppose this means set-if code must have the if and set keywords on the same line to cause a conditional set.