Merge pull request #212 from loganchien/stop-mixed-syntax

Emit errors on mixed property syntax
This commit is contained in:
colincross 2018-06-25 21:25:59 -07:00 committed by GitHub
commit 9cbbb8b91d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -302,8 +302,10 @@ func (p *parser) parseProperty(isModule, compat bool) (property *Property) {
pos := p.scanner.Position
if isModule {
if compat && p.tok == ':' {
p.accept(':')
if compat {
if !p.accept(':') {
return
}
} else {
if !p.accept('=') {
return

View file

@ -33,7 +33,7 @@ foo {}
},
{
input: `
foo{name= "abc",num= 4,}
foo(name= "abc",num= 4,)
`,
output: `
foo {