Do not match strings across newlines

This commit is contained in:
L.J. Hill
2016-09-21 15:10:43 -04:00
parent 9caae856c4
commit bc4da247b5

View File

@ -95,9 +95,9 @@ class UnityTestRunnerGenerator
tests_and_line_numbers = []
source_scrubbed = source.clone
source_scrubbed = source_scrubbed.gsub(/"[^"\n]*"/, '') # remove things in strings
source_scrubbed = source_scrubbed.gsub(/\/\/.*$/, '') # remove line comments
source_scrubbed = source_scrubbed.gsub(/\/\*.*?\*\//m, '') # remove block comments
source_scrubbed = source_scrubbed.gsub(/"[^"]*"/, '') # remove things in strings
lines = source_scrubbed.split(/(^\s*\#.*$) # Treat preprocessor directives as a logical line
| (;|\{|\}) /x) # Match ;, {, and } as end of lines