moved a subset of source file to the kern package

This commit is contained in:
2026-04-27 19:43:37 +02:00
parent f100adead3
commit 4d910dd069
107 changed files with 2080 additions and 1380 deletions
+3 -3
View File
@@ -104,7 +104,7 @@ func (parser *parser) parseFuncDef(scanner *scanner) (tree *term, err error) {
param := newTerm(tk)
if len(args) > 0 {
if pos := paramAlreadyDefined(args, param); pos > 0 {
err = tk.Errorf("parameter %q at position %d already defined at position %d", param.source(), len(args)+1, pos)
err = tk.Errorf("parameter %q at position %d already defined at position %d", param.Source(), len(args)+1, pos)
break
}
}
@@ -155,7 +155,7 @@ func (parser *parser) parseFuncDef(scanner *scanner) (tree *term, err error) {
func paramAlreadyDefined(args []*term, param *term) (position int) {
position = 0
for i, arg := range args {
if arg.source() == param.source() {
if arg.Source() == param.Source() {
position = i + 1
}
}
@@ -397,7 +397,7 @@ func couldBeACollection(t *term) bool {
func listSubTree(tree *ast, listTerm *term, allowIndeces bool) (root *term, err error) {
var tk *Token
if allowIndeces {
tk = NewToken(listTerm.tk.row, listTerm.tk.col, SymIndex, listTerm.source())
tk = NewToken(listTerm.tk.row, listTerm.tk.col, SymIndex, listTerm.Source())
root = newTerm(tk)
if err = tree.addTerm(root); err == nil {
err = tree.addTerm(listTerm)