|
@@ -13,10 +13,6 @@ import { getInnerRange } from '../utils'
|
|
|
import { RENDER_LIST } from '../runtimeConstants'
|
|
import { RENDER_LIST } from '../runtimeConstants'
|
|
|
import { processExpression } from './transformExpression'
|
|
import { processExpression } from './transformExpression'
|
|
|
|
|
|
|
|
-const forAliasRE = /([\s\S]*?)(?:(?<=\))|\s+)(?:in|of)\s+([\s\S]*)/
|
|
|
|
|
-const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/
|
|
|
|
|
-const stripParensRE = /^\(|\)$/g
|
|
|
|
|
-
|
|
|
|
|
export const transformFor = createStructuralDirectiveTransform(
|
|
export const transformFor = createStructuralDirectiveTransform(
|
|
|
'for',
|
|
'for',
|
|
|
(node, dir, context) => {
|
|
(node, dir, context) => {
|
|
@@ -64,6 +60,10 @@ export const transformFor = createStructuralDirectiveTransform(
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/
|
|
|
|
|
+const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/
|
|
|
|
|
+const stripParensRE = /^\(|\)$/g
|
|
|
|
|
+
|
|
|
interface ForParseResult {
|
|
interface ForParseResult {
|
|
|
source: ExpressionNode
|
|
source: ExpressionNode
|
|
|
value: ExpressionNode | undefined
|
|
value: ExpressionNode | undefined
|