Skip to content

Commit 73f54ef

Browse files
committed
Correct copyright information and consolidate it into COPYING
1 parent e5c45eb commit 73f54ef

9 files changed

Lines changed: 41 additions & 52 deletions

File tree

COPYING

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
Copyright © 2011 Ben "ToxicFrog" Kelly
1+
Copyright © 2011-2020 Rebecca "ToxicFrog" Kelly
22
FP module copyright © 2008 Peter "Corsix" Cawley
33

44
Permission is hereby granted, free of charge, to any person obtaining a copy of
55
this software and associated documentation files (the "Software"), to deal in
66
the Software without restriction, including without limitation the rights to
77
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
88
the Software, and to permit persons to whom the Software is furnished to do so,
9-
subject to the following conditions:
9+
subject to the following conditions:
1010

1111
The above copyright notice and this permission notice shall be included in all
1212
copies or substantial portions of the Software.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ The converse of `writebits`. Each call to `bit()` returns the next bit, MSB firs
620620

621621
## 8. Credits ##
622622

623-
While most of the library code was written by me (Ben Kelly), the existence of this library owes itself to many others.
623+
While most of the library code was written by me (Bex Kelly), the existence of this library owes itself to many others.
624624

625625
* The original inspiration came from Roberto Ierusalimschy's "struct" library and Luiz Henrique de Figueiredo's "lpack" library, as well as the "struct" available in Python.
626626
* The floating point code was contributed by Peter Cawley ("corsix") on lua-l, as was support for Lua 5.2.

ast.lua

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
-- See ast/*.lua for the implementations of various node types in the AST,
77
-- and see lexer.lua for the implementation of the lexer.
88

9-
-- Copyright (c) 2011 Ben "ToxicFrog" Kelly
10-
119
local vstruct = require "vstruct"
1210
local lexer = require "vstruct.lexer"
1311

@@ -28,11 +26,11 @@ end
2826
function ast.parse(source)
2927
local lex = lexer(source)
3028
local root = ast.List()
31-
29+
3230
for node in (function() return ast.next(lex) end) do
3331
root:append(node)
3432
end
35-
33+
3634
return ast.Root(root)
3735
end
3836

@@ -55,7 +53,7 @@ end
5553
function ast.raw_io(lex)
5654
local name = lex.next().text
5755
local next = lex.peek()
58-
56+
5957
if next and next.type == "number" and not lex.whitespace() then
6058
return ast.IO(name, lex.next().text)
6159
else
@@ -66,7 +64,7 @@ end
6664
function ast.key(lex)
6765
local name = lex.next().text
6866
local next = lex.peek()
69-
67+
7068
if next.type == "io" then
7169
local io = ast.raw_io(lex)
7270
if not io.hasvalue then
@@ -82,35 +80,35 @@ end
8280

8381
function ast.next(lex)
8482
local tok = lex.peek()
85-
83+
8684
if tok.type == "EOF" then
8785
return nil
8886
end
89-
87+
9088
if tok.type == '(' then
9189
return ast.group(lex)
92-
90+
9391
elseif tok.type == '{' then
9492
return ast.table(lex)
95-
93+
9694
elseif tok.type == '[' then
9795
return ast.bitpack(lex)
98-
96+
9997
elseif tok.type == "io" then
10098
return ast.io(lex)
101-
99+
102100
elseif tok.type == "key" then
103101
return ast.key(lex)
104-
102+
105103
elseif tok.type == "number" then
106104
return ast.repetition(lex)
107-
105+
108106
elseif tok.type == "control" then
109107
return ast.control(lex)
110108

111109
elseif tok.type == "splice" then
112110
return ast.splice(lex)
113-
111+
114112
else
115113
ast.error(lex, "'(', '{', '[', name, number, control, or io specifier")
116114
end
@@ -123,11 +121,11 @@ function ast.next_until(lex, type)
123121
if tok.type == 'EOF' then
124122
ast.error(lex, type)
125123
end
126-
124+
127125
if tok.type == type then
128126
return nil
129127
end
130-
128+
131129
return ast.next(lex)
132130
end
133131
end
@@ -152,14 +150,14 @@ end
152150

153151
function ast.group(lex)
154152
ast.require(lex, '(')
155-
153+
156154
local group = ast.List()
157155
group.tag = "group"
158-
156+
159157
for next in ast.next_until(lex, ')') do
160158
group:append(next)
161159
end
162-
160+
163161
ast.require(lex, ')')
164162
return group
165163
end
@@ -170,40 +168,40 @@ end
170168

171169
function ast.raw_table(lex)
172170
ast.require(lex, '{')
173-
171+
174172
local group = ast.Table()
175-
173+
176174
for next in ast.next_until(lex, '}') do
177175
group:append(next)
178176
end
179-
177+
180178
ast.require(lex, '}')
181179
return group
182180
end
183181

184182
function ast.bitpack(lex)
185183
ast.require(lex, "[")
186-
184+
187185
local bitpack = ast.Bitpack(tonumber(ast.require(lex, "number").text))
188-
186+
189187
ast.require(lex, "|")
190-
188+
191189
for next in ast.next_until(lex, ']') do
192190
bitpack:append(next)
193191
end
194-
192+
195193
ast.require(lex, "]")
196194
bitpack:finalize()
197195
return bitpack
198196
end
199197

200198
function ast.require(lex, type)
201199
local t = lex.next()
202-
200+
203201
if t.type ~= type then
204202
ast.error(lex, type)
205203
end
206-
204+
207205
return t
208206
end
209207

cursor.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
-- exports: seek read write
33
-- read only supports numeric amounts
44

5-
-- Copyright (c) 2011 Ben "ToxicFrog" Kelly; see COPYING
6-
75
local cursor = {}
86

97
-- like fseek

init.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
-- vstruct, the versatile struct library
22

3-
-- Copyright (C) 2011 Ben "ToxicFrog" Kelly; see COPYING
4-
53
local vstruct = {}
64
package.loaded.vstruct = vstruct
75

io.lua

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
-- upon which it will attempt to load the handler for that operation from the
77
-- module vstruct.io.<type> and call it.
88

9-
-- Copyright (c) 2011 Ben "ToxicFrog" Kelly
10-
119
local defaults = require "vstruct.io.defaults"
1210
local mt = { __index = defaults }
1311

@@ -19,8 +17,8 @@ local function iorequire(format)
1917
end
2018

2119
setmetatable(v, mt)
22-
23-
return v
20+
21+
return v
2422
end
2523

2624
local controlnames = {
@@ -38,8 +36,8 @@ end
3836

3937
return function(format, method, ...)
4038
local fmt = iorequire(format)
41-
39+
4240
assert(fmt[method], "No support for method '"..tostring(method).."' in IO module '"..format.."'")
43-
41+
4442
return fmt[method](...)
4543
end

lexer.lua

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
-- Returns a function which, given a source string, returns a table of lexer
33
-- operations closed over that source.
44

5-
-- Copyright (c) 2011 Ben "ToxicFrog" Kelly
6-
75
local lexis = {}
86

97
local function lexeme(name)
@@ -32,7 +30,7 @@ return function(source)
3230
local orig = source
3331
local index = 1
3432
local hadwhitespace = false
35-
33+
3634
local function where()
3735
return ("character %d ('%s')"):format(index, source:sub(1,4))
3836
end
@@ -50,7 +48,7 @@ return function(source)
5048
local function aux()
5149
if #source == 0 then return end
5250
local match,size = find_match()
53-
51+
5452
if not match.name then
5553
hadwhitespace = true
5654
source = source:sub(size+1, -1)
@@ -65,7 +63,7 @@ return function(source)
6563
local function whitespace()
6664
return hadwhitespace
6765
end
68-
66+
6967
local function next()
7068
eat_whitespace()
7169

test/basic.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
-- "basic" test module for vstruct
2-
-- does not test floating point operations - see test/fp-*endian.lua for those
3-
-- Copyright (c) 2011 Ben "ToxicFrog" Kelly; see COPYING
2+
-- Tests a variety of non-floating-point usage.
3+
-- Does not test floating point operations - see test/fp-*endian.lua for those,
4+
-- since there are quite a lot of them.
45

56
local vstruct = require "vstruct"
67
local test = require "vstruct.test.common"

test/compat1x.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
-- "basic" test module for vstruct
2-
-- does not test floating point operations - see test/fp-*endian.lua for those
3-
-- Copyright (c) 2011 Ben "ToxicFrog" Kelly; see COPYING
1+
-- Tests for format compability with vstruct 1.x
42

53
local vstruct = require "vstruct"
64
local test = require "vstruct.test.common"

0 commit comments

Comments
 (0)