question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

improve Lua lexer

See original GitHub issue

teest file added. codetree-class-init.zip

questions for who knows Lua. @Artem3213212 @dinkumoil @davidhealey

  1. file has many “self:mmmm” so maybe hilite word “self”? in which style- keyword (bold black) or std word (purple)?

1b. hilite “self” in all lines?

  self:reset()
  self.filename = filename
  self.lines = {}
  1. file has many “function Doc:mmm()” so maybe move all funcs for Doc: to new code tree node “Doc”?

  2. Lua allows more “:” chars in func name? eg “Doc:nnn:mmm”, “Doc:aa:bb:cc:dd”?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
dinkumoilcommented, May 25, 2020

Yes, unnamed or anonymous functions should be invisible in code tree. In your example nn = function(x) return x end the function is anonymous, so don’t show it.

0reactions
dinkumoilcommented, May 25, 2020

any more notes, pls?

No, everything seems to be fine. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing lexers in Lua - Google Groups
While not written good lua-lexers can use the c-lexers. This is - a good compromise and a smooth transition. I hope that the...
Read more >
LoganDark/lua-lexer: A Lua lexer written in pure Lua. - GitHub
This function only takes one argument, which is the text to lex (a string, obviously). It returns a a list containing every line...
Read more >
Lexer for RBX Lua - Community Resources - DevForum | Roblox
There's this awesome lexer for Lua in the Penlight library. ... to generate sequentially internally) but it's better than multiple loops!
Read more >
What is the best way to reuse the Lua parser? - Stack Overflow
I've used ANTLR on a couple projects with good results. It will generate a C (ANTLR v3) or C++ (ANTLR v2) parser including...
Read more >
Lua Performance Tips
the “optimization” actually improved our code. Once you decide that you really must optimize your Lua code, this text may help you about...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found