Update nex for go modules and fix linter (revive and staticcheck) issues#58
Open
stgarrity wants to merge 9 commits intoblynn:masterfrom
Open
Update nex for go modules and fix linter (revive and staticcheck) issues#58stgarrity wants to merge 9 commits intoblynn:masterfrom
nex for go modules and fix linter (revive and staticcheck) issues#58stgarrity wants to merge 9 commits intoblynn:masterfrom
Conversation
the diff of the old->new generated code is ``` $ diff temp_old temp_new 7a8,9 > > // Lexer is a generated lexer. 11c13 < ch_stop chan bool --- > chStop chan bool 19,25d20 < // The 'l' and 'c' fields were added for < // https://github.com/wagerlabs/docker/blob/65694e801a7b80930961d70c69cba9f2465459be/buildfile.nex < // Since then, I introduced the built-in Line() and Column() functions. < l, c int < < parseResult interface{} < 39,41c34,36 < yylex.ch_stop = make(chan bool, 1) < var scan func(in *bufio.Reader, ch chan frame, ch_stop chan bool, family []dfa, line, column int) < scan = func(in *bufio.Reader, ch chan frame, ch_stop chan bool, family []dfa, line, column int) { --- > yylex.chStop = make(chan bool, 1) > var scan func(in *bufio.Reader, ch chan frame, chStop chan bool, family []dfa, line, column int) > scan = func(in *bufio.Reader, ch chan frame, chStop chan bool, family []dfa, line, column int) { 64c59 < if -1 == st || mark[st] { break } --- > if st == -1 || mark[st] { break } 86c81 < if -1 == x[1] { continue } --- > if x[1] == -1 { continue } 98c93 < if -1 == x[1] || mark[x[1]] { break } --- > if x[1] == -1 || mark[x[1]] { break } 131c126 < case stopped = <- ch_stop: { --- > case stopped = <- chStop: { 138c133 < scan(bufio.NewReader(strings.NewReader(text)), ch, ch_stop, family[matchi].nest, line, column) --- > scan(bufio.NewReader(strings.NewReader(text)), ch, chStop, family[matchi].nest, line, column) 155c150 < go scan(bufio.NewReader(in), yylex.ch, yylex.ch_stop, dfas, 0, 0) --- > go scan(bufio.NewReader(in), yylex.ch, yylex.chStop, dfas, 0, 0) 192a188 > // NewLexer creates a new default Lexer. 197,198c193,195 < func (yyLex *Lexer) Stop() { < yyLex.ch_stop <- true --- > // Stop stops the lexer. > func (yylex *Lexer) Stop() { > yylex.chStop <- true ```
Collaborator
|
Heya, sorry for the delay in replying. I'm sorta maintaining this repo, I suppose, since the original author has kind of abandoned it, but I don't have many free (unsponsored) cycles at the moment. I'll try to get to this at some point, but no promises. Thanks for the patches! In particular if any of these patches fix any bugs, in particular, please let me know and I'll try and prioritize that. |
Author
|
all good, no rush -- these are all formatting changes to make it easier to use, no actual bugs :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was messing around with this testing something, and my IDE kept complaining about lint errors ... so rather than fix the output, I figured I'd patch and push it back in case useful to anyone else! Tests pass (I included a diff of the changes when I needed to update your checksum) and should be no functional change, but easier with standard tooling. Thanks for publishing this!