Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GoRazor panic on a strange case #7

Closed
Wuvist opened this issue May 16, 2014 · 5 comments
Closed

GoRazor panic on a strange case #7

Wuvist opened this issue May 16, 2014 · 5 comments

Comments

@Wuvist
Copy link
Member

Wuvist commented May 16, 2014

case reference: https://gist.github.com/Wuvist/7f22c2f3e2348e7b8479

Panic out put

panic: UNMATCHED!

goroutine 16 [running]:
runtime.panic(0x121f80, 0x2082d8460)
    /usr/local/go/src/pkg/runtime/panic.c:279 +0xf5
github.com/sipin/gorazor/gorazor.(*Parser).handleMKP(0x208398320, 0x2083702ac, 0x6, 0x197e90, 0xe, 0x11, 0xe, 0x1)
    /Users/wuvist/Dropbox/sipin/zfw_code/src/github.com/sipin/gorazor/gorazor/parser.go:354 +0x800
github.com/sipin/gorazor/gorazor.(*Parser).Run(0x208398320, 0x0, 0x0)
    /Users/wuvist/Dropbox/sipin/zfw_code/src/github.com/sipin/gorazor/gorazor/parser.go:541 +0x272
github.com/sipin/gorazor/gorazor.run(0x7fff5fbffb08, 0x3a, 0x2082e4c30, 0x0, 0x0, 0x0)
    /Users/wuvist/Dropbox/sipin/zfw_code/src/github.com/sipin/gorazor/gorazor/gogen.go:330 +0x620
github.com/sipin/gorazor/gorazor.Generate(0x7fff5fbffb08, 0x3a, 0x2082e4c30, 0x0, 0x0, 0x0, 0x0)
    /Users/wuvist/Dropbox/sipin/zfw_code/src/github.com/sipin/gorazor/gorazor/gogen.go:356 +0x64
github.com/sipin/gorazor/gorazor.GenFile(0x7fff5fbffb08, 0x3a, 0x7fff5fbffb43, 0x3a, 0x2082e4c30, 0x0, 0x0)
    /Users/wuvist/Dropbox/sipin/zfw_code/src/github.com/sipin/gorazor/gorazor/gogen.go:383 +0x502
main.main()
    /Users/wuvist/Dropbox/sipin/zfw_code/src/github.com/sipin/gorazor/gorazor.go:44 +0x637

goroutine 17 [runnable]:
runtime.MHeap_Scavenger()
    /usr/local/go/src/pkg/runtime/mheap.c:507
runtime.goexit()
    /usr/local/go/src/pkg/runtime/proc.c:1430

goroutine 18 [runnable]:
bgsweep()
    /usr/local/go/src/pkg/runtime/mgc0.c:1960
runtime.goexit()
    /usr/local/go/src/pkg/runtime/proc.c:1430

goroutine 19 [runnable]:
runfinq()
    /usr/local/go/src/pkg/runtime/mgc0.c:2586
runtime.goexit()
    /usr/local/go/src/pkg/runtime/proc.c:1430
@Wuvist
Copy link
Member Author

Wuvist commented May 16, 2014

Looks like gorazor is checking if html tag is closed?

@chenyukang
Copy link
Member

@Wuvist
Yes, I have a check on tag,
like this:

        opener := parser.ast.closest(MKP, tagName)
        if opener.TagName != tagName { //unmatched
            panic("UNMATCHED!")
        } else {
            parser.ast = opener
        }

Should we give a warning message about this, and let it go?
or treat this as a fatal error and exit?

@Wuvist
Copy link
Member Author

Wuvist commented May 22, 2014

I think we could just remove this check?

@chenyukang
Copy link
Member

I will just report a warning message with the position like this

UNMATCHED tag close: div at line: 14 pos: 1

@Wuvist
Copy link
Member Author

Wuvist commented May 22, 2014

sure.

@Wuvist Wuvist closed this as completed May 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants