Git Product home page Git Product logo

luaextended's Introduction

πŸ‘‹ Hi! I'm Andrew (or, at your option, OndΕ™ej), and I hack on compilers.

Some thoughts to paint a picture:

  • specifications are cool. A machine-readable specification is a specification which itself has a specification.
  • I'm surprised I haven't come across compiler combinators, i.e. a DSL for specifying language semantics that lets you automatically derive a compiler and/or a language server. This would be a fun project to work on.
  • if you care about (high-level) information, you have to stop throwing it away. This is why I love how Unison preserves typed ASTs and why I prefer the purely functional paradigm with static typing to conventional programming.
  • objective complexity should play an important role in design decisions. This is why I consider the UNIX filesystem principle of a unified rooted tree to be cleaner than drive letter assignment and the reason why I dislike languages like C++.

Here's an overview of coding time for the past seven days spent in personal projects and coursework:

TypeScript   4 hrs 52 mins   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   61.67 %
Lua          1 hr 13 mins    β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   15.58 %
YAML         1 hr 10 mins    β–ˆβ–ˆβ–ˆβ–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   14.84 %
Other        28 mins         β–ˆβ–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   06.08 %
Markdown     7 mins          β–’β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   01.49 %

luaextended's People

Contributors

internetunexplorer avatar viluon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

luaextended's Issues

Issue with new function scope

The new function scope merged from #9 seems to work great for functions, however my custom syntax pack no longer works as a result of the main scope not being used.

If a function definition precedes my class declaration, my syntax theme fails to pick it up - this is not the case with traditional Lua (hence I believe it is a LuaExtended issue, and not something I am doing incorrectly).

This is my syntax context:

  main:
    - match: "\\b(class|extends|mixin|alias)\\b"
      scope: keyword
      push: class-string-declaration

    - match: "\\b(abstract)\\b\\s+(?=class)\\b"
      scope: keyword

    - match: "\\b(configureConstructor)\\b(?=(\\w+))"
      scope: keyword

    - include: Packages/LuaExtended/LuaExtended.sublime-syntax

This does not work if a function is defined above the class declaration. Replacing 'LuaExtended' with 'Lua', fixes the issue but at the expense of losing the benefits of LuaExtended.

Screenshots:

Doesn't work

Does work

Wrong Indentation with Statements

foo( something, something_else )

Will indent the following line one more tab (because of the else). This also holds for comments!

Function indentation error

The GIF below was taken in a completely blank file, and the same keystrokes were used for both functions, however the result is... inconsistent.

Wrong Regex for error() Strings

The scope responsible for highlighting error strings matches with regular strings in the file if error is defined as a variable:

Indentation Problems

I have used re-indent on previously written lua file it did failed to indent properly elseif blocks and braces at times
So I used solution mentioned in this
it seems issue is in "Indent.tmPreferences" file I fixed it and working fine now.

More Documented Snippets

We already have dfun, but what about drepeat or dfor? Programmers are all too often too lazy to comment their code on their own, this would mildly force them to do so (there's always the option to stick to the original snippets).

Function Definition Highlighting Not Triggered with Newlines


Any newlines in the function definition will, while being correct syntactically, break the highlighting, because the regex is only matched against a single line. This means the function definition rule will have to be rewritten and split to form its own scope.

Is this syntax compatible with lua-language-server?

Hi there πŸ‘‹. The base scope of this syntax is source.luae. The default syntax's base scope is source.lua. What are the differences between the two? Perhaps more to the point, is this syntax compatible with lua-language-server? https://github.com/sumneko/lua-language-server

I'm maintaining a helper package for that server here: https://github.com/sublimelsp/LSP-lua. It only accounts for the default syntax. If this package is indeed compatible with this language server:

  • Should the syntax's base scope in this package be renamed to source.lua?
  • Or should LSP-lua account for an additional base scope source.luae?

Concatenated error highlighting

If the string inside of the error call is broken up via concatenation, the highlighting does not carry through:

Also, if the error call doesn't have parentheses around the string, it is not colored at all:

Code Conversion Snippets

Sublime Text 3 snippets have the option to access the $SELECTION variable, making them suitable for transforming selected text. There are cases when you would like to convert a for loop to a while loop, for example. Would it be too hard to implement snippets for that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.