Skip to content

Instantly share code, notes, and snippets.

@shivansh
Last active June 10, 2019 16:49
Show Gist options
  • Save shivansh/1567af5d80d91a326aec521264512359 to your computer and use it in GitHub Desktop.
Save shivansh/1567af5d80d91a326aec521264512359 to your computer and use it in GitHub Desktop.
Demo for buggy handling of comments in gocc
// Code generated by gocc; DO NOT EDIT.
package parser
type (
actionTable [numStates]actionRow
actionRow struct {
canRecover bool
actions [numSymbols]action
}
)
var actionTab = actionTable{
actionRow{ // S0
canRecover: false,
actions: [numSymbols]action{
nil, // INVALID
nil, // $
shift(2), // /*
nil, // test
nil, // */
},
},
actionRow{ // S1
canRecover: false,
actions: [numSymbols]action{
nil, // INVALID
accept(true), // $
nil, // /*
nil, // test
nil, // */
},
},
actionRow{ // S2
canRecover: false,
actions: [numSymbols]action{
nil, // INVALID
nil, // $
nil, // /*
shift(3), // test
nil, // */
},
},
actionRow{ // S3
canRecover: false,
actions: [numSymbols]action{
nil, // INVALID
nil, // $
nil, // /*
nil, // test
shift(4), // */
},
},
actionRow{ // S4
canRecover: false,
actions: [numSymbols]action{
nil, // INVALID
reduce(1), // $, reduce: MLComment
nil, // /*
nil, // test
nil, // */
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment