Strip block comments when embedded scripts

This commit is contained in:
Jason Perkins 2012-02-13 15:21:28 -05:00
parent 309a76cb8a
commit 0b1fb89bc0

View File

@ -15,10 +15,13 @@
-- strip any CRs -- strip any CRs
s = s:gsub("[\r]", "") s = s:gsub("[\r]", "")
-- strip out comments
s = s:gsub("\n%-%-[^\n]*", "")
-- strip out block comments
s = s:gsub("%-%-%[%[.-%-%-%]%]", "")
-- strip out inline comments
s = s:gsub("\n%-%-[^\n]*", "")
-- escape backslashes -- escape backslashes
s = s:gsub("\\", "\\\\") s = s:gsub("\\", "\\\\")