local syntax highlight bug

Hi,

I’ve just noticed that the ‘local’ keyword doesn’t get highlighted for me in Corona Editor (0.8.9 in ST3), unlike the standard Lua highlighting which works fine.

So far I’ve only noticed it occur with local functions; in the following example the word local will not be correctly highlighted as a language keyword

[lua]

local function a()

end

[/lua]

However for variables, such the below, it works fine

[lua]

local m={} 

[/lua]

I noticed the following error in the console, not sure if that’s got anything to do with it!

sre\_constants.error: unbalanced parenthesis Traceback (most recent call last):   File "/Applications/Sublime Text.app/Contents/MacOS/sublime\_plugin.py", line 358, in on\_query\_completions     res = callback.on\_query\_completions(v, prefix, locations)   File "completions in /Users/tap32/Library/Application Support/Sublime Text 3/Installed Packages/Corona Editor.sublime-package", line 204, in on\_query\_completions   File "completions in /Users/tap32/Library/Application Support/Sublime Text 3/Installed Packages/Corona Editor.sublime-package", line 118, in find\_completions   File "completions in /Users/tap32/Library/Application Support/Sublime Text 3/Installed Packages/Corona Editor.sublime-package", line 79, in setupFuzzyMatch   File "completions in /Users/tap32/Library/Application Support/Sublime Text 3/Installed Packages/Corona Editor.sublime-package", line 40, in setPattern   File "X/re.py", line 214, in compile   File "X/functools.py", line 258, in wrapper   File "X/re.py", line 274, in \_compile   File "X/sre\_compile.py", line 493, in compile   File "X/sre\_parse.py", line 729, in parse sre\_constants.error: unbalanced parenthesis

Good catch!

You’ll note that the Corona syntax coloring works for the alternate function definition syntax while the standard Lua one does not.  More importantly, the change allows both kinds of function to show up in the “Function Navigator…” list:

local myFunc = function(param) end 

In the process of fixing that I borked highlighting of “local” on some other things.  I’ll fix it.

And thanks for the error report, that’s definitely not right and will need investigation.

Ah, I hand’t noticed that, that’s always been one of my bugbears with the Lua syntax highlighting in Corona! Neat to have that fixed, I’d just lamely accepted it.

That said though, I just tried it out and while the function name is coloured which is great, the key word function isn’t highlighted, which I assume wasn’t intended.  

Good catch!

You’ll note that the Corona syntax coloring works for the alternate function definition syntax while the standard Lua one does not.  More importantly, the change allows both kinds of function to show up in the “Function Navigator…” list:

local myFunc = function(param) end 

In the process of fixing that I borked highlighting of “local” on some other things.  I’ll fix it.

And thanks for the error report, that’s definitely not right and will need investigation.

Ah, I hand’t noticed that, that’s always been one of my bugbears with the Lua syntax highlighting in Corona! Neat to have that fixed, I’d just lamely accepted it.

That said though, I just tried it out and while the function name is coloured which is great, the key word function isn’t highlighted, which I assume wasn’t intended.