Added documentation for Asma helper script

This commit is contained in:
Andrew Alderwick 2021-05-16 09:39:40 +01:00
parent 4d8b898142
commit 46741bae23
2 changed files with 19 additions and 6 deletions

View File

@ -1,8 +1,3 @@
local band, bor, lshift, rshift
do
local _obj_0 = require('bit')
band, bor, lshift, rshift = _obj_0.band, _obj_0.bor, _obj_0.lshift, _obj_0.rshift
end
local spairs
spairs = function(t)
local keys

View File

@ -1,4 +1,22 @@
import band, bor, lshift, rshift from require 'bit'
--
-- Asma tree helper script
--
-- This script updates the trees at the end of projects/software/asma.usm when
-- Uxn's opcode set changes or new runes (first character of tokens) are
-- created, so that new changes in the C assembler can be incorporated rapidly
-- into asma.
--
-- To run, you need Lua or LuaJIT, and just run etc/asma.lua from the top
-- directory of Uxn's git repository:
--
-- lua etc/asma.lua
--
-- This file is written in MoonScript, which is a language that compiles to
-- Lua, the same way as e.g. CoffeeScript compiles to JavaScript. Since
-- installing MoonScript has more dependencies than Lua, the compiled
-- etc/asma.lua is kept in Uxn's repository and will be kept updated as this
-- file changes.
--
spairs = (t) ->
keys = [ k for k in pairs t ]