1
0
Fork 0
mirror of https://github.com/notwa/lips synced 2024-11-14 18:29:03 -08:00

redo internal paths/requires

This commit is contained in:
Connor Olding 2016-04-14 07:33:33 -07:00
parent 3290735c8f
commit 071169df48
9 changed files with 34 additions and 25 deletions

View file

@ -14,8 +14,9 @@ Even this README is incomplete.
Copy the lips directory to somewhere Lua's `package.path` can find it. Copy the lips directory to somewhere Lua's `package.path` can find it.
If you're using it locally, you will need to write something like: If you're using it locally, you will need to write something like:
``` ```
package.path = package.path..";./?/init.lua" package.path = package.path.."?/init.lua"
``` ```
or `require "lips.init"` directly.
You can then use it as such: You can then use it as such:
[example.lua][elua] — [example.asm][easm] [example.lua][elua] — [example.asm][easm]

View file

@ -2,8 +2,9 @@ local floor = math.floor
local format = string.format local format = string.format
local insert = table.insert local insert = table.insert
local data = require "lips.data" local path = string.gsub(..., "[^.]+$", "")
local util = require "lips.util" local data = require(path.."data")
local util = require(path.."util")
local bitrange = util.bitrange local bitrange = util.bitrange

View file

@ -4,8 +4,9 @@ local find = string.find
local format = string.format local format = string.format
local insert = table.insert local insert = table.insert
local data = require "lips.data" local path = string.gsub(..., "[^.]+$", "")
local util = require "lips.util" local data = require(path.."data")
local util = require(path.."util")
local simple_escapes = { local simple_escapes = {
['0'] = 0x00, ['0'] = 0x00,

View file

@ -1,9 +1,10 @@
local format = string.format local format = string.format
local insert = table.insert local insert = table.insert
local data = require "lips.data" local path = string.gsub(..., "[^.]+$", "")
local util = require "lips.util" local data = require(path.."data")
local Token = require "lips.Token" local util = require(path.."util")
local Token = require(path.."Token")
local arg_types = { local arg_types = {
NUM = true, NUM = true,

View file

@ -1,13 +1,14 @@
local insert = table.insert local insert = table.insert
local data = require "lips.data" local path = string.gsub(..., "[^.]+$", "")
local util = require "lips.util" local data = require(path.."data")
local overrides = require "lips.overrides" local util = require(path.."util")
local Token = require "lips.Token" local overrides = require(path.."overrides")
local Lexer = require "lips.Lexer" local Token = require(path.."Token")
local Dumper = require "lips.Dumper" local Lexer = require(path.."Lexer")
local Muncher = require "lips.Muncher" local Dumper = require(path.."Dumper")
local Preproc = require "lips.Preproc" local Muncher = require(path.."Muncher")
local Preproc = require(path.."Preproc")
local Parser = util.Class(Muncher) local Parser = util.Class(Muncher)
function Parser:init(writer, fn, options) function Parser:init(writer, fn, options)

View file

@ -1,9 +1,10 @@
local insert = table.insert local insert = table.insert
local data = require "lips.data" local path = string.gsub(..., "[^.]+$", "")
local util = require "lips.util" local data = require(path.."data")
local Muncher = require "lips.Muncher" local util = require(path.."util")
local Token = require "lips.Token" local Muncher = require(path.."Muncher")
local Token = require(path.."Token")
local abs = math.abs local abs = math.abs

View file

@ -1,4 +1,5 @@
local util = require "lips.util" local path = string.gsub(..., "[^.]+$", "")
local util = require(path.."util")
local Token = util.Class() local Token = util.Class()
function Token:init(...) function Token:init(...)

View file

@ -10,8 +10,9 @@ local lips = {
]], ]],
} }
local util = require "lips.util" local path = string.gsub(..., "%.init$", "").."."
local Parser = require "lips.Parser" local util = require(path.."util")
local Parser = require(path.."Parser")
function lips.word_writer() function lips.word_writer()
local buff = {} local buff = {}

View file

@ -1,7 +1,8 @@
local insert = table.insert local insert = table.insert
local data = require "lips.data" local path = string.gsub(..., "[^.]+$", "")
local util = require "lips.util" local data = require(path.."data")
local util = require(path.."util")
local instructions = data.instructions local instructions = data.instructions