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 pos := p.scanner.Position
if isModule { if isModule {
if compat && p.tok == ':' { if compat {
p.accept(':') if !p.accept(':') {
return
}
} else { } else {
if !p.accept('=') { if !p.accept('=') {
return return

View file

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