Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
go-version: '1.26'

- name: Regenerate parser
run: |
Expand All @@ -31,5 +31,8 @@ jobs:
- name: Build
run: go build ./...

- name: Vet
run: go vet ./...

- name: Test
run: go test ./...
4 changes: 2 additions & 2 deletions ast/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func buildNoQuotesClause() string {
func buildMixedQuery(n int) string {
var b strings.Builder
b.WriteString("SELECT * FROM t1 WHERE ")
for i := 0; i < n; i++ {
for i := range n {
if i > 0 {
b.WriteString(" OR ")
}
Expand All @@ -310,7 +310,7 @@ func buildMixedQuery(n int) string {
func buildQuery(clause string, n int) string {
var b strings.Builder
b.WriteString("SELECT * FROM t1 WHERE ")
for i := 0; i < n; i++ {
for i := range n {
if i > 0 {
b.WriteString(" OR ")
}
Expand Down
2 changes: 1 addition & 1 deletion ast/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3993,7 +3993,7 @@ type HintTimeRange struct {
// will be parsed into a LeadingList like:
// Items = [HintTable("a"), LeadingList{[HintTable("b"), HintTable("c")]}, HintTable("d")]
type LeadingList struct {
Items []interface{}
Items []any
}

// HintSetVar is the payload of `SET_VAR` hint
Expand Down
2 changes: 1 addition & 1 deletion generate_keyword/genkeyword.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func main() {
}

section := sectionNone
for _, line := range strings.Split(string(parserData), "\n") {
for line := range strings.SplitSeq(string(parserData), "\n") {
if line == "" { // Empty line indicates section end
section = sectionNone
} else if strings.Contains(line, reservedKeywordStart) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/sqlc-dev/marino

go 1.25
go 1.26

require golang.org/x/text v0.19.0
2 changes: 1 addition & 1 deletion goyacc/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/sqlc-dev/marino/goyacc

go 1.25
go 1.26

require (
github.com/sqlc-dev/marino v0.0.0
Expand Down
6 changes: 3 additions & 3 deletions parser/consistent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ func extractMiddle(str, startMarker, endMarker string) string {
return ""
}
str = str[startIdx+len(startMarker):]
endIdx := strings.Index(str, endMarker)
if endIdx == -1 {
before, _, ok := strings.Cut(str, endMarker)
if !ok {
return ""
}
return str[:endIdx]
return before
}

func extractQuotedWords(strs []string) []string {
Expand Down
2 changes: 1 addition & 1 deletion parser/digester_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,6 @@ func BenchmarkDigestSprintf(b *testing.B) {
digest1 := genRandDigest("abc")
b.ResetTimer()
for i := 0; i < b.N; i++ {
fmt.Sprintf("%x", digest1)
_ = fmt.Sprintf("%x", digest1)
}
}
18 changes: 9 additions & 9 deletions parser/hintparser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,13 @@ func TestParseHint(t *testing.T) {
{
HintName: ast.NewCIStr("LEADING"),
HintData: &ast.LeadingList{
Items: []interface{}{
Items: []any{
&ast.HintTable{TableName: ast.NewCIStr("a")},
&ast.LeadingList{
Items: []interface{}{
Items: []any{
&ast.HintTable{TableName: ast.NewCIStr("b")},
&ast.LeadingList{
Items: []interface{}{
Items: []any{
&ast.HintTable{TableName: ast.NewCIStr("c")},
&ast.HintTable{TableName: ast.NewCIStr("d")},
},
Expand All @@ -404,7 +404,7 @@ func TestParseHint(t *testing.T) {
{
HintName: ast.NewCIStr("LEADING"),
HintData: &ast.LeadingList{
Items: []interface{}{
Items: []any{
&ast.HintTable{TableName: ast.NewCIStr("a")},
&ast.HintTable{TableName: ast.NewCIStr("b")},
&ast.HintTable{TableName: ast.NewCIStr("c")},
Expand All @@ -424,15 +424,15 @@ func TestParseHint(t *testing.T) {
{
HintName: ast.NewCIStr("LEADING"),
HintData: &ast.LeadingList{
Items: []interface{}{
Items: []any{
&ast.LeadingList{
Items: []interface{}{
Items: []any{
&ast.HintTable{TableName: ast.NewCIStr("a")},
&ast.HintTable{TableName: ast.NewCIStr("b")},
},
},
&ast.LeadingList{
Items: []interface{}{
Items: []any{
&ast.HintTable{TableName: ast.NewCIStr("c")},
&ast.HintTable{TableName: ast.NewCIStr("d")},
},
Expand All @@ -454,10 +454,10 @@ func TestParseHint(t *testing.T) {
{
HintName: ast.NewCIStr("LEADING"),
HintData: &ast.LeadingList{
Items: []interface{}{
Items: []any{
&ast.HintTable{TableName: ast.NewCIStr("x")},
&ast.LeadingList{
Items: []interface{}{
Items: []any{
&ast.HintTable{TableName: ast.NewCIStr("y")},
&ast.HintTable{TableName: ast.NewCIStr("z")},
},
Expand Down
2 changes: 1 addition & 1 deletion parser/parser.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion parser/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -6456,7 +6456,7 @@ Int64Num:
{
v, rangeErrMsg := getInt64FromNUM($1)
if len(rangeErrMsg) != 0 {
yylex.AppendError(yylex.Errorf(rangeErrMsg))
yylex.AppendError(yylex.Errorf("%s", rangeErrMsg))
return 1
}
$$ = v
Expand Down
Loading