Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Commit d27b3d3

Browse files
Rename readScopedIdent to readIdentList
Signed-off-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
1 parent 202d256 commit d27b3d3

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

sql/parse/util.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,14 +262,14 @@ func readIdent(ident *string) parseFunc {
262262
}
263263
}
264264

265-
// Reads a scoped identifier, populating the specified slice with the different
266-
// parts of the identifier if it is correctly formed.
265+
// readIdentList reads a scoped identifier, populating the specified slice
266+
// with the different parts of the identifier if it is correctly formed.
267267
// A scoped identifier is a sequence of identifiers separated by the specified
268268
// rune in separator. An identifier is a string of runes whose first character
269269
// is a letter and the following ones are either letters, digits or underscores.
270270
// An example of a correctly formed scoped identifier is "dbName.tableName",
271271
// that would populate the slice with the values ["dbName", "tableName"]
272-
func readScopedIdent(separator rune, idents *[]string) parseFunc {
272+
func readIdentList(separator rune, idents *[]string) parseFunc {
273273
return func(r *bufio.Reader) error {
274274
var buf bytes.Buffer
275275
if err := readLetter(r, &buf); err != nil {

sql/parse/util_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ func TestReadValidScopedIdentRune(t *testing.T) {
150150
}
151151
}
152152

153-
// Tests that readScopedIdent reads a list of identifiers separated by a user-
153+
// Tests that readIdentList reads a list of identifiers separated by a user-
154154
// specified rune, populating the passed slice with the identifiers found.
155-
func TestReadScopedIdent(t *testing.T) {
155+
func TestReadIdentList(t *testing.T) {
156156
require := require.New(t)
157157

158158
testFixtures := []struct {
@@ -203,7 +203,7 @@ func TestReadScopedIdent(t *testing.T) {
203203
reader := bufio.NewReader(strings.NewReader(fixture.string))
204204
var actualIdents []string
205205

206-
err := readScopedIdent(fixture.separator, &actualIdents)(reader)
206+
err := readIdentList(fixture.separator, &actualIdents)(reader)
207207
require.NoError(err)
208208

209209
remaining, _ := reader.ReadString('\n')

sql/parse/views.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func parseCreateView(ctx *sql.Context, s string) (sql.Node, error) {
3535
skipSpaces,
3636
expect("view"),
3737
skipSpaces,
38-
readScopedIdent('.', &scopedName),
38+
readIdentList('.', &scopedName),
3939
skipSpaces,
4040
maybeList('(', ',', ')', &columns),
4141
skipSpaces,

0 commit comments

Comments
 (0)