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

sortEvents missing a return when comparing AnyOf and UnicodeClass #10

Merged
merged 1 commit into from
Feb 25, 2021

Conversation

paulsamways
Copy link
Contributor

Hi,

This MR addresses the following panic encountered when using the below grammar.

panic: Missing return

goroutine 1 [running]:
github.com/goccmack/gogll/lex/items/event.sortEvents.func1(0xa, 0x9, 0x609200)
        /home/paul/src/github.com/goccmack/gogll/lex/items/event/event.go:249 +0x66f
sort.insertionSort_func(0xc0001c7ac8, 0xc0001e13e0, 0x0, 0xb)
        /home/paul/.opt/go/src/sort/zfuncversion.go:12 +0xab
sort.quickSort_func(0xc0001c7ac8, 0xc0001e13e0, 0x0, 0xb, 0x8)
        /home/paul/.opt/go/src/sort/zfuncversion.go:158 +0x1f6
sort.Slice(0x5ef2e0, 0xc00000c9c0, 0xc0001c7ac8)
        /home/paul/.opt/go/src/sort/slice.go:20 +0xe8
github.com/goccmack/gogll/lex/items/event.sortEvents(0xc00014c300, 0xb, 0x10)
        /home/paul/src/github.com/goccmack/gogll/lex/items/event/event.go:182 +0xa5
github.com/goccmack/gogll/lex/items/event.GetOrdered(0xc0000622a0, 0xb, 0xb, 0xb, 0x8, 0xc00000f0f0)
        /home/paul/src/github.com/goccmack/gogll/lex/items/event/event.go:70 +0x30d
github.com/goccmack/gogll/lex/items.(*Set).nextSets(0xc00012ae00, 0x0, 0x0, 0x0)
        /home/paul/src/github.com/goccmack/gogll/lex/items/items.go:174 +0x67
github.com/goccmack/gogll/lex/items.New(0xc00006c280, 0xc00000c5e8)
        /home/paul/src/github.com/goccmack/gogll/lex/items/items.go:65 +0x24c
main.main()
        /home/paul/src/github.com/goccmack/gogll/main.go:84 +0x21c
package "github.com/goccmack/gogll/temp"

Block
    : Statement
    | Statement ";" Block
    | empty
    ;

identifier : < letter | '_' > { < letter | number | '_' > } ;
integer_lit : [ '-' ] ( (any "123456789") { (any "0123456789") } | '0' ) ;

Statement : PrintStmt
          | AssignmentStmt
          ;

PrintStmt : "print" "(" integer_lit ")" ;
AssignmentStmt : identifier "=" integer_lit ;

@paulsamways paulsamways changed the title sortEvents was missing a return when comparing AnyOf and UnicodeClass sortEvents missing a return when comparing AnyOf and UnicodeClass Feb 25, 2021
@goccmack goccmack merged commit 44bb6b4 into goccmack:master Feb 25, 2021
@goccmack
Copy link
Owner

@paulsamways
Thank you for fixing that.

@paulsamways paulsamways deleted the fix-missing-return branch February 25, 2021 21:04
@paulsamways paulsamways mentioned this pull request Mar 24, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants