mirror of
https://github.com/MontFerret/ferret.git
synced 2025-07-13 01:20:35 +02:00
New type system (#232)
* New type system * Fixed dot notation for HTML elements
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
|
||||
"github.com/MontFerret/ferret/pkg/runtime/core"
|
||||
"github.com/MontFerret/ferret/pkg/runtime/values"
|
||||
"github.com/MontFerret/ferret/pkg/runtime/values/types"
|
||||
)
|
||||
|
||||
// Split splits the given string value into a list of strings, using the separator.
|
||||
@ -25,7 +26,7 @@ func Split(_ context.Context, args ...core.Value) (core.Value, error) {
|
||||
limit := -1
|
||||
|
||||
if len(args) > 2 {
|
||||
if args[2].Type() == core.IntType {
|
||||
if args[2].Type() == types.Int {
|
||||
limit = int(args[2].(values.Int))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user