Correct for statement splitter

This commit is contained in:
nicco 2018-02-21 12:29:05 +01:00
parent a904940d8c
commit 5406862127

View File

@ -133,9 +133,12 @@ export const loop: ActionFunction = (html, options, re) => {
throw new Error(error.parse.default) throw new Error(error.parse.default)
// Extract variable name from the if statemtent // Extract variable name from the if statemtent
const statement = current.found[0].slice(re.begin.length + re.if.length, -re.ending.length).trim().split(re.for_in) const statement = current.found[0]
current.variable = statement[0].trim() .slice(re.begin.length + re.if.length, -re.ending.length).trim()
current.arr = statement[1].trim() .split(new RegExp(` +${re.for_in} +`, 'g'))
current.variable = statement[0]
current.arr = statement[1]
let next let next
do { do {