||2 years ago|
|LICENSE.txt||3 years ago|
|README.md||3 years ago|
|autotest.sh||3 years ago|
|compiler.lua||2 years ago|
|cratera.lua||2 years ago|
|dirtycompiler.lua||2 years ago|
|dirtycratera.lua||2 years ago|
|luatokens.lua||2 years ago|
|parser.lua||2 years ago|
|printtokens.lua||3 years ago|
|testc.lua||2 years ago|
|testp.lua||3 years ago|
|tests.cratera||2 years ago|
The Cratera Programming Language (and support components)
This repo contains the Cratera to Lua compiler, as well as support components for the Cratera to Lua compiler, namely a pure-Lua Lua tokenizer and a table-based parser thing.
Cratera is a language very similar to Lua, and as such most of the Lua manual applies to it. Additionally, it supports the following syntax sugar, called "traits":
which is equivalent to:
Why not use LPeg?
The use of a custom parsing library boils down to two reasons:
- LPeg can't stream or produce partial outputs. This just makes it difficult to use for making a compiler.
- LPeg can't process tables. It's still possible to use LPeg to parse table-based structures, but one must serialize them beforehand, which is... far from ideal, to say the least.