||3 years ago|
|LICENSE.txt||4 years ago|
|README.md||4 years ago|
|autotest.sh||4 years ago|
|compiler.lua||3 years ago|
|cratera.lua||3 years ago|
|dirtycompiler.lua||3 years ago|
|dirtycratera.lua||3 years ago|
|luatokens.lua||3 years ago|
|parser.lua||3 years ago|
|printtokens.lua||4 years ago|
|testc.lua||3 years ago|
|testp.lua||4 years ago|
|tests.cratera||3 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.