feat(compiler-core): add parser transform for v-for directive (#65)

* feat(compiler-core): add parser transform for v-for directive

* fix: Include source location for expressions

* chore: remove comment

* refactor(compiler-core): extract hepler functions to utils
This commit is contained in:
Rahul Kadyan
2019-09-19 22:53:49 +05:30
committed by Evan You
parent bbb57c26a2
commit 10c1a2b332
7 changed files with 751 additions and 21 deletions

View File

@@ -59,7 +59,9 @@ export const enum ErrorCodes {
// transform errors
X_ELSE_IF_NO_ADJACENT_IF,
X_ELSE_NO_ADJACENT_IF
X_ELSE_NO_ADJACENT_IF,
X_FOR_NO_EXPRESSION,
X_FOR_MALFORMED_EXPRESSION
}
export const errorMessages: { [code: number]: string } = {
@@ -116,5 +118,7 @@ export const errorMessages: { [code: number]: string } = {
// transform errors
[ErrorCodes.X_ELSE_IF_NO_ADJACENT_IF]: `v-else-if has no adjacent v-if`,
[ErrorCodes.X_ELSE_NO_ADJACENT_IF]: `v-else has no adjacent v-if`
[ErrorCodes.X_ELSE_NO_ADJACENT_IF]: `v-else has no adjacent v-if`,
[ErrorCodes.X_FOR_NO_EXPRESSION]: `v-for has no expression`,
[ErrorCodes.X_FOR_MALFORMED_EXPRESSION]: `v-for has invalid expression`
}