Skip to content

Commit

Permalink
Fixed LexLPeg lexer to handle uninitialized numeric properties (#701).
Browse files Browse the repository at this point in the history
  • Loading branch information
pkulchenko committed Oct 13, 2016
1 parent 8480493 commit 3cc3d21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lualibs/lexers/lexer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ function M.load(name, alt_name)
if not M.property then
M.property, M.property_int = {}, setmetatable({}, {
__index = function(t, k)
return tostring(tonumber(M.property[k]) or 0)
return tonumber(M.property[k]) or 0
end,
__newindex = function() error('read-only property') end
})
Expand Down

0 comments on commit 3cc3d21

Please sign in to comment.