diff options
Diffstat (limited to 'read.lua')
-rw-r--r-- | read.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/read.lua b/read.lua index 666f509..658ad7d 100644 --- a/read.lua +++ b/read.lua | |||
@@ -4,7 +4,8 @@ local m = {} | |||
4 | local type = require("type") | 4 | local type = require("type") |
5 | local eof, input_port = type.eof, type.input_port | 5 | local eof, input_port = type.eof, type.input_port |
6 | local util = require("util") | 6 | local util = require("util") |
7 | local constantly, error, pop = util.constantly, util.error, util.pop | 7 | local error, pop = util.error, util.pop |
8 | local utf8_char = require("utf8").char | ||
8 | 9 | ||
9 | local token_separators = "[%s#()\"'`,@;]" | 10 | local token_separators = "[%s#()\"'`,@;]" |
10 | 11 | ||
@@ -127,7 +128,7 @@ local function consume_string_hexvalue (cs) | |||
127 | table.insert(u8ch, c) | 128 | table.insert(u8ch, c) |
128 | until c == ";" | 129 | until c == ";" |
129 | table.remove(u8ch) -- discard ';' | 130 | table.remove(u8ch) -- discard ';' |
130 | return utf8.char(tonumber(table.concat(u8ch), 16)), cs | 131 | return utf8_char(tonumber(table.concat(u8ch), 16)), cs |
131 | end | 132 | end |
132 | 133 | ||
133 | local function consume_string (cs) | 134 | local function consume_string (cs) |
@@ -258,7 +259,7 @@ m.readmacros = { | |||
258 | table.insert(Q, m.read(port)) | 259 | table.insert(Q, m.read(port)) |
259 | return type.list(Q) | 260 | return type.list(Q) |
260 | end, | 261 | end, |
261 | comment = constantly(nil), -- throw comments away | 262 | comment = function (_,_,_) return nil end, |
262 | } | 263 | } |
263 | 264 | ||
264 | ---[[ READ ]]--- | 265 | ---[[ READ ]]--- |