|
|
|
@ -7,8 +7,8 @@ import ( |
|
|
|
|
"strconv" |
|
|
|
|
"unicode" |
|
|
|
|
|
|
|
|
|
. "github.com/mediocregopher/ginger/gg/grammar" |
|
|
|
|
"github.com/mediocregopher/ginger/graph" |
|
|
|
|
. "code.betamike.com/mediocregopher/ginger/gg/grammar" |
|
|
|
|
"code.betamike.com/mediocregopher/ginger/graph" |
|
|
|
|
"golang.org/x/exp/slices" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
@ -53,9 +53,7 @@ var ( |
|
|
|
|
Rune('-'), |
|
|
|
|
positiveNumber, |
|
|
|
|
func(neg Located[rune], posNum Located[string]) Located[string] { |
|
|
|
|
return Located[string]{ |
|
|
|
|
neg.Location, string(neg.Value) + posNum.Value, |
|
|
|
|
} |
|
|
|
|
return Locate(neg.Location, string(neg.Value)+posNum.Value) |
|
|
|
|
}, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
@ -68,7 +66,7 @@ var ( |
|
|
|
|
panic(fmt.Errorf("parsing %q as int: %w", str, err)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return Located[Value]{str.Location, Number(i)} |
|
|
|
|
return Locate(str.Location, Number(i)) |
|
|
|
|
}, |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
@ -93,7 +91,7 @@ var ( |
|
|
|
|
for _, r := range tail { |
|
|
|
|
name = append(name, r.Value) |
|
|
|
|
} |
|
|
|
|
return Located[Value]{head.Location, Name(string(name))} |
|
|
|
|
return Locate(head.Location, Name(string(name))) |
|
|
|
|
}, |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
@ -228,7 +226,7 @@ var graphSym, value = func() ( |
|
|
|
|
gs.g = new(Graph) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return Located[Value]{r.Location, Value{Graph: gs.g}} |
|
|
|
|
return Locate(r.Location, Value{Graph: gs.g}) |
|
|
|
|
}, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|