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
|
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
|
||||||
|
|
|
@ -33,7 +33,7 @@ foo {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: `
|
input: `
|
||||||
foo{name= "abc",num= 4,}
|
foo(name= "abc",num= 4,)
|
||||||
`,
|
`,
|
||||||
output: `
|
output: `
|
||||||
foo {
|
foo {
|
||||||
|
|
Loading…
Reference in a new issue