diff --git a/.gitignore b/.gitignore index e920e17..c9a2d35 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ out??? *.out tags TAGS -markdown +markdown \ No newline at end of file diff --git a/06/Lexer.lua b/06/Lexer.lua deleted file mode 100644 index b7051c1..0000000 --- a/06/Lexer.lua +++ /dev/null @@ -1,128 +0,0 @@ -Reverse = { - "addrspace", "align", "allowzero", "and", "anyframe", "anytype", "asm", "async", - "await", "break", "callconv", "catch", "comptime", "const", "continue", "defer", - "else", "enum", "errdefer", "error", "export", "extern", "fn", "for", "if", - "inline", "noalias", "noinline", "IDENTIFIER", "nosuspend", "opaque", "or", - "orelse", "packed", "pub", "resume", "return", "linksection", "struct", "suspend", - "switch", "test", "threadlocal", "try", "union", "unreachable", "usingnamespace", - "var", "volatile", "while", "INVALID", ".**", "!", "|", "||", "|=", "=", "==", - "=>", "!=", "(", ")", ";", "%", "%=", "{", "}", "[", "]", ".", ".*", "..", "...", - "^", "^=", "+", "++", "+=", "+%", "+%=", "+|", "+|=", "-", "-=", "-%", "-%=", "-|", - "-|=", "*", "*=", "**", "*%", "*%=", "*|", "*|=", "->", ":", "/", "/=", ",", "&", - "&=", "?", "<", "<=", "<<", "<<=", "<<|", "<<|=", ">", ">=", ">>", ">>=", "~", - "STRING_LITERAL", "CHAR_LITERAL", "EOF", "BUILTIN", "NUMBER_LITERAL", "DOC_COMMENT", - "CONTAINER_DOC_COMMENT", -} - -Tokens = { - ADDRSPACE = 1, ALIGN = 2, - ALLOWZERO = 3, AND = 4, - ANYFRAME = 5, ANYTYPE = 6, - ASM = 7, ASYNC = 8, - AWAIT = 9, BREAK = 10, - CALLCONV = 11, CATCH = 12, - COMPTIME = 13, CONST = 14, - CONTINUE = 15, DEFER = 16, - ELSE = 17, ENUM = 18, - ERRDEFER = 19, ERROR = 20, - EXPORT = 21, EXTERN = 22, - FN = 23, FOR = 24, - IF = 25, INLINE = 26, - NOALIAS = 27, NOINLINE = 28, - IDENTIFIER = 29, NOSUSPEND = 30, - OPAQUE = 31, OR = 32, - ORELSE = 33, PACKED = 34, - PUB = 35, RESUME = 36, - RETURN = 37, LINKSECTION = 38, - STRUCT = 39, SUSPEND = 40, - SWITCH = 41, TEST = 42, - THREADLOCAL = 43, TRY = 44, - UNION = 45, UNREACHABLE = 46, - USINGNAMESPACE = 47, VAR = 48, - VOLATILE = 49, WHILE = 50, - INVALID = 51, INVALID_PERIODASTERISKS = 52, - BANG = 53, PIPE = 54, - PIPE_PIPE = 55, PIPE_EQUAL = 56, - EQUAL = 57, EQUAL_EQUAL = 58, - EQUAL_ANGLE_BRACKET_RIGHT = 59, BANG_EQUAL = 60, - L_PAREN = 61, R_PAREN = 62, - SEMICOLON = 63, PERCENT = 64, - PERCENT_EQUAL = 65, L_BRACE = 66, - R_BRACE = 67, L_BRACKET = 68, - R_BRACKET = 69, PERIOD = 70, - PERIOD_ASTERISK = 71, ELLIPSIS2 = 72, - ELLIPSIS3 = 73, CARET = 74, - CARET_EQUAL = 75, PLUS = 76, - PLUS_PLUS = 77, PLUS_EQUAL = 78, - PLUS_PERCENT = 79, PLUS_PERCENT_EQUAL = 80, - PLUS_PIPE = 81, PLUS_PIPE_EQUAL = 82, - MINUS = 83, MINUS_EQUAL = 84, - MINUS_PERCENT = 85, MINUS_PERCENT_EQUAL = 86, - MINUS_PIPE = 87, MINUS_PIPE_EQUAL = 88, - ASTERISK = 89, ASTERISK_EQUAL = 90, - ASTERISK_ASTERISK = 91, ASTERISK_PERCENT = 92, - ASTERISK_PERCENT_EQUAL = 93, ASTERISK_PIPE = 94, - ASTERISK_PIPE_EQUAL = 95, ARROW = 96, - COLON = 97, SLASH = 98, - SLASH_EQUAL = 99, COMMA = 100, - AMPERSAND = 101, AMPERSAND_EQUAL = 102, - QUESTION_MARK = 103, ANGLE_BRACKET_LEFT = 104, - ANGLE_BRACKET_LEFT_EQUAL = 105, ANGLE_BRACKET_ANGLE_BRACKET_LEFT = 106, - ANGLE_BRACKET_ANGLE_BRACKET_LEFT_EQUAL = 107, ANGLE_BRACKET_ANGLE_BRACKET_LEFT_PIPE = 108, - ANGLE_BRACKET_ANGLE_BRACKET_LEFT_PIPE_EQUAL = 109, ANGLE_BRACKET_RIGHT = 110, - ANGLE_BRACKET_RIGHT_EQUAL = 111, ANGLE_BRACKET_ANGLE_BRACKET_RIGHT = 112, - ANGLE_BRACKET_ANGLE_BRACKET_RIGHT_EQUAL = 113, TILDE = 114, - STRING_LITERAL = 115, CHAR_LITERAL = 116, - EOF = 117, BUILTIN = 118, - NUMBER_LITERAL = 119, DOC_COMMENT = 120, - CONTAINER_DOC_COMMENT = 121, -} - - -State = { - START = 1, IDENTIFIER = 2, - BUILTIN = 3, STRING_LITERAL = 5, - STRING_LITERAL_BACKSLASH = 6, MULTILINE_STRING_LITERAL_LINE = 7, - CHAR_LITERAL = 8, CHAR_LITERAL_BACKSLASH = 9, - CHAR_LITERAL_HEX_ESCAPE = 10, CHAR_LITERAL_UNICODE_ESCAPE_SAW_U = 11, - CHAR_LITERAL_UNICODE_ESCAPE = 12, CHAR_LITERAL_UNICODE_INVALID = 13, - CHAR_LITERAL_UNICODE = 14, CHAR_LITERAL_END = 15, - BACKSLASH = 16, EQUAL = 17, - BANG = 18, PIPE = 19, - MINUS = 20, MINUS_PERCENT = 21, - MINUS_PIPE = 22, ASTERISK = 23, - ASTERISK_PERCENT = 24, ASTERISK_PIPE = 25, - SLASH = 26, LINE_COMMENT_START = 27, - LINE_COMMENT = 28, DOC_COMMENT_START = 29, - DOC_COMMENT = 30, INT = 31, - INT_EXPONENT = 32, INT_PERIOD = 33, - FLOAT = 34, FLOAT_EXPONENT = 35, - AMPERSAND = 36, CARET = 37, - PERCENT = 38, PLUS = 39, - PLUS_PERCENT = 40, PLUS_PIPE = 41, - ANGLE_BRACKET_LEFT = 42, ANGLE_BRACKET_ANGLE_BRACKET_LEFT = 43, - ANGLE_BRACKET_ANGLE_BRACKET_LEFT_PIPE = 44, ANGLE_BRACKET_RIGHT = 45, - ANGLE_BRACKET_ANGLE_BRACKET_RIGHT = 46, PERIOD = 47, - PERIOD_2 = 48, PERIOD_ASTERISK = 49, - SAW_AT_SIGN = 50, -} - -Lexer = { - Reverse, - Tokens, - State, - x = 0, -} - -function Lexer:new() - local l = {} - setmetatable(l, self) - self.__index = self - return l -end - -function Lexer:lex(char) - -end - -return Lexer \ No newline at end of file diff --git a/06/Makefile b/06/Makefile index e770cd4..6d58744 100644 --- a/06/Makefile +++ b/06/Makefile @@ -1,23 +1,26 @@ CC= ../05/tcc-0.9.27/tcc TCCINST= ../05/tcc-bootstrap MUSLINST= ../05/musl-bootstrap -LUAINST= lua-bootstrap +LUAINST= deps/lua-bootstrap -CFLAGS= -I $(MUSLINST)/include -I $(LUAINST)/include -I lpeglabel +CFLAGS= -I $(MUSLINST)/include -I $(LUAINST)/include -I deps/lpeglabel SRCS = $(sort $(wildcard **/*.c)) OBJS = $(SRCS:.c=.o) all: zsh -lua-bootstrap/lib/liblua.a: - $(MAKE) -j8 -C lua-5.4.6 - $(MAKE) -C lua-5.4.6 install +deps/lua-bootstrap/lib/liblua.a: + $(MAKE) -j8 -C deps/lua-5.4.6 + $(MAKE) -C deps/lua-5.4.6 install -%.o: %.c lua-bootstrap/lib/liblua.a +deps/lpeglabel/lpeglabel.a: deps/lua-bootstrap/lib/liblua.a + $(MAKE) -C deps/lpeglabel + +%.o: %.c deps/lua-bootstrap/lib/liblua.a $(CC) $(CFLAGS) -c -o $@ $< -zsh: $(OBJS) lua-bootstrap/lib/liblua.a - $(CC) -nostdlib -B $(TCCINST) -o zsh $(OBJS) $(LUAINST)/lib/liblua.a $(MUSLINST)/lib/*.[oa] +zsh: $(OBJS) deps/lua-bootstrap/lib/liblua.a deps/lpeglabel/lpeglabel.a + $(CC) -nostdlib -B $(TCCINST) -o zsh $(OBJS) deps/lpeglabel/lpeglabel.a $(LUAINST)/lib/liblua.a $(MUSLINST)/lib/*.[oa] run: zsh ./zsh @@ -25,9 +28,10 @@ run: zsh c: rm -f zsh rm -f src/*.o - rm -f lpeglabel/*.o + rm -f deps/lpeglabel/*.o clean: c - rm -rf lua-bootstrap - $(MAKE) -C lua-5.4.6 clean + rm -rf deps/lua-bootstrap + $(MAKE) -C deps/lua-5.4.6 clean + $(MAKE) -C deps/lpeglabel clean diff --git a/06/README.md b/06/README.md index 85a97a8..319565c 100644 --- a/06/README.md +++ b/06/README.md @@ -14,3 +14,4 @@ Implement backslashed escaped characters in grammar parser Implement single line comments starting with # in grammar parser + diff --git a/06/lpeglabel/.gitignore b/06/deps/lpeglabel/.gitignore similarity index 57% rename from 06/lpeglabel/.gitignore rename to 06/deps/lpeglabel/.gitignore index 8ddf7f8..0e425ae 100644 --- a/06/lpeglabel/.gitignore +++ b/06/deps/lpeglabel/.gitignore @@ -1,2 +1,3 @@ lpeglabel.so +lpeglabel.a *.o \ No newline at end of file diff --git a/06/lpeglabel/HISTORY b/06/deps/lpeglabel/HISTORY similarity index 100% rename from 06/lpeglabel/HISTORY rename to 06/deps/lpeglabel/HISTORY diff --git a/06/lpeglabel/LICENSE b/06/deps/lpeglabel/LICENSE similarity index 100% rename from 06/lpeglabel/LICENSE rename to 06/deps/lpeglabel/LICENSE diff --git a/06/lpeglabel/README.md b/06/deps/lpeglabel/README.md similarity index 100% rename from 06/lpeglabel/README.md rename to 06/deps/lpeglabel/README.md diff --git a/06/lpeglabel/examples/expRec.lua b/06/deps/lpeglabel/examples/expRec.lua similarity index 97% rename from 06/lpeglabel/examples/expRec.lua rename to 06/deps/lpeglabel/examples/expRec.lua index 52bd40a..f70b581 100644 --- a/06/lpeglabel/examples/expRec.lua +++ b/06/deps/lpeglabel/examples/expRec.lua @@ -1,5 +1,5 @@ -local m = require"lpeglabel" -local re = require"relabel" +local m = require "lpeglabel" +local re = require "relabel" local labels = { {"ExpTermFirst", "expected an expression"}, diff --git a/06/lpeglabel/examples/expRecAut.lua b/06/deps/lpeglabel/examples/expRecAut.lua similarity index 97% rename from 06/lpeglabel/examples/expRecAut.lua rename to 06/deps/lpeglabel/examples/expRecAut.lua index b8280a7..c3d7efb 100644 --- a/06/lpeglabel/examples/expRecAut.lua +++ b/06/deps/lpeglabel/examples/expRecAut.lua @@ -1,5 +1,5 @@ -local m = require"lpeglabel" -local re = require"relabel" +local m = require "lpeglabel" +local re = require "relabel" local num = m.R("09")^1 / tonumber local op = m.S("+-") diff --git a/06/lpeglabel/examples/farthest.lua b/06/deps/lpeglabel/examples/farthest.lua similarity index 100% rename from 06/lpeglabel/examples/farthest.lua rename to 06/deps/lpeglabel/examples/farthest.lua diff --git a/06/lpeglabel/examples/listId1.lua b/06/deps/lpeglabel/examples/listId1.lua similarity index 100% rename from 06/lpeglabel/examples/listId1.lua rename to 06/deps/lpeglabel/examples/listId1.lua diff --git a/06/lpeglabel/examples/listId2.lua b/06/deps/lpeglabel/examples/listId2.lua similarity index 100% rename from 06/lpeglabel/examples/listId2.lua rename to 06/deps/lpeglabel/examples/listId2.lua diff --git a/06/lpeglabel/examples/listId2Rec2.lua b/06/deps/lpeglabel/examples/listId2Rec2.lua similarity index 100% rename from 06/lpeglabel/examples/listId2Rec2.lua rename to 06/deps/lpeglabel/examples/listId2Rec2.lua diff --git a/06/lpeglabel/examples/listId2Rec2Cap.lua b/06/deps/lpeglabel/examples/listId2Rec2Cap.lua similarity index 100% rename from 06/lpeglabel/examples/listId2Rec2Cap.lua rename to 06/deps/lpeglabel/examples/listId2Rec2Cap.lua diff --git a/06/lpeglabel/examples/listIdRe1.lua b/06/deps/lpeglabel/examples/listIdRe1.lua similarity index 100% rename from 06/lpeglabel/examples/listIdRe1.lua rename to 06/deps/lpeglabel/examples/listIdRe1.lua diff --git a/06/lpeglabel/examples/listIdRe2.lua b/06/deps/lpeglabel/examples/listIdRe2.lua similarity index 100% rename from 06/lpeglabel/examples/listIdRe2.lua rename to 06/deps/lpeglabel/examples/listIdRe2.lua diff --git a/06/lpeglabel/examples/tiny.lua b/06/deps/lpeglabel/examples/tiny.lua similarity index 100% rename from 06/lpeglabel/examples/tiny.lua rename to 06/deps/lpeglabel/examples/tiny.lua diff --git a/06/lpeglabel/examples/typedlua/test.lua b/06/deps/lpeglabel/examples/typedlua/test.lua similarity index 100% rename from 06/lpeglabel/examples/typedlua/test.lua rename to 06/deps/lpeglabel/examples/typedlua/test.lua diff --git a/06/lpeglabel/examples/typedlua/tlerror.lua b/06/deps/lpeglabel/examples/typedlua/tlerror.lua similarity index 100% rename from 06/lpeglabel/examples/typedlua/tlerror.lua rename to 06/deps/lpeglabel/examples/typedlua/tlerror.lua diff --git a/06/lpeglabel/examples/typedlua/tllexer.lua b/06/deps/lpeglabel/examples/typedlua/tllexer.lua similarity index 100% rename from 06/lpeglabel/examples/typedlua/tllexer.lua rename to 06/deps/lpeglabel/examples/typedlua/tllexer.lua diff --git a/06/lpeglabel/examples/typedlua/tlp.lua b/06/deps/lpeglabel/examples/typedlua/tlp.lua similarity index 100% rename from 06/lpeglabel/examples/typedlua/tlp.lua rename to 06/deps/lpeglabel/examples/typedlua/tlp.lua diff --git a/06/lpeglabel/examples/typedlua/tlparser.lua b/06/deps/lpeglabel/examples/typedlua/tlparser.lua similarity index 100% rename from 06/lpeglabel/examples/typedlua/tlparser.lua rename to 06/deps/lpeglabel/examples/typedlua/tlparser.lua diff --git a/06/lpeglabel/lpcap.c b/06/deps/lpeglabel/lpcap.c similarity index 100% rename from 06/lpeglabel/lpcap.c rename to 06/deps/lpeglabel/lpcap.c diff --git a/06/lpeglabel/lpcap.h b/06/deps/lpeglabel/lpcap.h similarity index 100% rename from 06/lpeglabel/lpcap.h rename to 06/deps/lpeglabel/lpcap.h diff --git a/06/lpeglabel/lpcode.c b/06/deps/lpeglabel/lpcode.c similarity index 100% rename from 06/lpeglabel/lpcode.c rename to 06/deps/lpeglabel/lpcode.c diff --git a/06/lpeglabel/lpcode.h b/06/deps/lpeglabel/lpcode.h similarity index 100% rename from 06/lpeglabel/lpcode.h rename to 06/deps/lpeglabel/lpcode.h diff --git a/06/lpeglabel/lpeglabel-logo.png b/06/deps/lpeglabel/lpeglabel-logo.png similarity index 100% rename from 06/lpeglabel/lpeglabel-logo.png rename to 06/deps/lpeglabel/lpeglabel-logo.png diff --git a/06/lpeglabel/lpprint.c b/06/deps/lpeglabel/lpprint.c similarity index 100% rename from 06/lpeglabel/lpprint.c rename to 06/deps/lpeglabel/lpprint.c diff --git a/06/lpeglabel/lpprint.h b/06/deps/lpeglabel/lpprint.h similarity index 100% rename from 06/lpeglabel/lpprint.h rename to 06/deps/lpeglabel/lpprint.h diff --git a/06/lpeglabel/lptree.c b/06/deps/lpeglabel/lptree.c similarity index 100% rename from 06/lpeglabel/lptree.c rename to 06/deps/lpeglabel/lptree.c diff --git a/06/lpeglabel/lptree.h b/06/deps/lpeglabel/lptree.h similarity index 100% rename from 06/lpeglabel/lptree.h rename to 06/deps/lpeglabel/lptree.h diff --git a/06/lpeglabel/lptypes.h b/06/deps/lpeglabel/lptypes.h similarity index 100% rename from 06/lpeglabel/lptypes.h rename to 06/deps/lpeglabel/lptypes.h diff --git a/06/lpeglabel/lpvm.c b/06/deps/lpeglabel/lpvm.c similarity index 100% rename from 06/lpeglabel/lpvm.c rename to 06/deps/lpeglabel/lpvm.c diff --git a/06/lpeglabel/lpvm.h b/06/deps/lpeglabel/lpvm.h similarity index 100% rename from 06/lpeglabel/lpvm.h rename to 06/deps/lpeglabel/lpvm.h diff --git a/06/lpeglabel/makefile b/06/deps/lpeglabel/makefile similarity index 76% rename from 06/lpeglabel/makefile rename to 06/deps/lpeglabel/makefile index 31b3e14..d0c67c9 100644 --- a/06/lpeglabel/makefile +++ b/06/deps/lpeglabel/makefile @@ -22,21 +22,21 @@ CWARNS = -Wall -Wextra -pedantic \ # -Wunreachable-code \ -CFLAGS = $(CWARNS) -nostdinc -B ../../05/tcc-bootstrap -I ../../05/musl-bootstrap/include -I$(LUADIR) -CC = ../../05/tcc-0.9.27/tcc +CFLAGS = $(CWARNS) -nostdinc -B ../../../05/tcc-bootstrap -I ../../../05/musl-bootstrap/include -I$(LUADIR) +CC = ../../../05/tcc-0.9.27/tcc FILES = lpvm.o lpcap.o lptree.o lpcode.o lpprint.o # For Linux linux: - make lpeglabel.so "DLLFLAGS = -shared -nostdlib -B ../../05/tcc-bootstrap " + make lpeglabel.a # # For Mac OS # macosx: # make lpeglabel.so "DLLFLAGS = -bundle -undefined dynamic_lookup" -lpeglabel.so: $(FILES) - $(CC) $(DLLFLAGS) $(FILES) -o lpeglabel.so ../lua-bootstrap/lib/liblua.a ../../05/musl-bootstrap/lib/libc.a +lpeglabel.a: $(FILES) + $(CC) -ar c lpeglabel.a $(FILES) $(FILES): makefile diff --git a/06/lpeglabel/relabel.lua b/06/deps/lpeglabel/relabel.lua similarity index 98% rename from 06/lpeglabel/relabel.lua rename to 06/deps/lpeglabel/relabel.lua index 1089d34..33a332c 100644 --- a/06/lpeglabel/relabel.lua +++ b/06/deps/lpeglabel/relabel.lua @@ -4,8 +4,9 @@ local tonumber, type, print, error, ipairs = tonumber, type, print, error, ipairs local pcall = pcall local setmetatable = setmetatable -local unpack, tinsert, concat = table.unpack or unpack, table.insert, table.concat +local unpack, tinsert, concat = table.unpack, table.insert, table.concat local rep = string.rep +-- m is defined in main.c and is equivalent to require ('lpeglabel' local m = m -- 'm' will be used to parse expressions, and 'mm' will be used to diff --git a/06/lpeglabel/rockspecs/lpeglabel-0.12.2-1.rockspec b/06/deps/lpeglabel/rockspecs/lpeglabel-0.12.2-1.rockspec similarity index 100% rename from 06/lpeglabel/rockspecs/lpeglabel-0.12.2-1.rockspec rename to 06/deps/lpeglabel/rockspecs/lpeglabel-0.12.2-1.rockspec diff --git a/06/lpeglabel/rockspecs/lpeglabel-0.12.2-2.rockspec b/06/deps/lpeglabel/rockspecs/lpeglabel-0.12.2-2.rockspec similarity index 100% rename from 06/lpeglabel/rockspecs/lpeglabel-0.12.2-2.rockspec rename to 06/deps/lpeglabel/rockspecs/lpeglabel-0.12.2-2.rockspec diff --git a/06/lpeglabel/rockspecs/lpeglabel-1.0.0-1.rockspec b/06/deps/lpeglabel/rockspecs/lpeglabel-1.0.0-1.rockspec similarity index 100% rename from 06/lpeglabel/rockspecs/lpeglabel-1.0.0-1.rockspec rename to 06/deps/lpeglabel/rockspecs/lpeglabel-1.0.0-1.rockspec diff --git a/06/lpeglabel/rockspecs/lpeglabel-1.1.0-1.rockspec b/06/deps/lpeglabel/rockspecs/lpeglabel-1.1.0-1.rockspec similarity index 100% rename from 06/lpeglabel/rockspecs/lpeglabel-1.1.0-1.rockspec rename to 06/deps/lpeglabel/rockspecs/lpeglabel-1.1.0-1.rockspec diff --git a/06/lpeglabel/rockspecs/lpeglabel-1.2.0-1.rockspec b/06/deps/lpeglabel/rockspecs/lpeglabel-1.2.0-1.rockspec similarity index 100% rename from 06/lpeglabel/rockspecs/lpeglabel-1.2.0-1.rockspec rename to 06/deps/lpeglabel/rockspecs/lpeglabel-1.2.0-1.rockspec diff --git a/06/lpeglabel/test.lua b/06/deps/lpeglabel/test.lua similarity index 99% rename from 06/lpeglabel/test.lua rename to 06/deps/lpeglabel/test.lua index d5922ac..b985126 100755 --- a/06/lpeglabel/test.lua +++ b/06/deps/lpeglabel/test.lua @@ -12,7 +12,7 @@ local a, b, c, d, e, f, g, p, t -- compatibility with Lua 5.2 -local unpack = rawget(table, "unpack") or unpack +local unpack = rawget(table, "unpack") local loadstring = rawget(_G, "loadstring") or load diff --git a/06/lpeglabel/testlabel.lua b/06/deps/lpeglabel/testlabel.lua similarity index 100% rename from 06/lpeglabel/testlabel.lua rename to 06/deps/lpeglabel/testlabel.lua diff --git a/06/lpeglabel/testrelabelparser.lua b/06/deps/lpeglabel/testrelabelparser.lua similarity index 100% rename from 06/lpeglabel/testrelabelparser.lua rename to 06/deps/lpeglabel/testrelabelparser.lua diff --git a/06/lua-5.4.6/.gitignore b/06/deps/lua-5.4.6/.gitignore similarity index 100% rename from 06/lua-5.4.6/.gitignore rename to 06/deps/lua-5.4.6/.gitignore diff --git a/06/lua-5.4.6/Makefile b/06/deps/lua-5.4.6/Makefile similarity index 100% rename from 06/lua-5.4.6/Makefile rename to 06/deps/lua-5.4.6/Makefile diff --git a/06/lua-5.4.6/README b/06/deps/lua-5.4.6/README similarity index 100% rename from 06/lua-5.4.6/README rename to 06/deps/lua-5.4.6/README diff --git a/06/lua-5.4.6/doc/contents.html b/06/deps/lua-5.4.6/doc/contents.html similarity index 100% rename from 06/lua-5.4.6/doc/contents.html rename to 06/deps/lua-5.4.6/doc/contents.html diff --git a/06/lua-5.4.6/doc/index.css b/06/deps/lua-5.4.6/doc/index.css similarity index 100% rename from 06/lua-5.4.6/doc/index.css rename to 06/deps/lua-5.4.6/doc/index.css diff --git a/06/lua-5.4.6/doc/logo.gif b/06/deps/lua-5.4.6/doc/logo.gif similarity index 100% rename from 06/lua-5.4.6/doc/logo.gif rename to 06/deps/lua-5.4.6/doc/logo.gif diff --git a/06/lua-5.4.6/doc/lua.1 b/06/deps/lua-5.4.6/doc/lua.1 similarity index 100% rename from 06/lua-5.4.6/doc/lua.1 rename to 06/deps/lua-5.4.6/doc/lua.1 diff --git a/06/lua-5.4.6/doc/lua.css b/06/deps/lua-5.4.6/doc/lua.css similarity index 100% rename from 06/lua-5.4.6/doc/lua.css rename to 06/deps/lua-5.4.6/doc/lua.css diff --git a/06/lua-5.4.6/doc/luac.1 b/06/deps/lua-5.4.6/doc/luac.1 similarity index 100% rename from 06/lua-5.4.6/doc/luac.1 rename to 06/deps/lua-5.4.6/doc/luac.1 diff --git a/06/lua-5.4.6/doc/manual.css b/06/deps/lua-5.4.6/doc/manual.css similarity index 100% rename from 06/lua-5.4.6/doc/manual.css rename to 06/deps/lua-5.4.6/doc/manual.css diff --git a/06/lua-5.4.6/doc/manual.html b/06/deps/lua-5.4.6/doc/manual.html similarity index 100% rename from 06/lua-5.4.6/doc/manual.html rename to 06/deps/lua-5.4.6/doc/manual.html diff --git a/06/lua-5.4.6/doc/osi-certified-72x60.png b/06/deps/lua-5.4.6/doc/osi-certified-72x60.png similarity index 100% rename from 06/lua-5.4.6/doc/osi-certified-72x60.png rename to 06/deps/lua-5.4.6/doc/osi-certified-72x60.png diff --git a/06/lua-5.4.6/doc/readme.html b/06/deps/lua-5.4.6/doc/readme.html similarity index 100% rename from 06/lua-5.4.6/doc/readme.html rename to 06/deps/lua-5.4.6/doc/readme.html diff --git a/06/lua-5.4.6/src/Makefile b/06/deps/lua-5.4.6/src/Makefile similarity index 95% rename from 06/lua-5.4.6/src/Makefile rename to 06/deps/lua-5.4.6/src/Makefile index 694a3fb..bc879e5 100644 --- a/06/lua-5.4.6/src/Makefile +++ b/06/deps/lua-5.4.6/src/Makefile @@ -6,12 +6,12 @@ # Your platform. See PLATS for possible values. PLAT= linux -CC= ../../../05/tcc-0.9.27/tcc -CFLAGS= -nostdinc -B ../../../05/tcc-boostrap -I ../../../05/musl-bootstrap/include $(SYSCFLAGS) $(MYCFLAGS) +CC= ../../../../05/tcc-0.9.27/tcc +CFLAGS= -nostdinc -B ../../../../05/tcc-boostrap -I ../../../../05/musl-bootstrap/include $(SYSCFLAGS) $(MYCFLAGS) LDFLAGS= -nostdlib $(SYSLDFLAGS) $(MYLDFLAGS) LIBS= $(SYSLIBS) $(MYLIBS) -AR= ../../../05/tcc-0.9.27/tcc -ar rc +AR= ../../../../05/tcc-0.9.27/tcc -ar rc RANLIB= ranlib RM= rm -f UNAME= uname @@ -61,10 +61,10 @@ $(LUA_A): $(BASE_O) $(RANLIB) $@ $(LUA_T): $(LUA_O) $(LUA_A) - $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) ../../../05/musl-bootstrap/lib/*.[oa] + $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) ../../../../05/musl-bootstrap/lib/*.[oa] $(LUAC_T): $(LUAC_O) $(LUA_A) - $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) ../../../05/musl-bootstrap/lib/*.[oa] + $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) ../../../../05/musl-bootstrap/lib/*.[oa] test: ./$(LUA_T) -v diff --git a/06/lua-5.4.6/src/lapi.c b/06/deps/lua-5.4.6/src/lapi.c similarity index 100% rename from 06/lua-5.4.6/src/lapi.c rename to 06/deps/lua-5.4.6/src/lapi.c diff --git a/06/lua-5.4.6/src/lapi.h b/06/deps/lua-5.4.6/src/lapi.h similarity index 100% rename from 06/lua-5.4.6/src/lapi.h rename to 06/deps/lua-5.4.6/src/lapi.h diff --git a/06/lua-5.4.6/src/lauxlib.c b/06/deps/lua-5.4.6/src/lauxlib.c similarity index 100% rename from 06/lua-5.4.6/src/lauxlib.c rename to 06/deps/lua-5.4.6/src/lauxlib.c diff --git a/06/lua-5.4.6/src/lauxlib.h b/06/deps/lua-5.4.6/src/lauxlib.h similarity index 100% rename from 06/lua-5.4.6/src/lauxlib.h rename to 06/deps/lua-5.4.6/src/lauxlib.h diff --git a/06/lua-5.4.6/src/lbaselib.c b/06/deps/lua-5.4.6/src/lbaselib.c similarity index 100% rename from 06/lua-5.4.6/src/lbaselib.c rename to 06/deps/lua-5.4.6/src/lbaselib.c diff --git a/06/lua-5.4.6/src/lcode.c b/06/deps/lua-5.4.6/src/lcode.c similarity index 100% rename from 06/lua-5.4.6/src/lcode.c rename to 06/deps/lua-5.4.6/src/lcode.c diff --git a/06/lua-5.4.6/src/lcode.h b/06/deps/lua-5.4.6/src/lcode.h similarity index 100% rename from 06/lua-5.4.6/src/lcode.h rename to 06/deps/lua-5.4.6/src/lcode.h diff --git a/06/lua-5.4.6/src/lcorolib.c b/06/deps/lua-5.4.6/src/lcorolib.c similarity index 100% rename from 06/lua-5.4.6/src/lcorolib.c rename to 06/deps/lua-5.4.6/src/lcorolib.c diff --git a/06/lua-5.4.6/src/lctype.c b/06/deps/lua-5.4.6/src/lctype.c similarity index 100% rename from 06/lua-5.4.6/src/lctype.c rename to 06/deps/lua-5.4.6/src/lctype.c diff --git a/06/lua-5.4.6/src/lctype.h b/06/deps/lua-5.4.6/src/lctype.h similarity index 100% rename from 06/lua-5.4.6/src/lctype.h rename to 06/deps/lua-5.4.6/src/lctype.h diff --git a/06/lua-5.4.6/src/ldblib.c b/06/deps/lua-5.4.6/src/ldblib.c similarity index 100% rename from 06/lua-5.4.6/src/ldblib.c rename to 06/deps/lua-5.4.6/src/ldblib.c diff --git a/06/lua-5.4.6/src/ldebug.c b/06/deps/lua-5.4.6/src/ldebug.c similarity index 100% rename from 06/lua-5.4.6/src/ldebug.c rename to 06/deps/lua-5.4.6/src/ldebug.c diff --git a/06/lua-5.4.6/src/ldebug.h b/06/deps/lua-5.4.6/src/ldebug.h similarity index 100% rename from 06/lua-5.4.6/src/ldebug.h rename to 06/deps/lua-5.4.6/src/ldebug.h diff --git a/06/lua-5.4.6/src/ldo.c b/06/deps/lua-5.4.6/src/ldo.c similarity index 100% rename from 06/lua-5.4.6/src/ldo.c rename to 06/deps/lua-5.4.6/src/ldo.c diff --git a/06/lua-5.4.6/src/ldo.h b/06/deps/lua-5.4.6/src/ldo.h similarity index 100% rename from 06/lua-5.4.6/src/ldo.h rename to 06/deps/lua-5.4.6/src/ldo.h diff --git a/06/lua-5.4.6/src/ldump.c b/06/deps/lua-5.4.6/src/ldump.c similarity index 100% rename from 06/lua-5.4.6/src/ldump.c rename to 06/deps/lua-5.4.6/src/ldump.c diff --git a/06/lua-5.4.6/src/lfunc.c b/06/deps/lua-5.4.6/src/lfunc.c similarity index 100% rename from 06/lua-5.4.6/src/lfunc.c rename to 06/deps/lua-5.4.6/src/lfunc.c diff --git a/06/lua-5.4.6/src/lfunc.h b/06/deps/lua-5.4.6/src/lfunc.h similarity index 100% rename from 06/lua-5.4.6/src/lfunc.h rename to 06/deps/lua-5.4.6/src/lfunc.h diff --git a/06/lua-5.4.6/src/lgc.c b/06/deps/lua-5.4.6/src/lgc.c similarity index 100% rename from 06/lua-5.4.6/src/lgc.c rename to 06/deps/lua-5.4.6/src/lgc.c diff --git a/06/lua-5.4.6/src/lgc.h b/06/deps/lua-5.4.6/src/lgc.h similarity index 100% rename from 06/lua-5.4.6/src/lgc.h rename to 06/deps/lua-5.4.6/src/lgc.h diff --git a/06/lua-5.4.6/src/linit.c b/06/deps/lua-5.4.6/src/linit.c similarity index 100% rename from 06/lua-5.4.6/src/linit.c rename to 06/deps/lua-5.4.6/src/linit.c diff --git a/06/lua-5.4.6/src/liolib.c b/06/deps/lua-5.4.6/src/liolib.c similarity index 100% rename from 06/lua-5.4.6/src/liolib.c rename to 06/deps/lua-5.4.6/src/liolib.c diff --git a/06/lua-5.4.6/src/ljumptab.h b/06/deps/lua-5.4.6/src/ljumptab.h similarity index 100% rename from 06/lua-5.4.6/src/ljumptab.h rename to 06/deps/lua-5.4.6/src/ljumptab.h diff --git a/06/lua-5.4.6/src/llex.c b/06/deps/lua-5.4.6/src/llex.c similarity index 100% rename from 06/lua-5.4.6/src/llex.c rename to 06/deps/lua-5.4.6/src/llex.c diff --git a/06/lua-5.4.6/src/llex.h b/06/deps/lua-5.4.6/src/llex.h similarity index 100% rename from 06/lua-5.4.6/src/llex.h rename to 06/deps/lua-5.4.6/src/llex.h diff --git a/06/lua-5.4.6/src/llimits.h b/06/deps/lua-5.4.6/src/llimits.h similarity index 100% rename from 06/lua-5.4.6/src/llimits.h rename to 06/deps/lua-5.4.6/src/llimits.h diff --git a/06/lua-5.4.6/src/lmathlib.c b/06/deps/lua-5.4.6/src/lmathlib.c similarity index 100% rename from 06/lua-5.4.6/src/lmathlib.c rename to 06/deps/lua-5.4.6/src/lmathlib.c diff --git a/06/lua-5.4.6/src/lmem.c b/06/deps/lua-5.4.6/src/lmem.c similarity index 100% rename from 06/lua-5.4.6/src/lmem.c rename to 06/deps/lua-5.4.6/src/lmem.c diff --git a/06/lua-5.4.6/src/lmem.h b/06/deps/lua-5.4.6/src/lmem.h similarity index 100% rename from 06/lua-5.4.6/src/lmem.h rename to 06/deps/lua-5.4.6/src/lmem.h diff --git a/06/lua-5.4.6/src/loadlib.c b/06/deps/lua-5.4.6/src/loadlib.c similarity index 100% rename from 06/lua-5.4.6/src/loadlib.c rename to 06/deps/lua-5.4.6/src/loadlib.c diff --git a/06/lua-5.4.6/src/lobject.c b/06/deps/lua-5.4.6/src/lobject.c similarity index 100% rename from 06/lua-5.4.6/src/lobject.c rename to 06/deps/lua-5.4.6/src/lobject.c diff --git a/06/lua-5.4.6/src/lobject.h b/06/deps/lua-5.4.6/src/lobject.h similarity index 100% rename from 06/lua-5.4.6/src/lobject.h rename to 06/deps/lua-5.4.6/src/lobject.h diff --git a/06/lua-5.4.6/src/lopcodes.c b/06/deps/lua-5.4.6/src/lopcodes.c similarity index 100% rename from 06/lua-5.4.6/src/lopcodes.c rename to 06/deps/lua-5.4.6/src/lopcodes.c diff --git a/06/lua-5.4.6/src/lopcodes.h b/06/deps/lua-5.4.6/src/lopcodes.h similarity index 100% rename from 06/lua-5.4.6/src/lopcodes.h rename to 06/deps/lua-5.4.6/src/lopcodes.h diff --git a/06/lua-5.4.6/src/lopnames.h b/06/deps/lua-5.4.6/src/lopnames.h similarity index 100% rename from 06/lua-5.4.6/src/lopnames.h rename to 06/deps/lua-5.4.6/src/lopnames.h diff --git a/06/lua-5.4.6/src/loslib.c b/06/deps/lua-5.4.6/src/loslib.c similarity index 100% rename from 06/lua-5.4.6/src/loslib.c rename to 06/deps/lua-5.4.6/src/loslib.c diff --git a/06/lua-5.4.6/src/lparser.c b/06/deps/lua-5.4.6/src/lparser.c similarity index 100% rename from 06/lua-5.4.6/src/lparser.c rename to 06/deps/lua-5.4.6/src/lparser.c diff --git a/06/lua-5.4.6/src/lparser.h b/06/deps/lua-5.4.6/src/lparser.h similarity index 100% rename from 06/lua-5.4.6/src/lparser.h rename to 06/deps/lua-5.4.6/src/lparser.h diff --git a/06/lua-5.4.6/src/lprefix.h b/06/deps/lua-5.4.6/src/lprefix.h similarity index 100% rename from 06/lua-5.4.6/src/lprefix.h rename to 06/deps/lua-5.4.6/src/lprefix.h diff --git a/06/lua-5.4.6/src/lstate.c b/06/deps/lua-5.4.6/src/lstate.c similarity index 100% rename from 06/lua-5.4.6/src/lstate.c rename to 06/deps/lua-5.4.6/src/lstate.c diff --git a/06/lua-5.4.6/src/lstate.h b/06/deps/lua-5.4.6/src/lstate.h similarity index 100% rename from 06/lua-5.4.6/src/lstate.h rename to 06/deps/lua-5.4.6/src/lstate.h diff --git a/06/lua-5.4.6/src/lstring.c b/06/deps/lua-5.4.6/src/lstring.c similarity index 100% rename from 06/lua-5.4.6/src/lstring.c rename to 06/deps/lua-5.4.6/src/lstring.c diff --git a/06/lua-5.4.6/src/lstring.h b/06/deps/lua-5.4.6/src/lstring.h similarity index 100% rename from 06/lua-5.4.6/src/lstring.h rename to 06/deps/lua-5.4.6/src/lstring.h diff --git a/06/lua-5.4.6/src/lstrlib.c b/06/deps/lua-5.4.6/src/lstrlib.c similarity index 100% rename from 06/lua-5.4.6/src/lstrlib.c rename to 06/deps/lua-5.4.6/src/lstrlib.c diff --git a/06/lua-5.4.6/src/ltable.c b/06/deps/lua-5.4.6/src/ltable.c similarity index 100% rename from 06/lua-5.4.6/src/ltable.c rename to 06/deps/lua-5.4.6/src/ltable.c diff --git a/06/lua-5.4.6/src/ltable.h b/06/deps/lua-5.4.6/src/ltable.h similarity index 100% rename from 06/lua-5.4.6/src/ltable.h rename to 06/deps/lua-5.4.6/src/ltable.h diff --git a/06/lua-5.4.6/src/ltablib.c b/06/deps/lua-5.4.6/src/ltablib.c similarity index 100% rename from 06/lua-5.4.6/src/ltablib.c rename to 06/deps/lua-5.4.6/src/ltablib.c diff --git a/06/lua-5.4.6/src/ltm.c b/06/deps/lua-5.4.6/src/ltm.c similarity index 100% rename from 06/lua-5.4.6/src/ltm.c rename to 06/deps/lua-5.4.6/src/ltm.c diff --git a/06/lua-5.4.6/src/ltm.h b/06/deps/lua-5.4.6/src/ltm.h similarity index 100% rename from 06/lua-5.4.6/src/ltm.h rename to 06/deps/lua-5.4.6/src/ltm.h diff --git a/06/lua-5.4.6/src/lua.c b/06/deps/lua-5.4.6/src/lua.c similarity index 100% rename from 06/lua-5.4.6/src/lua.c rename to 06/deps/lua-5.4.6/src/lua.c diff --git a/06/lua-5.4.6/src/lua.h b/06/deps/lua-5.4.6/src/lua.h similarity index 100% rename from 06/lua-5.4.6/src/lua.h rename to 06/deps/lua-5.4.6/src/lua.h diff --git a/06/lua-5.4.6/src/lua.hpp b/06/deps/lua-5.4.6/src/lua.hpp similarity index 100% rename from 06/lua-5.4.6/src/lua.hpp rename to 06/deps/lua-5.4.6/src/lua.hpp diff --git a/06/lua-5.4.6/src/luac.c b/06/deps/lua-5.4.6/src/luac.c similarity index 100% rename from 06/lua-5.4.6/src/luac.c rename to 06/deps/lua-5.4.6/src/luac.c diff --git a/06/lua-5.4.6/src/luaconf.h b/06/deps/lua-5.4.6/src/luaconf.h similarity index 100% rename from 06/lua-5.4.6/src/luaconf.h rename to 06/deps/lua-5.4.6/src/luaconf.h diff --git a/06/lua-5.4.6/src/lualib.h b/06/deps/lua-5.4.6/src/lualib.h similarity index 100% rename from 06/lua-5.4.6/src/lualib.h rename to 06/deps/lua-5.4.6/src/lualib.h diff --git a/06/lua-5.4.6/src/lundump.c b/06/deps/lua-5.4.6/src/lundump.c similarity index 100% rename from 06/lua-5.4.6/src/lundump.c rename to 06/deps/lua-5.4.6/src/lundump.c diff --git a/06/lua-5.4.6/src/lundump.h b/06/deps/lua-5.4.6/src/lundump.h similarity index 100% rename from 06/lua-5.4.6/src/lundump.h rename to 06/deps/lua-5.4.6/src/lundump.h diff --git a/06/lua-5.4.6/src/lutf8lib.c b/06/deps/lua-5.4.6/src/lutf8lib.c similarity index 100% rename from 06/lua-5.4.6/src/lutf8lib.c rename to 06/deps/lua-5.4.6/src/lutf8lib.c diff --git a/06/lua-5.4.6/src/lvm.c b/06/deps/lua-5.4.6/src/lvm.c similarity index 100% rename from 06/lua-5.4.6/src/lvm.c rename to 06/deps/lua-5.4.6/src/lvm.c diff --git a/06/lua-5.4.6/src/lvm.h b/06/deps/lua-5.4.6/src/lvm.h similarity index 100% rename from 06/lua-5.4.6/src/lvm.h rename to 06/deps/lua-5.4.6/src/lvm.h diff --git a/06/lua-5.4.6/src/lzio.c b/06/deps/lua-5.4.6/src/lzio.c similarity index 100% rename from 06/lua-5.4.6/src/lzio.c rename to 06/deps/lua-5.4.6/src/lzio.c diff --git a/06/lua-5.4.6/src/lzio.h b/06/deps/lua-5.4.6/src/lzio.h similarity index 100% rename from 06/lua-5.4.6/src/lzio.h rename to 06/deps/lua-5.4.6/src/lzio.h diff --git a/06/parser-gen/LICENSE b/06/deps/parser-gen/LICENSE similarity index 100% rename from 06/parser-gen/LICENSE rename to 06/deps/parser-gen/LICENSE diff --git a/06/parser-gen/README.md b/06/deps/parser-gen/README.md similarity index 100% rename from 06/parser-gen/README.md rename to 06/deps/parser-gen/README.md diff --git a/06/parser-gen/equals.lua b/06/deps/parser-gen/equals.lua similarity index 100% rename from 06/parser-gen/equals.lua rename to 06/deps/parser-gen/equals.lua diff --git a/06/parser-gen/errorgen.lua b/06/deps/parser-gen/errorgen.lua similarity index 100% rename from 06/parser-gen/errorgen.lua rename to 06/deps/parser-gen/errorgen.lua diff --git a/06/parser-gen/parser-gen-tests.lua b/06/deps/parser-gen/parser-gen-tests.lua similarity index 85% rename from 06/parser-gen/parser-gen-tests.lua rename to 06/deps/parser-gen/parser-gen-tests.lua index 522df52..a1ae62d 100644 --- a/06/parser-gen/parser-gen-tests.lua +++ b/06/deps/parser-gen/parser-gen-tests.lua @@ -1,14 +1,5 @@ -local pg = require "parser-gen" -local peg = require "peg-parser" -local re = require "relabel" - -local eq = require "equals" - -local equals = eq.equals - - -local pr = peg.print_r - +local pg = require("parser-gen") +local equals = require("equals").equals -- terminals -- space allowed @@ -141,20 +132,18 @@ assert(errs[1]["msg"] == "Expected C") -- SELF-DESCRIPTION -pg.setlabels(peg.labels) -gram = pg.compile(peg.gram, peg.defs,_,true) -res1, errs = pg.parse(peg.gram,gram) +pg.setlabels(pg.labels) +gram = pg.compile(pg.gram, pg.defs,_,true) +res1, errs = pg.parse(pg.gram,gram) assert(res1) -- parse succesful --[[ this test is invalid since tool added ^LABEL syntax -r = re.compile(peg.gram,peg.defs) -res2 = r:match(peg.gram) +r = re.compile(pg.gram,pg.defs) +res2 = r:match(pg.gram) ---peg.print_r(res2) +--pg.print_r(res2) assert(equals(res1, res2)) ]]-- - - -print("all tests succesful") \ No newline at end of file +print("all tests succesful") diff --git a/06/parser-gen/parser-gen.lua b/06/deps/parser-gen/parser-gen.lua similarity index 97% rename from 06/parser-gen/parser-gen.lua rename to 06/deps/parser-gen/parser-gen.lua index 99b6aec..128de68 100644 --- a/06/parser-gen/parser-gen.lua +++ b/06/deps/parser-gen/parser-gen.lua @@ -1,21 +1,17 @@ -local peg = require "parser-gen.peg-parser" -local eg = require "parser-gen.errorgen" -local s = require "parser-gen.stack" +local f = (...):match("(.-)[^%.]+$") +local peg = require(f .. "peg-parser") +local eg = require(f .. "errorgen") +local s = require(f .. "stack") --- create stack for tokens inside captures. nil - not inside capture, 0 - inside capture, 1 - token found inside capture +-- Create stack for tokens inside captures. +-- nil - not inside capture, +-- 0 - inside capture, +-- 1 - token found inside capture local tokenstack = s.Stack:Create() - - - local subject, errors, errorfunc - --- Lua 5.1 compatibility: -local unpack = unpack or table.unpack - +local unpack = table.unpack; local Predef = { nl = m.P"\n", cr = m.P"\r", tab = m.P"\t" } - - local mem = {} -- for compiled grammars local function updatelocale() @@ -559,7 +555,8 @@ end - +-- could be wrong +local follow = eg.follow local pg = {compile=compile, setlabels=setlabels, parse=parse,follow=follow, calcline = peg.calcline, usenodes = usenodes} diff --git a/06/parser-gen/parsers/lua-parser-tests.lua b/06/deps/parser-gen/parsers/lua-parser-tests.lua similarity index 100% rename from 06/parser-gen/parsers/lua-parser-tests.lua rename to 06/deps/parser-gen/parsers/lua-parser-tests.lua diff --git a/06/parser-gen/parsers/lua-parser.lua b/06/deps/parser-gen/parsers/lua-parser.lua similarity index 100% rename from 06/parser-gen/parsers/lua-parser.lua rename to 06/deps/parser-gen/parsers/lua-parser.lua diff --git a/06/parser-gen/parsers/tiny-parser.lua b/06/deps/parser-gen/parsers/tiny-parser.lua similarity index 100% rename from 06/parser-gen/parsers/tiny-parser.lua rename to 06/deps/parser-gen/parsers/tiny-parser.lua diff --git a/06/parser-gen/peg-parser-tests.lua b/06/deps/parser-gen/peg-parser-tests.lua similarity index 99% rename from 06/parser-gen/peg-parser-tests.lua rename to 06/deps/parser-gen/peg-parser-tests.lua index 588b101..2d072d1 100644 --- a/06/parser-gen/peg-parser-tests.lua +++ b/06/deps/parser-gen/peg-parser-tests.lua @@ -1,4 +1,4 @@ -local peg = require "peg-parser" +local peg = require("peg-parser") local f = peg.pegToAST local eq = require "equals" diff --git a/06/parser-gen/peg-parser.lua b/06/deps/parser-gen/peg-parser.lua similarity index 99% rename from 06/parser-gen/peg-parser.lua rename to 06/deps/parser-gen/peg-parser.lua index f6fad7f..dc6d874 100644 --- a/06/parser-gen/peg-parser.lua +++ b/06/deps/parser-gen/peg-parser.lua @@ -1,4 +1,4 @@ -local re = require "lpeglabel.relabel" +local re = require("deps.lpeglabel.relabel") local peg = {} diff --git a/06/parser-gen/rockspecs/parser-gen-1.0.rockspec b/06/deps/parser-gen/rockspecs/parser-gen-1.0.rockspec similarity index 100% rename from 06/parser-gen/rockspecs/parser-gen-1.0.rockspec rename to 06/deps/parser-gen/rockspecs/parser-gen-1.0.rockspec diff --git a/06/parser-gen/rockspecs/parser-gen-1.1.rockspec b/06/deps/parser-gen/rockspecs/parser-gen-1.1.rockspec similarity index 100% rename from 06/parser-gen/rockspecs/parser-gen-1.1.rockspec rename to 06/deps/parser-gen/rockspecs/parser-gen-1.1.rockspec diff --git a/06/parser-gen/rockspecs/parser-gen-1.2.rockspec b/06/deps/parser-gen/rockspecs/parser-gen-1.2.rockspec similarity index 100% rename from 06/parser-gen/rockspecs/parser-gen-1.2.rockspec rename to 06/deps/parser-gen/rockspecs/parser-gen-1.2.rockspec diff --git a/06/parser-gen/stack.lua b/06/deps/parser-gen/stack.lua similarity index 95% rename from 06/parser-gen/stack.lua rename to 06/deps/parser-gen/stack.lua index 3367192..b2ca5bf 100644 --- a/06/parser-gen/stack.lua +++ b/06/deps/parser-gen/stack.lua @@ -1,7 +1,6 @@ -- Stack Table -- Uses a table as stack, use