Skip to content

Commit f8a0c48

Browse files
committed
parser strict match priority
1 parent 9030139 commit f8a0c48

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

data/core/core.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
VERSION='0.8'
2+
print(PLATFORM)
23
conf = require "config"
34
local iface = require "iface"
45
local utf = require "utf"

data/stead3/parser/mp.lua

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,9 +1849,20 @@ if false then
18491849
-- end
18501850
end
18511851
]]--
1852-
hints = lev_sort(hints)
1853-
unknown = lev_sort(unknown)
1854-
multi = lev_sort(multi)
1852+
if #matches > 0 and #unknown > 0 and
1853+
not matches[1].extra and
1854+
matches[1].skip == 0 and
1855+
not matches[1].vargs then
1856+
hints = {}
1857+
unknown = {}
1858+
multi = {}
1859+
matches = { matches[1] }
1860+
else
1861+
hints = lev_sort(hints)
1862+
unknown = lev_sort(unknown)
1863+
multi = lev_sort(multi)
1864+
end
1865+
18551866
if #hints > 0 and #unknown > 0 then
18561867
if hints.lev > unknown.lev then
18571868
unknown = {}

0 commit comments

Comments
 (0)