Closed belchior closed 7 years ago
Yes I'm aware of this issue but it is difficult to fix without making a regex impossibly difficult. Currently the regex that parses lines of this type is
\s*+(\basync\b)?\s*+(?=(<(?:(?>[^<>]+)|\g<-1>)*>)?\s*+(\((?:(?>[^()]+)|\g<-1>)*\))\s*+(((?::(?:(\s*+(&|\|)?(\s*+((?:[$_\p{L}\p{Nl}]|\\u\h{4}|\\u{\h+})(?:[$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Nl}\p{Pc}]|\\u\h{4}|\\u{\h+})*+)(<(?:(?>[^<>]+)|\g<-1>)*>)?|\s*+({(?:(?>[^{}]+)|\g<-1>)*\})|\s*+(\[(?:(?>[^\[\]]+)|\g<-1>)*\])|\s*+(\s*(["']).*?\k<-1>(?<!\\.))|\s*[x0-9A-Fa-f]+))|(?:\s*+/\*.*?\*/))*+)*)|(?:/\*.*?\*/))\s*=>)
in particular a bit of the above is (\((?:(?>[^()]+)|\g<-1>)*\)
which parses any balanced brackets that might appear prior to an arrow. I realised that any unbalanced parens inside a string might upset this but as the only purpose of the above if to change the scopename of the variable to indicate it holds a function it doesn't seem too worthwhile changing it. The whole regex is quite complex because of the various syntax items that flow might introduce.
Note to self (\((?>[^()"']|("(\\.|[^"])*+")++|('(\\.|[^'])*+')++|\g<-5>)*+\))
package version: language-babel 2.75.1