From e43e056e48f2a46af0aa0a80a3f9931bccd08b8a Mon Sep 17 00:00:00 2001 From: Felix Hanley Date: Thu, 24 Oct 2019 15:01:50 +1300 Subject: Fix package name --- generator.go | 2 +- generator_test.go | 2 +- lexer.go | 24 ++++++++++++------------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/generator.go b/generator.go index 226b78a..a96a451 100644 --- a/generator.go +++ b/generator.go @@ -1,4 +1,4 @@ -package brechars +package bechars import ( "fmt" diff --git a/generator_test.go b/generator_test.go index 1bf9373..afbee71 100644 --- a/generator_test.go +++ b/generator_test.go @@ -1,4 +1,4 @@ -package brechars +package bechars import ( "testing" diff --git a/lexer.go b/lexer.go index a8383a9..db828bb 100644 --- a/lexer.go +++ b/lexer.go @@ -1,4 +1,4 @@ -package brechars +package bechars import ( "src.userspace.com.au/felix/lexer" @@ -23,11 +23,11 @@ func startState(l *lexer.Lexer) lexer.StateFunc { return l.Error("expecting [") } l.Emit(tBREStart) - return breFirstState + return beFirstState } // Handle the first characters of the BRE. -func breFirstState(l *lexer.Lexer) lexer.StateFunc { +func beFirstState(l *lexer.Lexer) lexer.StateFunc { switch l.Next() { case '^': l.Emit(tNot) @@ -35,7 +35,7 @@ func breFirstState(l *lexer.Lexer) lexer.StateFunc { if l.Accept("-]") { l.Emit(tCharacter) } - return breState + return beState case ']': // Check for empty BRE if l.Peek() == lexer.EOFRune { @@ -43,17 +43,17 @@ func breFirstState(l *lexer.Lexer) lexer.StateFunc { return nil } l.Emit(tCharacter) - return breState + return beState case '-': l.Emit(tCharacter) - return breState + return beState default: l.Backup() - return breState + return beState } } -func breState(l *lexer.Lexer) lexer.StateFunc { +func beState(l *lexer.Lexer) lexer.StateFunc { switch r := l.Next(); { case r == ']': l.Emit(tBREEnd) @@ -67,7 +67,7 @@ func breState(l *lexer.Lexer) lexer.StateFunc { return unicodeState } l.Emit(tCharacter) - return breState + return beState case r == lexer.EOFRune: return l.Error("parse error, unexpected EOF") default: @@ -83,7 +83,7 @@ func breState(l *lexer.Lexer) lexer.StateFunc { } else { l.Emit(tCharacter) } - return breState + return beState } } @@ -94,7 +94,7 @@ func classState(l *lexer.Lexer) lexer.StateFunc { return l.Error("parse error, expecting ':'") } l.Emit(tClass) - return breState + return beState } func unicodeState(l *lexer.Lexer) lexer.StateFunc { @@ -102,5 +102,5 @@ func unicodeState(l *lexer.Lexer) lexer.StateFunc { if n := l.AcceptRun("0123456789abcdef"); n > 0 { l.Emit(tCharacter) } - return breState + return beState } -- cgit v1.2.3