djkrose / 7DTD-ScriptingMod

Adds scripting support and other useful functionality to 7 Days To Die dedicated server
19 stars 10 forks source link

Parsing of script metadata can be very slow or freeze when file has many comments #4

Closed djkrose closed 7 years ago

djkrose commented 7 years ago

Take a JavaScript file, add lots of comments in the form "// blaa" behind the metadata block. Can have a newline after the metadata, which should prevent parser from continuing.

Used regex approach is just too slow and complicated. Simplify with line-iterating approach.

djkrose commented 7 years ago

Parsing reimplemented.