~mna/snow

cc132d1030e08fa095a9023db336060adeccf4ca — Martin Angers 1 year, 10 months ago df65a35
pkg: move packages down one level
158 files changed, 35 insertions(+), 30 deletions(-)

M .golangci.toml
M cmd/snowc/main.go
R pkg/{compiler/ast/ast.go => ast/ast.go}
R pkg/{compiler/ast/visitor.go => ast/visitor.go}
R pkg/{compiler/codegen/codegen.go => codegen/codegen.go}
R pkg/{compiler/codegen/codegen_test.go => codegen/codegen_test.go}
R pkg/{compiler/codegen/testdata/.gitignore => codegen/testdata/.gitignore}
R pkg/{compiler/codegen/testdata/fn.snow => codegen/testdata/fn.snow}
R pkg/{compiler/codegen/testdata/fn.snow.want => codegen/testdata/fn.snow.want}
R pkg/{compiler/codegen/testdata/fn_call.snow => codegen/testdata/fn_call.snow}
R pkg/{compiler/codegen/testdata/fn_call.snow.want => codegen/testdata/fn_call.snow.want}
R pkg/{compiler/codegen/testdata/let.snow => codegen/testdata/let.snow}
R pkg/{compiler/codegen/testdata/let.snow.want => codegen/testdata/let.snow.want}
R pkg/{compiler/codegen/testdata/var.snow => codegen/testdata/var.snow}
R pkg/{compiler/codegen/testdata/var.snow.want => codegen/testdata/var.snow.want}
R pkg/{compiler/parser/parser.go => parser/parser.go}
R pkg/{compiler/parser/parser_test.go => parser/parser_test.go}
R pkg/{compiler/parser/testdata/comment.snow => parser/testdata/comment.snow}
R pkg/{compiler/parser/testdata/comment.snow.err => parser/testdata/comment.snow.err}
R pkg/{compiler/parser/testdata/comment.snow.want => parser/testdata/comment.snow.want}
R pkg/{compiler/parser/testdata/comments.snow => parser/testdata/comments.snow}
R pkg/{compiler/parser/testdata/comments.snow.err => parser/testdata/comments.snow.err}
R pkg/{compiler/parser/testdata/comments.snow.want => parser/testdata/comments.snow.want}
R pkg/{compiler/parser/testdata/empty.snow => parser/testdata/empty.snow}
R pkg/{compiler/parser/testdata/empty.snow.err => parser/testdata/empty.snow.err}
R pkg/{compiler/parser/testdata/empty.snow.want => parser/testdata/empty.snow.want}
R pkg/{compiler/parser/testdata/fn.snow => parser/testdata/fn.snow}
R pkg/{compiler/parser/testdata/fn.snow.err => parser/testdata/fn.snow.err}
R pkg/{compiler/parser/testdata/fn.snow.want => parser/testdata/fn.snow.want}
R pkg/{compiler/parser/testdata/fn_add.snow => parser/testdata/fn_add.snow}
R pkg/{compiler/parser/testdata/fn_add.snow.err => parser/testdata/fn_add.snow.err}
R pkg/{compiler/parser/testdata/fn_add.snow.want => parser/testdata/fn_add.snow.want}
R pkg/{compiler/parser/testdata/fn_arg_unclosed_paren.snow => parser/testdata/fn_arg_unclosed_paren.snow}
R pkg/{compiler/parser/testdata/fn_arg_unclosed_paren.snow.err => parser/testdata/fn_arg_unclosed_paren.snow.err}
R pkg/{compiler/parser/testdata/fn_arg_unclosed_paren.snow.want => parser/testdata/fn_arg_unclosed_paren.snow.want}
R pkg/{compiler/parser/testdata/fn_arg_unclosed_paren2.snow => parser/testdata/fn_arg_unclosed_paren2.snow}
R pkg/{compiler/parser/testdata/fn_arg_unclosed_paren2.snow.err => parser/testdata/fn_arg_unclosed_paren2.snow.err}
R pkg/{compiler/parser/testdata/fn_arg_unclosed_paren2.snow.want => parser/testdata/fn_arg_unclosed_paren2.snow.want}
R pkg/{compiler/parser/testdata/fn_arg_unclosed_paren3.snow => parser/testdata/fn_arg_unclosed_paren3.snow}
R pkg/{compiler/parser/testdata/fn_arg_unclosed_paren3.snow.err => parser/testdata/fn_arg_unclosed_paren3.snow.err}
R pkg/{compiler/parser/testdata/fn_arg_unclosed_paren3.snow.want => parser/testdata/fn_arg_unclosed_paren3.snow.want}
R pkg/{compiler/parser/testdata/fn_assign.snow => parser/testdata/fn_assign.snow}
R pkg/{compiler/parser/testdata/fn_assign.snow.err => parser/testdata/fn_assign.snow.err}
R pkg/{compiler/parser/testdata/fn_assign.snow.want => parser/testdata/fn_assign.snow.want}
R pkg/{compiler/parser/testdata/fn_assign_invalid_lhs.snow => parser/testdata/fn_assign_invalid_lhs.snow}
R pkg/{compiler/parser/testdata/fn_assign_invalid_lhs.snow.err => parser/testdata/fn_assign_invalid_lhs.snow.err}
R pkg/{compiler/parser/testdata/fn_assign_invalid_lhs.snow.want => parser/testdata/fn_assign_invalid_lhs.snow.want}
R pkg/{compiler/parser/testdata/fn_attr_invalid.snow => parser/testdata/fn_attr_invalid.snow}
R pkg/{compiler/parser/testdata/fn_attr_invalid.snow.err => parser/testdata/fn_attr_invalid.snow.err}
R pkg/{compiler/parser/testdata/fn_attr_invalid.snow.want => parser/testdata/fn_attr_invalid.snow.want}
R pkg/{compiler/parser/testdata/fn_attr_many.snow => parser/testdata/fn_attr_many.snow}
R pkg/{compiler/parser/testdata/fn_attr_many.snow.err => parser/testdata/fn_attr_many.snow.err}
R pkg/{compiler/parser/testdata/fn_attr_many.snow.want => parser/testdata/fn_attr_many.snow.want}
R pkg/{compiler/parser/testdata/fn_call.snow => parser/testdata/fn_call.snow}
R pkg/{compiler/parser/testdata/fn_call.snow.err => parser/testdata/fn_call.snow.err}
R pkg/{compiler/parser/testdata/fn_call.snow.want => parser/testdata/fn_call.snow.want}
R pkg/{compiler/parser/testdata/fn_expr_stmt.snow => parser/testdata/fn_expr_stmt.snow}
R pkg/{compiler/parser/testdata/fn_expr_stmt.snow.err => parser/testdata/fn_expr_stmt.snow.err}
R pkg/{compiler/parser/testdata/fn_expr_stmt.snow.want => parser/testdata/fn_expr_stmt.snow.want}
R pkg/{compiler/parser/testdata/fn_extern.snow => parser/testdata/fn_extern.snow}
R pkg/{compiler/parser/testdata/fn_extern.snow.err => parser/testdata/fn_extern.snow.err}
R pkg/{compiler/parser/testdata/fn_extern.snow.want => parser/testdata/fn_extern.snow.want}
R pkg/{compiler/parser/testdata/fn_ident_only.snow => parser/testdata/fn_ident_only.snow}
R pkg/{compiler/parser/testdata/fn_ident_only.snow.err => parser/testdata/fn_ident_only.snow.err}
R pkg/{compiler/parser/testdata/fn_ident_only.snow.want => parser/testdata/fn_ident_only.snow.want}
R pkg/{compiler/parser/testdata/fn_kwonly.snow => parser/testdata/fn_kwonly.snow}
R pkg/{compiler/parser/testdata/fn_kwonly.snow.err => parser/testdata/fn_kwonly.snow.err}
R pkg/{compiler/parser/testdata/fn_kwonly.snow.want => parser/testdata/fn_kwonly.snow.want}
R pkg/{compiler/parser/testdata/fn_mul.snow => parser/testdata/fn_mul.snow}
R pkg/{compiler/parser/testdata/fn_mul.snow.err => parser/testdata/fn_mul.snow.err}
R pkg/{compiler/parser/testdata/fn_mul.snow.want => parser/testdata/fn_mul.snow.want}
R pkg/{compiler/parser/testdata/fn_multi_calls.snow => parser/testdata/fn_multi_calls.snow}
R pkg/{compiler/parser/testdata/fn_multi_calls.snow.err => parser/testdata/fn_multi_calls.snow.err}
R pkg/{compiler/parser/testdata/fn_multi_calls.snow.want => parser/testdata/fn_multi_calls.snow.want}
R pkg/{compiler/parser/testdata/fn_naked_return.snow => parser/testdata/fn_naked_return.snow}
R pkg/{compiler/parser/testdata/fn_naked_return.snow.err => parser/testdata/fn_naked_return.snow.err}
R pkg/{compiler/parser/testdata/fn_naked_return.snow.want => parser/testdata/fn_naked_return.snow.want}
R pkg/{compiler/parser/testdata/fn_nested_blocks.snow => parser/testdata/fn_nested_blocks.snow}
R pkg/{compiler/parser/testdata/fn_nested_blocks.snow.err => parser/testdata/fn_nested_blocks.snow.err}
R pkg/{compiler/parser/testdata/fn_nested_blocks.snow.want => parser/testdata/fn_nested_blocks.snow.want}
R pkg/{compiler/parser/testdata/fn_nested_paren.snow => parser/testdata/fn_nested_paren.snow}
R pkg/{compiler/parser/testdata/fn_nested_paren.snow.err => parser/testdata/fn_nested_paren.snow.err}
R pkg/{compiler/parser/testdata/fn_nested_paren.snow.want => parser/testdata/fn_nested_paren.snow.want}
R pkg/{compiler/parser/testdata/fn_nested_paren_newline.snow => parser/testdata/fn_nested_paren_newline.snow}
R pkg/{compiler/parser/testdata/fn_nested_paren_newline.snow.err => parser/testdata/fn_nested_paren_newline.snow.err}
R pkg/{compiler/parser/testdata/fn_nested_paren_newline.snow.want => parser/testdata/fn_nested_paren_newline.snow.want}
R pkg/{compiler/parser/testdata/fn_nested_unary.snow => parser/testdata/fn_nested_unary.snow}
R pkg/{compiler/parser/testdata/fn_nested_unary.snow.err => parser/testdata/fn_nested_unary.snow.err}
R pkg/{compiler/parser/testdata/fn_nested_unary.snow.want => parser/testdata/fn_nested_unary.snow.want}
R pkg/{compiler/parser/testdata/fn_paren_expr.snow => parser/testdata/fn_paren_expr.snow}
R pkg/{compiler/parser/testdata/fn_paren_expr.snow.err => parser/testdata/fn_paren_expr.snow.err}
R pkg/{compiler/parser/testdata/fn_paren_expr.snow.want => parser/testdata/fn_paren_expr.snow.want}
R pkg/{compiler/parser/testdata/fn_return_return.snow => parser/testdata/fn_return_return.snow}
R pkg/{compiler/parser/testdata/fn_return_return.snow.err => parser/testdata/fn_return_return.snow.err}
R pkg/{compiler/parser/testdata/fn_return_return.snow.want => parser/testdata/fn_return_return.snow.want}
R pkg/{compiler/parser/testdata/fn_unary.snow => parser/testdata/fn_unary.snow}
R pkg/{compiler/parser/testdata/fn_unary.snow.err => parser/testdata/fn_unary.snow.err}
R pkg/{compiler/parser/testdata/fn_unary.snow.want => parser/testdata/fn_unary.snow.want}
R pkg/{compiler/parser/testdata/fn_unclosed_paren.snow => parser/testdata/fn_unclosed_paren.snow}
R pkg/{compiler/parser/testdata/fn_unclosed_paren.snow.err => parser/testdata/fn_unclosed_paren.snow.err}
R pkg/{compiler/parser/testdata/fn_unclosed_paren.snow.want => parser/testdata/fn_unclosed_paren.snow.want}
R pkg/{compiler/parser/testdata/let.snow => parser/testdata/let.snow}
R pkg/{compiler/parser/testdata/let.snow.err => parser/testdata/let.snow.err}
R pkg/{compiler/parser/testdata/let.snow.want => parser/testdata/let.snow.want}
R pkg/{compiler/parser/testdata/let_full.snow => parser/testdata/let_full.snow}
R pkg/{compiler/parser/testdata/let_full.snow.err => parser/testdata/let_full.snow.err}
R pkg/{compiler/parser/testdata/let_full.snow.want => parser/testdata/let_full.snow.want}
R pkg/{compiler/parser/testdata/let_infer.snow => parser/testdata/let_infer.snow}
R pkg/{compiler/parser/testdata/let_infer.snow.err => parser/testdata/let_infer.snow.err}
R pkg/{compiler/parser/testdata/let_infer.snow.want => parser/testdata/let_infer.snow.want}
R pkg/{compiler/parser/testdata/let_kwonly.snow => parser/testdata/let_kwonly.snow}
R pkg/{compiler/parser/testdata/let_kwonly.snow.err => parser/testdata/let_kwonly.snow.err}
R pkg/{compiler/parser/testdata/let_kwonly.snow.want => parser/testdata/let_kwonly.snow.want}
R pkg/{compiler/parser/testdata/let_question.snow => parser/testdata/let_question.snow}
R pkg/{compiler/parser/testdata/let_question.snow.err => parser/testdata/let_question.snow.err}
R pkg/{compiler/parser/testdata/let_question.snow.want => parser/testdata/let_question.snow.want}
R pkg/{compiler/parser/testdata/return.snow => parser/testdata/return.snow}
R pkg/{compiler/parser/testdata/return.snow.err => parser/testdata/return.snow.err}
R pkg/{compiler/parser/testdata/return.snow.want => parser/testdata/return.snow.want}
R pkg/{compiler/parser/testdata/return_return.snow => parser/testdata/return_return.snow}
R pkg/{compiler/parser/testdata/return_return.snow.err => parser/testdata/return_return.snow.err}
R pkg/{compiler/parser/testdata/return_return.snow.want => parser/testdata/return_return.snow.want}
R pkg/{compiler/parser/testdata/var.snow => parser/testdata/var.snow}
R pkg/{compiler/parser/testdata/var.snow.err => parser/testdata/var.snow.err}
R pkg/{compiler/parser/testdata/var.snow.want => parser/testdata/var.snow.want}
R pkg/{compiler/parser/testdata/var_bang.snow => parser/testdata/var_bang.snow}
R pkg/{compiler/parser/testdata/var_bang.snow.err => parser/testdata/var_bang.snow.err}
R pkg/{compiler/parser/testdata/var_bang.snow.want => parser/testdata/var_bang.snow.want}
R pkg/{compiler/parser/testdata/var_comma_for_semi.snow => parser/testdata/var_comma_for_semi.snow}
R pkg/{compiler/parser/testdata/var_comma_for_semi.snow.err => parser/testdata/var_comma_for_semi.snow.err}
R pkg/{compiler/parser/testdata/var_comma_for_semi.snow.want => parser/testdata/var_comma_for_semi.snow.want}
R pkg/{compiler/parser/testdata/var_full.snow => parser/testdata/var_full.snow}
R pkg/{compiler/parser/testdata/var_full.snow.err => parser/testdata/var_full.snow.err}
R pkg/{compiler/parser/testdata/var_full.snow.want => parser/testdata/var_full.snow.want}
R pkg/{compiler/parser/testdata/var_infer.snow => parser/testdata/var_infer.snow}
R pkg/{compiler/parser/testdata/var_infer.snow.err => parser/testdata/var_infer.snow.err}
R pkg/{compiler/parser/testdata/var_infer.snow.want => parser/testdata/var_infer.snow.want}
R pkg/{compiler/parser/testdata/var_invalid_type.snow => parser/testdata/var_invalid_type.snow}
R pkg/{compiler/parser/testdata/var_invalid_type.snow.err => parser/testdata/var_invalid_type.snow.err}
R pkg/{compiler/parser/testdata/var_invalid_type.snow.want => parser/testdata/var_invalid_type.snow.want}
R pkg/{compiler/parser/testdata/var_kwonly.snow => parser/testdata/var_kwonly.snow}
R pkg/{compiler/parser/testdata/var_kwonly.snow.err => parser/testdata/var_kwonly.snow.err}
R pkg/{compiler/parser/testdata/var_kwonly.snow.want => parser/testdata/var_kwonly.snow.want}
R pkg/{compiler/parser/testdata/var_missing_type_init.snow => parser/testdata/var_missing_type_init.snow}
R pkg/{compiler/parser/testdata/var_missing_type_init.snow.err => parser/testdata/var_missing_type_init.snow.err}
R pkg/{compiler/parser/testdata/var_missing_type_init.snow.want => parser/testdata/var_missing_type_init.snow.want}
R pkg/{compiler/parser/testdata/var_op_precedence.snow => parser/testdata/var_op_precedence.snow}
R pkg/{compiler/parser/testdata/var_op_precedence.snow.err => parser/testdata/var_op_precedence.snow.err}
R pkg/{compiler/parser/testdata/var_op_precedence.snow.want => parser/testdata/var_op_precedence.snow.want}
R pkg/{compiler/printer/printer.go => printer/printer.go}
R pkg/{compiler/printer/printer_test.go => printer/printer_test.go}
R pkg/{compiler/scanner/scanner.go => scanner/scanner.go}
R pkg/{compiler/scanner/scanner_test.go => scanner/scanner_test.go}
R pkg/{compiler/scanner/testdata/invalid_char.snow => scanner/testdata/invalid_char.snow}
R pkg/{compiler/testdata/fn_add.snow => testdata/fn_add.snow}
R pkg/{compiler/testdata/fn_concat.snow => testdata/fn_concat.snow}
R pkg/{compiler/token/token.go => token/token.go}
R pkg/{compiler/token/token_test.go => token/token_test.go}
M .golangci.toml => .golangci.toml +10 -7
@@ 35,18 35,21 @@
    "`longUsage` is a global variable",
    "`commands` is a global variable",

    # pkg/compiler/parser
    "`topLevelStmtStart` is a global variable",
    "`stmtStart` is a global variable",
    "`testUpdateParserTests` is a global variable",

    # pkg/compiler/token
    # pkg/token
    "`NewFileSet` is a global variable",
    "`tokens` is a global variable",
    "`keywords` is a global variable",
    "`operators` is a global variable",

    # pkg/compiler/codegen
    # pkg/scanner
    "`PrintError` is a global variable",

    # pkg/parser
    "`topLevelStmtStart` is a global variable",
    "`stmtStart` is a global variable",
    "`testUpdateParserTests` is a global variable",

    # pkg/codegen
    "`testUpdateCodegenTests` is a global variable",
  ]


M cmd/snowc/main.go => cmd/snowc/main.go +4 -4
@@ 13,10 13,10 @@ import (

	"git.sr.ht/~mna/snow/cmd/internal/flag"
	"git.sr.ht/~mna/snow/cmd/internal/mainer"
	"git.sr.ht/~mna/snow/pkg/compiler/codegen"
	"git.sr.ht/~mna/snow/pkg/compiler/parser"
	"git.sr.ht/~mna/snow/pkg/compiler/printer"
	"git.sr.ht/~mna/snow/pkg/compiler/scanner"
	"git.sr.ht/~mna/snow/pkg/codegen"
	"git.sr.ht/~mna/snow/pkg/parser"
	"git.sr.ht/~mna/snow/pkg/printer"
	"git.sr.ht/~mna/snow/pkg/scanner"
)

var (

R pkg/compiler/ast/ast.go => pkg/ast/ast.go +1 -1
@@ 1,7 1,7 @@
package ast

import (
	"git.sr.ht/~mna/snow/pkg/compiler/token"
	"git.sr.ht/~mna/snow/pkg/token"
)

// File represents a SourceFile production.

R pkg/compiler/ast/visitor.go => pkg/ast/visitor.go +0 -0
R pkg/compiler/codegen/codegen.go => pkg/codegen/codegen.go +4 -4
@@ 9,10 9,10 @@ import (
	"strconv"
	"strings"

	"git.sr.ht/~mna/snow/pkg/compiler/ast"
	"git.sr.ht/~mna/snow/pkg/compiler/parser"
	"git.sr.ht/~mna/snow/pkg/compiler/scanner"
	"git.sr.ht/~mna/snow/pkg/compiler/token"
	"git.sr.ht/~mna/snow/pkg/ast"
	"git.sr.ht/~mna/snow/pkg/parser"
	"git.sr.ht/~mna/snow/pkg/scanner"
	"git.sr.ht/~mna/snow/pkg/token"
)

// GenerateFiles is a helper function that parses and generates code for the

R pkg/compiler/codegen/codegen_test.go => pkg/codegen/codegen_test.go +0 -0
R pkg/compiler/codegen/testdata/.gitignore => pkg/codegen/testdata/.gitignore +0 -0
R pkg/compiler/codegen/testdata/fn.snow => pkg/codegen/testdata/fn.snow +0 -0
R pkg/compiler/codegen/testdata/fn.snow.want => pkg/codegen/testdata/fn.snow.want +0 -0
R pkg/compiler/codegen/testdata/fn_call.snow => pkg/codegen/testdata/fn_call.snow +0 -0
R pkg/compiler/codegen/testdata/fn_call.snow.want => pkg/codegen/testdata/fn_call.snow.want +0 -0
R pkg/compiler/codegen/testdata/let.snow => pkg/codegen/testdata/let.snow +0 -0
R pkg/compiler/codegen/testdata/let.snow.want => pkg/codegen/testdata/let.snow.want +0 -0
R pkg/compiler/codegen/testdata/var.snow => pkg/codegen/testdata/var.snow +0 -0
R pkg/compiler/codegen/testdata/var.snow.want => pkg/codegen/testdata/var.snow.want +0 -0
R pkg/compiler/parser/parser.go => pkg/parser/parser.go +3 -3
@@ 3,9 3,9 @@ package parser
import (
	"io/ioutil"

	"git.sr.ht/~mna/snow/pkg/compiler/ast"
	"git.sr.ht/~mna/snow/pkg/compiler/scanner"
	"git.sr.ht/~mna/snow/pkg/compiler/token"
	"git.sr.ht/~mna/snow/pkg/ast"
	"git.sr.ht/~mna/snow/pkg/scanner"
	"git.sr.ht/~mna/snow/pkg/token"
)

// ParseFiles is a helper function that parses the source files and returns the

R pkg/compiler/parser/parser_test.go => pkg/parser/parser_test.go +5 -5
@@ 3,14 3,14 @@ package parser
import (
	"bytes"
	"flag"
	goscanner "go/scanner"
	gotoken "go/token"
	"io/ioutil"
	"os"
	"path/filepath"
	"testing"

	"git.sr.ht/~mna/snow/pkg/compiler/printer"
	"git.sr.ht/~mna/snow/pkg/printer"
	"git.sr.ht/~mna/snow/pkg/scanner"
	"git.sr.ht/~mna/snow/pkg/token"
	"github.com/kylelemons/godebug/diff"
)



@@ 39,7 39,7 @@ func TestParser(t *testing.T) {
				t.Fatal(err)
			}

			fset := gotoken.NewFileSet()
			fset := token.NewFileSet()
			p.init(fset, fi.Name(), b)

			f := p.parseFile()


@@ 49,7 49,7 @@ func TestParser(t *testing.T) {
			//pretty.Print(f)

			var ebuf bytes.Buffer
			goscanner.PrintError(&ebuf, parseErr)
			scanner.PrintError(&ebuf, parseErr)

			var buf bytes.Buffer
			pp := printer.Printer{W: &buf, Pos: printer.PosOffsets, WithComments: true}

R pkg/compiler/parser/testdata/comment.snow => pkg/parser/testdata/comment.snow +0 -0
R pkg/compiler/parser/testdata/comment.snow.err => pkg/parser/testdata/comment.snow.err +0 -0
R pkg/compiler/parser/testdata/comment.snow.want => pkg/parser/testdata/comment.snow.want +0 -0
R pkg/compiler/parser/testdata/comments.snow => pkg/parser/testdata/comments.snow +0 -0
R pkg/compiler/parser/testdata/comments.snow.err => pkg/parser/testdata/comments.snow.err +0 -0
R pkg/compiler/parser/testdata/comments.snow.want => pkg/parser/testdata/comments.snow.want +0 -0
R pkg/compiler/parser/testdata/empty.snow => pkg/parser/testdata/empty.snow +0 -0
R pkg/compiler/parser/testdata/empty.snow.err => pkg/parser/testdata/empty.snow.err +0 -0
R pkg/compiler/parser/testdata/empty.snow.want => pkg/parser/testdata/empty.snow.want +0 -0
R pkg/compiler/parser/testdata/fn.snow => pkg/parser/testdata/fn.snow +0 -0
R pkg/compiler/parser/testdata/fn.snow.err => pkg/parser/testdata/fn.snow.err +0 -0
R pkg/compiler/parser/testdata/fn.snow.want => pkg/parser/testdata/fn.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_add.snow => pkg/parser/testdata/fn_add.snow +0 -0
R pkg/compiler/parser/testdata/fn_add.snow.err => pkg/parser/testdata/fn_add.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_add.snow.want => pkg/parser/testdata/fn_add.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_arg_unclosed_paren.snow => pkg/parser/testdata/fn_arg_unclosed_paren.snow +0 -0
R pkg/compiler/parser/testdata/fn_arg_unclosed_paren.snow.err => pkg/parser/testdata/fn_arg_unclosed_paren.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_arg_unclosed_paren.snow.want => pkg/parser/testdata/fn_arg_unclosed_paren.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_arg_unclosed_paren2.snow => pkg/parser/testdata/fn_arg_unclosed_paren2.snow +0 -0
R pkg/compiler/parser/testdata/fn_arg_unclosed_paren2.snow.err => pkg/parser/testdata/fn_arg_unclosed_paren2.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_arg_unclosed_paren2.snow.want => pkg/parser/testdata/fn_arg_unclosed_paren2.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_arg_unclosed_paren3.snow => pkg/parser/testdata/fn_arg_unclosed_paren3.snow +0 -0
R pkg/compiler/parser/testdata/fn_arg_unclosed_paren3.snow.err => pkg/parser/testdata/fn_arg_unclosed_paren3.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_arg_unclosed_paren3.snow.want => pkg/parser/testdata/fn_arg_unclosed_paren3.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_assign.snow => pkg/parser/testdata/fn_assign.snow +0 -0
R pkg/compiler/parser/testdata/fn_assign.snow.err => pkg/parser/testdata/fn_assign.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_assign.snow.want => pkg/parser/testdata/fn_assign.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_assign_invalid_lhs.snow => pkg/parser/testdata/fn_assign_invalid_lhs.snow +0 -0
R pkg/compiler/parser/testdata/fn_assign_invalid_lhs.snow.err => pkg/parser/testdata/fn_assign_invalid_lhs.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_assign_invalid_lhs.snow.want => pkg/parser/testdata/fn_assign_invalid_lhs.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_attr_invalid.snow => pkg/parser/testdata/fn_attr_invalid.snow +0 -0
R pkg/compiler/parser/testdata/fn_attr_invalid.snow.err => pkg/parser/testdata/fn_attr_invalid.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_attr_invalid.snow.want => pkg/parser/testdata/fn_attr_invalid.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_attr_many.snow => pkg/parser/testdata/fn_attr_many.snow +0 -0
R pkg/compiler/parser/testdata/fn_attr_many.snow.err => pkg/parser/testdata/fn_attr_many.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_attr_many.snow.want => pkg/parser/testdata/fn_attr_many.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_call.snow => pkg/parser/testdata/fn_call.snow +0 -0
R pkg/compiler/parser/testdata/fn_call.snow.err => pkg/parser/testdata/fn_call.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_call.snow.want => pkg/parser/testdata/fn_call.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_expr_stmt.snow => pkg/parser/testdata/fn_expr_stmt.snow +0 -0
R pkg/compiler/parser/testdata/fn_expr_stmt.snow.err => pkg/parser/testdata/fn_expr_stmt.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_expr_stmt.snow.want => pkg/parser/testdata/fn_expr_stmt.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_extern.snow => pkg/parser/testdata/fn_extern.snow +0 -0
R pkg/compiler/parser/testdata/fn_extern.snow.err => pkg/parser/testdata/fn_extern.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_extern.snow.want => pkg/parser/testdata/fn_extern.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_ident_only.snow => pkg/parser/testdata/fn_ident_only.snow +0 -0
R pkg/compiler/parser/testdata/fn_ident_only.snow.err => pkg/parser/testdata/fn_ident_only.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_ident_only.snow.want => pkg/parser/testdata/fn_ident_only.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_kwonly.snow => pkg/parser/testdata/fn_kwonly.snow +0 -0
R pkg/compiler/parser/testdata/fn_kwonly.snow.err => pkg/parser/testdata/fn_kwonly.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_kwonly.snow.want => pkg/parser/testdata/fn_kwonly.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_mul.snow => pkg/parser/testdata/fn_mul.snow +0 -0
R pkg/compiler/parser/testdata/fn_mul.snow.err => pkg/parser/testdata/fn_mul.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_mul.snow.want => pkg/parser/testdata/fn_mul.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_multi_calls.snow => pkg/parser/testdata/fn_multi_calls.snow +0 -0
R pkg/compiler/parser/testdata/fn_multi_calls.snow.err => pkg/parser/testdata/fn_multi_calls.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_multi_calls.snow.want => pkg/parser/testdata/fn_multi_calls.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_naked_return.snow => pkg/parser/testdata/fn_naked_return.snow +0 -0
R pkg/compiler/parser/testdata/fn_naked_return.snow.err => pkg/parser/testdata/fn_naked_return.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_naked_return.snow.want => pkg/parser/testdata/fn_naked_return.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_nested_blocks.snow => pkg/parser/testdata/fn_nested_blocks.snow +0 -0
R pkg/compiler/parser/testdata/fn_nested_blocks.snow.err => pkg/parser/testdata/fn_nested_blocks.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_nested_blocks.snow.want => pkg/parser/testdata/fn_nested_blocks.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_nested_paren.snow => pkg/parser/testdata/fn_nested_paren.snow +0 -0
R pkg/compiler/parser/testdata/fn_nested_paren.snow.err => pkg/parser/testdata/fn_nested_paren.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_nested_paren.snow.want => pkg/parser/testdata/fn_nested_paren.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_nested_paren_newline.snow => pkg/parser/testdata/fn_nested_paren_newline.snow +0 -0
R pkg/compiler/parser/testdata/fn_nested_paren_newline.snow.err => pkg/parser/testdata/fn_nested_paren_newline.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_nested_paren_newline.snow.want => pkg/parser/testdata/fn_nested_paren_newline.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_nested_unary.snow => pkg/parser/testdata/fn_nested_unary.snow +0 -0
R pkg/compiler/parser/testdata/fn_nested_unary.snow.err => pkg/parser/testdata/fn_nested_unary.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_nested_unary.snow.want => pkg/parser/testdata/fn_nested_unary.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_paren_expr.snow => pkg/parser/testdata/fn_paren_expr.snow +0 -0
R pkg/compiler/parser/testdata/fn_paren_expr.snow.err => pkg/parser/testdata/fn_paren_expr.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_paren_expr.snow.want => pkg/parser/testdata/fn_paren_expr.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_return_return.snow => pkg/parser/testdata/fn_return_return.snow +0 -0
R pkg/compiler/parser/testdata/fn_return_return.snow.err => pkg/parser/testdata/fn_return_return.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_return_return.snow.want => pkg/parser/testdata/fn_return_return.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_unary.snow => pkg/parser/testdata/fn_unary.snow +0 -0
R pkg/compiler/parser/testdata/fn_unary.snow.err => pkg/parser/testdata/fn_unary.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_unary.snow.want => pkg/parser/testdata/fn_unary.snow.want +0 -0
R pkg/compiler/parser/testdata/fn_unclosed_paren.snow => pkg/parser/testdata/fn_unclosed_paren.snow +0 -0
R pkg/compiler/parser/testdata/fn_unclosed_paren.snow.err => pkg/parser/testdata/fn_unclosed_paren.snow.err +0 -0
R pkg/compiler/parser/testdata/fn_unclosed_paren.snow.want => pkg/parser/testdata/fn_unclosed_paren.snow.want +0 -0
R pkg/compiler/parser/testdata/let.snow => pkg/parser/testdata/let.snow +0 -0
R pkg/compiler/parser/testdata/let.snow.err => pkg/parser/testdata/let.snow.err +0 -0
R pkg/compiler/parser/testdata/let.snow.want => pkg/parser/testdata/let.snow.want +0 -0
R pkg/compiler/parser/testdata/let_full.snow => pkg/parser/testdata/let_full.snow +0 -0
R pkg/compiler/parser/testdata/let_full.snow.err => pkg/parser/testdata/let_full.snow.err +0 -0
R pkg/compiler/parser/testdata/let_full.snow.want => pkg/parser/testdata/let_full.snow.want +0 -0
R pkg/compiler/parser/testdata/let_infer.snow => pkg/parser/testdata/let_infer.snow +0 -0
R pkg/compiler/parser/testdata/let_infer.snow.err => pkg/parser/testdata/let_infer.snow.err +0 -0
R pkg/compiler/parser/testdata/let_infer.snow.want => pkg/parser/testdata/let_infer.snow.want +0 -0
R pkg/compiler/parser/testdata/let_kwonly.snow => pkg/parser/testdata/let_kwonly.snow +0 -0
R pkg/compiler/parser/testdata/let_kwonly.snow.err => pkg/parser/testdata/let_kwonly.snow.err +0 -0
R pkg/compiler/parser/testdata/let_kwonly.snow.want => pkg/parser/testdata/let_kwonly.snow.want +0 -0
R pkg/compiler/parser/testdata/let_question.snow => pkg/parser/testdata/let_question.snow +0 -0
R pkg/compiler/parser/testdata/let_question.snow.err => pkg/parser/testdata/let_question.snow.err +0 -0
R pkg/compiler/parser/testdata/let_question.snow.want => pkg/parser/testdata/let_question.snow.want +0 -0
R pkg/compiler/parser/testdata/return.snow => pkg/parser/testdata/return.snow +0 -0
R pkg/compiler/parser/testdata/return.snow.err => pkg/parser/testdata/return.snow.err +0 -0
R pkg/compiler/parser/testdata/return.snow.want => pkg/parser/testdata/return.snow.want +0 -0
R pkg/compiler/parser/testdata/return_return.snow => pkg/parser/testdata/return_return.snow +0 -0
R pkg/compiler/parser/testdata/return_return.snow.err => pkg/parser/testdata/return_return.snow.err +0 -0
R pkg/compiler/parser/testdata/return_return.snow.want => pkg/parser/testdata/return_return.snow.want +0 -0
R pkg/compiler/parser/testdata/var.snow => pkg/parser/testdata/var.snow +0 -0
R pkg/compiler/parser/testdata/var.snow.err => pkg/parser/testdata/var.snow.err +0 -0
R pkg/compiler/parser/testdata/var.snow.want => pkg/parser/testdata/var.snow.want +0 -0
R pkg/compiler/parser/testdata/var_bang.snow => pkg/parser/testdata/var_bang.snow +0 -0
R pkg/compiler/parser/testdata/var_bang.snow.err => pkg/parser/testdata/var_bang.snow.err +0 -0
R pkg/compiler/parser/testdata/var_bang.snow.want => pkg/parser/testdata/var_bang.snow.want +0 -0
R pkg/compiler/parser/testdata/var_comma_for_semi.snow => pkg/parser/testdata/var_comma_for_semi.snow +0 -0
R pkg/compiler/parser/testdata/var_comma_for_semi.snow.err => pkg/parser/testdata/var_comma_for_semi.snow.err +0 -0
R pkg/compiler/parser/testdata/var_comma_for_semi.snow.want => pkg/parser/testdata/var_comma_for_semi.snow.want +0 -0
R pkg/compiler/parser/testdata/var_full.snow => pkg/parser/testdata/var_full.snow +0 -0
R pkg/compiler/parser/testdata/var_full.snow.err => pkg/parser/testdata/var_full.snow.err +0 -0
R pkg/compiler/parser/testdata/var_full.snow.want => pkg/parser/testdata/var_full.snow.want +0 -0
R pkg/compiler/parser/testdata/var_infer.snow => pkg/parser/testdata/var_infer.snow +0 -0
R pkg/compiler/parser/testdata/var_infer.snow.err => pkg/parser/testdata/var_infer.snow.err +0 -0
R pkg/compiler/parser/testdata/var_infer.snow.want => pkg/parser/testdata/var_infer.snow.want +0 -0
R pkg/compiler/parser/testdata/var_invalid_type.snow => pkg/parser/testdata/var_invalid_type.snow +0 -0
R pkg/compiler/parser/testdata/var_invalid_type.snow.err => pkg/parser/testdata/var_invalid_type.snow.err +0 -0
R pkg/compiler/parser/testdata/var_invalid_type.snow.want => pkg/parser/testdata/var_invalid_type.snow.want +0 -0
R pkg/compiler/parser/testdata/var_kwonly.snow => pkg/parser/testdata/var_kwonly.snow +0 -0
R pkg/compiler/parser/testdata/var_kwonly.snow.err => pkg/parser/testdata/var_kwonly.snow.err +0 -0
R pkg/compiler/parser/testdata/var_kwonly.snow.want => pkg/parser/testdata/var_kwonly.snow.want +0 -0
R pkg/compiler/parser/testdata/var_missing_type_init.snow => pkg/parser/testdata/var_missing_type_init.snow +0 -0
R pkg/compiler/parser/testdata/var_missing_type_init.snow.err => pkg/parser/testdata/var_missing_type_init.snow.err +0 -0
R pkg/compiler/parser/testdata/var_missing_type_init.snow.want => pkg/parser/testdata/var_missing_type_init.snow.want +0 -0
R pkg/compiler/parser/testdata/var_op_precedence.snow => pkg/parser/testdata/var_op_precedence.snow +0 -0
R pkg/compiler/parser/testdata/var_op_precedence.snow.err => pkg/parser/testdata/var_op_precedence.snow.err +0 -0
R pkg/compiler/parser/testdata/var_op_precedence.snow.want => pkg/parser/testdata/var_op_precedence.snow.want +0 -0
R pkg/compiler/printer/printer.go => pkg/printer/printer.go +2 -2
@@ 6,8 6,8 @@ import (
	"strconv"
	"strings"

	"git.sr.ht/~mna/snow/pkg/compiler/ast"
	"git.sr.ht/~mna/snow/pkg/compiler/token"
	"git.sr.ht/~mna/snow/pkg/ast"
	"git.sr.ht/~mna/snow/pkg/token"
)

// PosMode is the mode that controls printing of position information.

R pkg/compiler/printer/printer_test.go => pkg/printer/printer_test.go +2 -2
@@ 6,8 6,8 @@ import (
	"strings"
	"testing"

	"git.sr.ht/~mna/snow/pkg/compiler/ast"
	"git.sr.ht/~mna/snow/pkg/compiler/token"
	"git.sr.ht/~mna/snow/pkg/ast"
	"git.sr.ht/~mna/snow/pkg/token"
	"github.com/kylelemons/godebug/diff"
)


R pkg/compiler/scanner/scanner.go => pkg/scanner/scanner.go +3 -1
@@ 8,11 8,13 @@ import (
	"unicode"
	"unicode/utf8"

	"git.sr.ht/~mna/snow/pkg/compiler/token"
	"git.sr.ht/~mna/snow/pkg/token"
)

type ErrorList = scanner.ErrorList

var PrintError = scanner.PrintError

// byte order mark, only permitted as very first character
const bom = 0xFEFF


R pkg/compiler/scanner/scanner_test.go => pkg/scanner/scanner_test.go +1 -1
@@ 5,7 5,7 @@ import (
	"testing"
	"unicode/utf8"

	"git.sr.ht/~mna/snow/pkg/compiler/token"
	"git.sr.ht/~mna/snow/pkg/token"
)

type tokLit struct {

R pkg/compiler/scanner/testdata/invalid_char.snow => pkg/scanner/testdata/invalid_char.snow +0 -0
R pkg/compiler/testdata/fn_add.snow => pkg/testdata/fn_add.snow +0 -0
R pkg/compiler/testdata/fn_concat.snow => pkg/testdata/fn_concat.snow +0 -0
R pkg/compiler/token/token.go => pkg/token/token.go +0 -0
R pkg/compiler/token/token_test.go => pkg/token/token_test.go +0 -0