diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-04-02 20:46:19 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-04-02 20:46:19 +0200 |
commit | e32f57c9c5968f0c09130f6e24e28a96d6e1393d (patch) | |
tree | 476d22407b719a74b18a849d83fb8464f9a042c4 /context/data/scite/context/lexers/scite-context-lexer.lua | |
parent | 30ea6ac75b1cf62ea8e17228c07d54824285acfa (diff) | |
download | context-e32f57c9c5968f0c09130f6e24e28a96d6e1393d.tar.gz |
2017-04-02 19:57:00
Diffstat (limited to 'context/data/scite/context/lexers/scite-context-lexer.lua')
-rw-r--r-- | context/data/scite/context/lexers/scite-context-lexer.lua | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/context/data/scite/context/lexers/scite-context-lexer.lua b/context/data/scite/context/lexers/scite-context-lexer.lua index 4d401ac7b..152a05777 100644 --- a/context/data/scite/context/lexers/scite-context-lexer.lua +++ b/context/data/scite/context/lexers/scite-context-lexer.lua @@ -1792,13 +1792,23 @@ lexers.inform = context.inform do - local floor = math and math.floor - local char = string.char + local floor = math and math.floor + local char = string.char + local format = format + local tonumber = tonumber if not floor then - floor = function(n) - return tonumber(format("%d",n)) + if tonumber(string.match(_VERSION,"%d%.%d")) < 5.3 then + floor = function(n) + return tonumber(format("%d",n)) + end + else + -- 5.3 has a mixed number system and format %d doesn't work with + -- floats any longer ... no fun + floor = function(n) + return (n - n % 1) + end end math = math or { } |