-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Lua backend for scriptable output formats.
- Loading branch information
1 parent
f2dc22a
commit 5b88fe6
Showing
7 changed files
with
341 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- | ||
-- Output in JSON format | ||
-- | ||
local json = require("json") | ||
|
||
print(json.encode(frangipanni)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
-- Beginning of Markdown unnumbered indented bullet list | ||
-- Print each line preceded with indents and an '*' | ||
-- Example: | ||
-- * | ||
-- * x.a | ||
-- * 1 | ||
-- * 2 | ||
-- * Z | ||
-- * 1.2 | ||
-- * A | ||
-- * C | ||
-- * D | ||
-- * 2 | ||
|
||
function indent(n) | ||
for i=1, n do | ||
io.write(" ") | ||
end | ||
end | ||
|
||
function markdown(node) | ||
indent(node.depth) | ||
io.write("* ") | ||
print(node.text) | ||
for k, v in pairs(node.children) do | ||
markdown(v) | ||
end | ||
end | ||
|
||
markdown(frangipanni) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.