commit ffb98de24e80c64f096e40a3b96ec35ee6543aff
parent bbc17ff57e61cee529d92f38864dfde648a50482
Author: Richard Ipsum <richardipsum@vx21.xyz>
Date: Sat, 18 Jan 2020 14:10:56 +0000
Don't lstrip implementation lines
Currently we lstrip the implementation lines, this is mostly fine,
but if you were embedding a script for a whitespace sensitive language
like python into your implementation then lstripping the lines could
break the script.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tyarn.lua.in b/tyarn.lua.in
@@ -1,6 +1,6 @@
#!/usr/bin/env ##LUA_INTERP##
--
--- Copyright © 2019 Richard Ipsum
+-- Copyright © 2019 - 2020 Richard Ipsum
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
@@ -49,7 +49,7 @@ function parse_implementations(filepath, implementations)
for line in file:lines() do
-- ignore lines that are not indented or blank
matched, matches = tyarn.re_match(line, "^( )+[^ \t\n\r\f\v]+")
- line = lstrip(line)
+ line = string.gsub(line, ' ', '', 1) -- strip first 4 spaces
if matched then
if string.find(line, "IMPLEMENTS GIVEN") then