lunarlang / lunar Goto Github PK
View Code? Open in Web Editor NEWLunar was a superset programming language of Lua 5.1 with optional static typing, inspired by TypeScript and Ruby.
Home Page: https://discord.gg/CHFC3pS
License: Apache License 2.0
Lunar was a superset programming language of Lua 5.1 with optional static typing, inspired by TypeScript and Ruby.
Home Page: https://discord.gg/CHFC3pS
License: Apache License 2.0
from "lunarc.ast" import * as AST
does not work, however from "lunarc.ast.init" import * as AST
does.
TODO: Not a lot of things have been properly tracked before this, so it is difficult to catch everything that has been completed thus far. Additionally, credits have not been properly given as I'm unsure who is responsible for what. If you are responsible for something that is not credited, please let me know immediately. Also, if something is improperly checked (or not), please let me know about that too.
New Issue
page with the error message written out already.lib
which includes an older version of Lunar for compiling.This rewrite is geared towards having a proper command line interface using argparse.
-p --project
A path leading to a directory containing a .lunarconfig
file.-o --out-dir
The name of the output directory. This will be created if it does not exist.--install
Installs lunarc
to the system, where it can then be used from anywhere.--uninstall
Uninstalls lunarc
from the system.-w --watch
Starts watching the project for any saved changes, and triggers compilation for that file.-v --version
Displays the current version of lunarc
(function() print(1) end)();
(function() print(2) end)()
Transpiles to
(function() print(1) end)()
(function() print(2) end)()
In this instance, the semicolon would need to be preserved, or else the transpiled code will attempt to call the the result of print(1) with the argument (function() print(2) end)
Exporting functions or classes just appends the name to the return table with no value.
export function name() end
function name() end
return {name = name}
function name() end
return {name}
print(x == y and y == z and z)
will cause an infinite loop when transpiled
./lib/lunar/compiler/syntax/base_parser.lua:14: attempt to index local 'token' (a nil value)
This does not stop the compiler from successfully going over other files and successfully compiling everything else.
We should throw a syntax error for using return [exprlist]
unless it's in a function inside of the constructor.
So the following should become illegal, because it would abruptly return out of a constructor.
class C
constructor()
return -- illegal return statement
return 123 -- also illegal return statement
end
end
But the following should remain legal, because it doesn't interfere with the constructor.
class C
constructor()
local function something()
return 1
end
self.something = something()
end
end
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.