vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.75k stars 594 forks source link

Fix vue's yaml grammar single/double quote #35

Closed octref closed 7 years ago

octref commented 7 years ago

lang="jade' is still valid in the current vue.yaml grammar.

@stealthybox if you still want to give it a try.

stealthybox commented 7 years ago

Looks like the grammar has just been changed. This is going to take me some time to test properly.

octref commented 7 years ago

The new grammar is not complete yet, but the basic idea is, you have a mega syntax that just checks for these:

<template></template>
<template lang="pug"></template>
<template lang='pug'></template>
<style></style>
<style lang="scss" scoped></style>

you get the point. These grammars are easy to scan through (by your eye or the regex engine), so they are easy to fix and fast to parse.

I think something like ("jade"|'jade'|"pug"|'pug') would be good enough.

The unfinished part in Vue's SFC spec is tracked here: https://github.com/octref/vetur/issues/36

stealthybox commented 7 years ago

posted a comment to #36

octref commented 7 years ago

Since I have to do a lot of edit to the grammar I fixed it by myself. Next time if you see a problem in the grammar and want to fix it by yourself, go ahead and send a PR! Thanks again.