-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24b6fb9
commit 1e0a0fb
Showing
7 changed files
with
345 additions
and
415 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
local utils = require'utils' | ||
|
||
local pattern_trkey | ||
do | ||
local peg = utils.peg | ||
local C = peg.C | ||
local P = peg.P | ||
local Ct = peg.Ct | ||
local After = peg.After | ||
|
||
pattern_trkey_def = Ct(After( | ||
P' TR_KV' * P'_FMT'^-1 * '(' * C(peg.word) | ||
)^0) | ||
|
||
pattern_trkey = Ct(After( | ||
P'trkeys::' * C(peg.word) | ||
)^0) | ||
end | ||
|
||
local trkeys_path = 'src/utils/trkeys.hpp' | ||
|
||
local match_and_setk = utils.match_and_setk | ||
|
||
local keys | ||
|
||
function init(args) | ||
keys = match_and_setk(pattern_trkey_def, utils.readall(trkeys_path), false) | ||
end | ||
|
||
function file(content) | ||
match_and_setk(pattern_trkey, content, true, keys) | ||
end | ||
|
||
function terminate() | ||
return utils.count_error(keys, "trkeys::%s not used") | ||
end | ||
|
||
return {init=init, file=file, terminate=terminate} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.