Merge pull request #212 from loganchien/stop-mixed-syntax
Emit errors on mixed property syntax
This commit is contained in:
commit
9cbbb8b91d
2 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -33,7 +33,7 @@ foo {}
|
|||
},
|
||||
{
|
||||
input: `
|
||||
foo{name= "abc",num= 4,}
|
||||
foo(name= "abc",num= 4,)
|
||||
`,
|
||||
output: `
|
||||
foo {
|
||||
|
|
Loading…
Reference in a new issue