From d291bdadcad0a0e1d1d6308773ea19a9accf55ee Mon Sep 17 00:00:00 2001 From: Robert Krimen Date: Sat, 20 Oct 2012 13:45:17 -0700 Subject: [PATCH] Swap order of found/width in lexer.read return --- lexer.go | 4 ++-- lexer_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lexer.go b/lexer.go index 01bbf9a..23764fa 100644 --- a/lexer.go +++ b/lexer.go @@ -328,7 +328,7 @@ func convertHexadecimalRune(word string) rune { } func (self *_lexer) scanHexadecimalRune(size int) rune { - _, word, width, found := self.read(size) + _, word, found, width := self.read(size) chr := convertHexadecimalRune(word) if chr == utf8.RuneError { return chr @@ -545,7 +545,7 @@ func (self *_lexer) read(count int) ([]rune, string, int, int) { word = string(read[:found]) } - return read, word, width, found + return read, word, found, width } func (self *_lexer) next() rune { diff --git a/lexer_test.go b/lexer_test.go index 9f8e9f6..ae32fb3 100644 --- a/lexer_test.go +++ b/lexer_test.go @@ -32,12 +32,12 @@ func lexerCollectAndTest(input string, arguments... string){ } } -func testLexerRead(lexer *_lexer, count int, wantRead []rune, wantWord string, wantWidth, wantFound int) { - haveRead, haveWord, haveWidth, haveFound := lexer.read(count) +func testLexerRead(lexer *_lexer, count int, wantRead []rune, wantWord string, wantFound, wantWidth int) { + haveRead, haveWord, haveFound, haveWidth := lexer.read(count) Is(haveRead, wantRead) Is(haveWord, wantWord) - Is(haveWidth, wantWidth) Is(haveFound, wantFound) + Is(haveWidth, wantWidth) } func TestLexer(t *testing.T) {