Packages
Packages copied to clipboard
[D] newline after constructor name before open parentheses produces unexpected results
What happened?
i like to style my D code so that the open parentheses after a functionname goes on a separate line, which works in most cases:
however, as shown here, this doesnt work as expected in class constructors:
im using Sublime Text 4143
A this
token on its own doesn't denote a constructor. The pattern the syntax definition uses (simplified test\s*\(
) however matches only if all required tokens are on the same line, because ST doesn't include the linefeed into \s
and does lexing line-per-line only. That's what is called line-blindness.
A workaround may be to use ST's branching feature, but this would theoretically need to be implemented for more such situations and adds a lot of complexity to the syntax definition.