mirror of
https://github.com/MontFerret/ferret.git
synced 2025-07-17 01:32:22 +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"
|
||||
)
|
||||
|
||||
// RegexMatch returns the matches in the given string text, using the regex.
|
||||
@ -67,7 +68,7 @@ func RegexSplit(_ 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