summaryrefslogtreecommitdiff
path: root/headers.lua
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2024-07-19 23:55:23 +0200
committerAki <please@ignore.pl>2024-07-19 23:55:23 +0200
commit87c8a5e8955a57e6365adb4aa64575308b17c47d (patch)
tree96bac7ab83434cbd21dab9e58921e45c2cb7d830 /headers.lua
parentd6189e60851ff347c8c11812025232621f54096e (diff)
downloadheaders-87c8a5e8955a57e6365adb4aa64575308b17c47d.zip
headers-87c8a5e8955a57e6365adb4aa64575308b17c47d.tar.gz
headers-87c8a5e8955a57e6365adb4aa64575308b17c47d.tar.bz2
Use multiset-like data structure for storing headers
This looks like an overkill because it is one. The space and time complexity of the multiset structure is rather bad. At this point it stays mostly because of sunk cost fallacy. It will provide OK abstraction layer to build the rest of this forsaken project.
Diffstat (limited to 'headers.lua')
-rwxr-xr-xheaders.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/headers.lua b/headers.lua
index 972b360..8726615 100755
--- a/headers.lua
+++ b/headers.lua
@@ -5,13 +5,13 @@ Prints list of headers from a standard or available standards
<selection> (optional string) Standard to display headers for
]]
local dir = require "pl.dir"
-local parse = require "headers.parser"
+local parser = require "headers.parser".new()
local definitions = dir.getfiles(args.d, "*.lua")
for _, filename in pairs(definitions) do
local handle = io.open(filename)
local data = handle:read("a")
handle:close()
- if parse(data, args.selection) then
+ if parser:parse(data, args.selection) then
return -- interface is yet to be properly defined, this allows only for first-result queries
end
end