mirror of
				https://github.com/MontFerret/ferret.git
				synced 2025-10-30 23:37:40 +02:00 
			
		
		
		
	#11 Added params
This commit is contained in:
		| @@ -55,6 +55,7 @@ func Exec(query string, opts Options) { | ||||
| 		runtime.WithBrowser(opts.Cdp), | ||||
| 		runtime.WithLog(l), | ||||
| 		runtime.WithLogLevel(logging.DebugLevel), | ||||
| 		runtime.WithParams(opts.Params), | ||||
| 	) | ||||
|  | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -1,5 +1,6 @@ | ||||
| package cli | ||||
|  | ||||
| type Options struct { | ||||
| 	Cdp string | ||||
| 	Cdp    string | ||||
| 	Params map[string]interface{} | ||||
| } | ||||
|   | ||||
| @@ -97,6 +97,7 @@ func Repl(version string, opts Options) { | ||||
| 			runtime.WithBrowser(opts.Cdp), | ||||
| 			runtime.WithLog(l), | ||||
| 			runtime.WithLogLevel(logging.DebugLevel), | ||||
| 			runtime.WithParams(opts.Params), | ||||
| 		) | ||||
|  | ||||
| 		timer.Stop() | ||||
|   | ||||
							
								
								
									
										58
									
								
								cmd/main.go
									
									
									
									
									
								
							
							
						
						
									
										58
									
								
								cmd/main.go
									
									
									
									
									
								
							| @@ -2,16 +2,56 @@ package main | ||||
|  | ||||
| import ( | ||||
| 	"bufio" | ||||
| 	"encoding/json" | ||||
| 	"flag" | ||||
| 	"fmt" | ||||
| 	"github.com/MontFerret/ferret/cmd/cli" | ||||
| 	"github.com/MontFerret/ferret/pkg/browser" | ||||
| 	"github.com/MontFerret/ferret/pkg/runtime/core" | ||||
| 	"io/ioutil" | ||||
| 	"os" | ||||
| 	"strings" | ||||
| ) | ||||
|  | ||||
| var Version string | ||||
|  | ||||
| type Params []string | ||||
|  | ||||
| func (p *Params) String() string { | ||||
| 	return "[" + strings.Join(*p, ",") + "]" | ||||
| } | ||||
|  | ||||
| func (p *Params) Set(value string) error { | ||||
| 	*p = append(*p, value) | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (p *Params) ToMap() (map[string]interface{}, error) { | ||||
| 	res := make(map[string]interface{}) | ||||
|  | ||||
| 	for _, entry := range *p { | ||||
| 		pair := strings.Split(entry, ":") | ||||
|  | ||||
| 		if len(pair) < 2 { | ||||
| 			return nil, core.Error(core.ErrInvalidArgument, entry) | ||||
| 		} | ||||
|  | ||||
| 		var value interface{} | ||||
| 		key := pair[0] | ||||
|  | ||||
| 		err := json.Unmarshal([]byte(pair[1]), &value) | ||||
|  | ||||
| 		if err != nil { | ||||
| 			fmt.Println(pair[1]) | ||||
| 			return nil, err | ||||
| 		} | ||||
|  | ||||
| 		res[key] = value | ||||
| 	} | ||||
|  | ||||
| 	return res, nil | ||||
| } | ||||
|  | ||||
| var ( | ||||
| 	help = flag.Bool( | ||||
| 		"help", | ||||
| @@ -39,6 +79,14 @@ var ( | ||||
| ) | ||||
|  | ||||
| func main() { | ||||
| 	var params Params | ||||
|  | ||||
| 	flag.Var( | ||||
| 		¶ms, | ||||
| 		"param", | ||||
| 		`query parameter (--param=foo:\"bar\", --param=id:1)`, | ||||
| 	) | ||||
|  | ||||
| 	flag.Parse() | ||||
|  | ||||
| 	if *help { | ||||
| @@ -79,8 +127,16 @@ func main() { | ||||
| 		defer b.Close() | ||||
| 	} | ||||
|  | ||||
| 	p, err := params.ToMap() | ||||
|  | ||||
| 	if err != nil { | ||||
| 		fmt.Println(err) | ||||
| 		os.Exit(1) | ||||
| 	} | ||||
|  | ||||
| 	opts := cli.Options{ | ||||
| 		Cdp: cdpConn, | ||||
| 		Cdp:    cdpConn, | ||||
| 		Params: p, | ||||
| 	} | ||||
|  | ||||
| 	stat, _ := os.Stdin.Stat() | ||||
|   | ||||
| @@ -1718,24 +1718,80 @@ func TestForTernaryExpression(t *testing.T) { | ||||
| 	}) | ||||
| } | ||||
|  | ||||
| func TestHtml(t *testing.T) { | ||||
| 	Convey("Should load a document", t, func() { | ||||
| 		c := compiler.New() | ||||
| func TestParam(t *testing.T) { | ||||
| 	Convey("Should be possible to use as a return value", t, func() { | ||||
| 		out := compiler.New(). | ||||
| 			MustCompile(` | ||||
| 			RETURN @param | ||||
| 		`). | ||||
| 			MustRun(context.Background(), runtime.WithParam("param", "foobar")) | ||||
|  | ||||
| 		out, err := c.MustCompile(` | ||||
| LET doc = DOCUMENT("https://github.com/", true) | ||||
| LET btn = ELEMENT(doc, ".HeaderMenu a") | ||||
| 		So(string(out), ShouldEqual, `"foobar"`) | ||||
| 	}) | ||||
|  | ||||
| CLICK(btn) | ||||
| WAIT_NAVIGATION(doc) | ||||
| WAIT_ELEMENT(doc, '.IconNav') | ||||
| 	Convey("Should be possible to use as a FOR source", t, func() { | ||||
| 		out := compiler.New(). | ||||
| 			MustCompile(` | ||||
| 			FOR i IN @values | ||||
| 			SORT i | ||||
| 			RETURN i | ||||
| 		`). | ||||
| 			MustRun(context.Background(), runtime.WithParam("values", []int{1, 2, 3, 4})) | ||||
|  | ||||
| RETURN INNER_HTML_ALL(doc, '.IconNav a') | ||||
| 		So(string(out), ShouldEqual, `[1,2,3,4]`) | ||||
|  | ||||
| 		`).Run(context.Background()) | ||||
| 		out2 := compiler.New(). | ||||
| 			MustCompile(` | ||||
| 			FOR i IN @values | ||||
| 			SORT i | ||||
| 			RETURN i | ||||
| 		`). | ||||
| 			MustRun(context.Background(), runtime.WithParam("values", map[string]int{ | ||||
| 				"foo": 1, | ||||
| 				"bar": 2, | ||||
| 				"faz": 3, | ||||
| 				"qaz": 4, | ||||
| 			})) | ||||
|  | ||||
| 		So(err, ShouldBeNil) | ||||
| 		So(string(out2), ShouldEqual, `[1,2,3,4]`) | ||||
| 	}) | ||||
|  | ||||
| 	Convey("Should be possible to use in range", t, func() { | ||||
| 		out := compiler.New(). | ||||
| 			MustCompile(` | ||||
| 			FOR i IN @start..@end | ||||
| 			SORT i | ||||
| 			RETURN i | ||||
| 		`). | ||||
| 			MustRun( | ||||
| 				context.Background(), | ||||
| 				runtime.WithParam("start", 1), | ||||
| 				runtime.WithParam("end", 4), | ||||
| 			) | ||||
|  | ||||
| 		So(string(out), ShouldEqual, `[1,2,3,4]`) | ||||
|  | ||||
| 		So(string(out), ShouldEqual, `"int"`) | ||||
| 	}) | ||||
| } | ||||
|  | ||||
| func TestHtml(t *testing.T) { | ||||
| 	//	Convey("Should load a document", t, func() { | ||||
| 	//		c := compiler.New() | ||||
| 	// | ||||
| 	//		out, err := c.MustCompile(` | ||||
| 	//LET doc = DOCUMENT("https://github.com/", true) | ||||
| 	//LET btn = ELEMENT(doc, ".HeaderMenu a") | ||||
| 	// | ||||
| 	//CLICK(btn) | ||||
| 	//WAIT_NAVIGATION(doc) | ||||
| 	//WAIT_ELEMENT(doc, '.IconNav') | ||||
| 	// | ||||
| 	//RETURN INNER_HTML_ALL(doc, '.IconNav a') | ||||
| 	// | ||||
| 	//		`).Run(context.Background()) | ||||
| 	// | ||||
| 	//		So(err, ShouldBeNil) | ||||
| 	// | ||||
| 	//		So(string(out), ShouldEqual, `"int"`) | ||||
| 	//	}) | ||||
| } | ||||
|   | ||||
| @@ -406,6 +406,12 @@ func (v *visitor) doVisitForExpressionSource(ctx *fql.ForExpressionSourceContext | ||||
| 		return v.doVisitRangeOperator(rangeOp.(*fql.RangeOperatorContext), scope) | ||||
| 	} | ||||
|  | ||||
| 	param := ctx.Param() | ||||
|  | ||||
| 	if param != nil { | ||||
| 		return v.doVisitParamContext(param.(*fql.ParamContext), scope) | ||||
| 	} | ||||
|  | ||||
| 	return nil, core.Error(ErrInvalidDataSource, ctx.GetText()) | ||||
| } | ||||
|  | ||||
| @@ -684,32 +690,62 @@ func (v *visitor) doVisitRangeOperator(ctx *fql.RangeOperatorContext, scope *sco | ||||
| 	) | ||||
| } | ||||
|  | ||||
| func (v *visitor) doVisitChildren(node antlr.RuleNode, scope *scope) ([]core.Expression, error) { | ||||
| 	children := node.GetChildren() | ||||
| func (v *visitor) doVisitFunctionCallExpression(context *fql.FunctionCallExpressionContext, scope *scope) (collections.IterableExpression, error) { | ||||
| 	args := make([]core.Expression, 0, 5) | ||||
| 	argsCtx := context.Arguments() | ||||
|  | ||||
| 	if children == nil { | ||||
| 		return make([]core.Expression, 0, 0), nil | ||||
| 	if argsCtx != nil { | ||||
| 		argsCtx := argsCtx.(*fql.ArgumentsContext) | ||||
|  | ||||
| 		for _, arg := range argsCtx.AllExpression() { | ||||
| 			exp, err := v.doVisitExpression(arg.(*fql.ExpressionContext), scope) | ||||
|  | ||||
| 			if err != nil { | ||||
| 				return nil, err | ||||
| 			} | ||||
|  | ||||
| 			args = append(args, exp) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	result := make([]core.Expression, 0, len(children)) | ||||
| 	funcName := context.Identifier().GetText() | ||||
|  | ||||
| 	for _, child := range children { | ||||
| 		_, ok := child.(antlr.TerminalNode) | ||||
| 	fun, exists := v.funcs[funcName] | ||||
|  | ||||
| 		if ok { | ||||
| 			continue | ||||
| 		} | ||||
| 	if !exists { | ||||
| 		return nil, core.Error(core.ErrNotFound, fmt.Sprintf("function: '%s'", funcName)) | ||||
| 	} | ||||
|  | ||||
| 		out, err := v.visit(child, scope) | ||||
| 	return expressions.NewFunctionCallExpression( | ||||
| 		v.getSourceMap(context), | ||||
| 		fun, | ||||
| 		args..., | ||||
| 	) | ||||
| } | ||||
|  | ||||
| func (v *visitor) doVisitParamContext(context *fql.ParamContext, scope *scope) (collections.IterableExpression, error) { | ||||
| 	name := context.Identifier().GetText() | ||||
|  | ||||
| 	return expressions.NewParameterExpression( | ||||
| 		v.getSourceMap(context), | ||||
| 		name, | ||||
| 	) | ||||
| } | ||||
|  | ||||
| func (v *visitor) doVisitAllExpressions(contexts []fql.IExpressionContext, scope *scope) ([]core.Expression, error) { | ||||
| 	ret := make([]core.Expression, 0, len(contexts)) | ||||
|  | ||||
| 	for _, ctx := range contexts { | ||||
| 		exp, err := v.doVisitExpression(ctx.(*fql.ExpressionContext), scope) | ||||
|  | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
|  | ||||
| 		result = append(result, out) | ||||
| 		ret = append(ret, exp) | ||||
| 	} | ||||
|  | ||||
| 	return result, nil | ||||
| 	return ret, nil | ||||
| } | ||||
|  | ||||
| func (v *visitor) doVisitExpression(ctx *fql.ExpressionContext, scope *scope) (core.Expression, error) { | ||||
| @@ -882,77 +918,42 @@ func (v *visitor) doVisitExpression(ctx *fql.ExpressionContext, scope *scope) (c | ||||
| 		return v.doVisitRangeOperator(rangeOp.(*fql.RangeOperatorContext), scope) | ||||
| 	} | ||||
|  | ||||
| 	param := ctx.Param() | ||||
|  | ||||
| 	if param != nil { | ||||
| 		return v.doVisitParamContext(param.(*fql.ParamContext), scope) | ||||
| 	} | ||||
|  | ||||
| 	// TODO: Complete it | ||||
| 	return nil, ErrNotImplemented | ||||
| } | ||||
|  | ||||
| func (v *visitor) doVisitAllExpressions(contexts []fql.IExpressionContext, scope *scope) ([]core.Expression, error) { | ||||
| 	ret := make([]core.Expression, 0, len(contexts)) | ||||
| func (v *visitor) doVisitChildren(node antlr.RuleNode, scope *scope) ([]core.Expression, error) { | ||||
| 	children := node.GetChildren() | ||||
|  | ||||
| 	for _, ctx := range contexts { | ||||
| 		exp, err := v.doVisitExpression(ctx.(*fql.ExpressionContext), scope) | ||||
|  | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
|  | ||||
| 		ret = append(ret, exp) | ||||
| 	} | ||||
|  | ||||
| 	return ret, nil | ||||
| } | ||||
|  | ||||
| func (v *visitor) doVisitFunctionCallExpression(context *fql.FunctionCallExpressionContext, scope *scope) (collections.IterableExpression, error) { | ||||
| 	args := make([]core.Expression, 0, 5) | ||||
| 	argsCtx := context.Arguments() | ||||
|  | ||||
| 	if argsCtx != nil { | ||||
| 		argsCtx := argsCtx.(*fql.ArgumentsContext) | ||||
|  | ||||
| 		for _, arg := range argsCtx.AllExpression() { | ||||
| 			exp, err := v.doVisitExpression(arg.(*fql.ExpressionContext), scope) | ||||
|  | ||||
| 			if err != nil { | ||||
| 				return nil, err | ||||
| 			} | ||||
|  | ||||
| 			args = append(args, exp) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	funcName := context.Identifier().GetText() | ||||
|  | ||||
| 	fun, exists := v.funcs[funcName] | ||||
|  | ||||
| 	if !exists { | ||||
| 		return nil, core.Error(core.ErrNotFound, fmt.Sprintf("function: '%s'", funcName)) | ||||
| 	} | ||||
|  | ||||
| 	return expressions.NewFunctionCallExpression( | ||||
| 		v.getSourceMap(context), | ||||
| 		fun, | ||||
| 		args..., | ||||
| 	) | ||||
| } | ||||
|  | ||||
| func (v *visitor) visitAll(nodes []antlr.Tree, scope *scope) ([]core.Expression, error) { | ||||
| 	if nodes == nil { | ||||
| 	if children == nil { | ||||
| 		return make([]core.Expression, 0, 0), nil | ||||
| 	} | ||||
|  | ||||
| 	res := make([]core.Expression, 0, len(nodes)) | ||||
| 	result := make([]core.Expression, 0, len(children)) | ||||
|  | ||||
| 	for idx, node := range nodes { | ||||
| 		out, err := v.visit(node, scope) | ||||
| 	for _, child := range children { | ||||
| 		_, ok := child.(antlr.TerminalNode) | ||||
|  | ||||
| 		if ok { | ||||
| 			continue | ||||
| 		} | ||||
|  | ||||
| 		out, err := v.visit(child, scope) | ||||
|  | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
|  | ||||
| 		res[idx] = out | ||||
| 		result = append(result, out) | ||||
| 	} | ||||
|  | ||||
| 	return res, nil | ||||
| 	return result, nil | ||||
| } | ||||
|  | ||||
| func (v *visitor) visit(node antlr.Tree, scope *scope) (core.Expression, error) { | ||||
| @@ -988,6 +989,8 @@ func (v *visitor) visit(node antlr.Tree, scope *scope) (core.Expression, error) | ||||
| 		out, err = v.doVisitVariableDeclaration(node.(*fql.VariableDeclarationContext), scope) | ||||
| 	case *fql.FunctionCallExpressionContext: | ||||
| 		out, err = v.doVisitFunctionCallExpression(node.(*fql.FunctionCallExpressionContext), scope) | ||||
| 	case *fql.ParamContext: | ||||
| 		out, err = v.doVisitParamContext(node.(*fql.ParamContext), scope) | ||||
| 	default: | ||||
| 		err = v.unexpectedToken(node) | ||||
| 	} | ||||
|   | ||||
| @@ -76,6 +76,7 @@ Not: 'NOT' | '!'; | ||||
| In: 'IN'; | ||||
|  | ||||
| // Literals | ||||
| Param: '@'; | ||||
| Identifier: Letter+ (Symbols (Identifier)*)* (Digit (Identifier)*)*; | ||||
| StringLiteral: SQString | DQSring; | ||||
| IntegerLiteral: [0-9]+; | ||||
|   | ||||
| @@ -54,10 +54,11 @@ Aggregate=53 | ||||
| Like=54 | ||||
| Not=55 | ||||
| In=56 | ||||
| Identifier=57 | ||||
| StringLiteral=58 | ||||
| IntegerLiteral=59 | ||||
| FloatLiteral=60 | ||||
| Param=57 | ||||
| Identifier=58 | ||||
| StringLiteral=59 | ||||
| IntegerLiteral=60 | ||||
| FloatLiteral=61 | ||||
| ':'=5 | ||||
| ';'=6 | ||||
| '.'=7 | ||||
| @@ -104,3 +105,4 @@ FloatLiteral=60 | ||||
| 'AGGREGATE'=53 | ||||
| 'LIKE'=54 | ||||
| 'IN'=56 | ||||
| '@'=57 | ||||
|   | ||||
| @@ -48,6 +48,7 @@ forExpressionSource | ||||
|     | variable | ||||
|     | memberExpression | ||||
|     | rangeOperator | ||||
|     | param | ||||
|     ; | ||||
|  | ||||
| forExpressionClause | ||||
| @@ -128,12 +129,16 @@ variableDeclaration | ||||
|     | Let Identifier Assign forTernaryExpression | ||||
|     ; | ||||
|  | ||||
| param | ||||
|     : Param Identifier | ||||
|     ; | ||||
|  | ||||
| variable | ||||
|     : Identifier | ||||
|     ; | ||||
|  | ||||
| rangeOperator | ||||
|     : (integerLiteral | variable) Range (integerLiteral | variable) | ||||
|     : (integerLiteral | variable | param) Range (integerLiteral | variable | param) | ||||
|     ; | ||||
|  | ||||
| arrayLiteral | ||||
| @@ -225,6 +230,7 @@ expression | ||||
|     | variable | ||||
|     | memberExpression | ||||
|     | noneLiteral | ||||
|     | param | ||||
|     ; | ||||
|  | ||||
| forTernaryExpression | ||||
|   | ||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -54,10 +54,11 @@ Aggregate=53 | ||||
| Like=54 | ||||
| Not=55 | ||||
| In=56 | ||||
| Identifier=57 | ||||
| StringLiteral=58 | ||||
| IntegerLiteral=59 | ||||
| FloatLiteral=60 | ||||
| Param=57 | ||||
| Identifier=58 | ||||
| StringLiteral=59 | ||||
| IntegerLiteral=60 | ||||
| FloatLiteral=61 | ||||
| ':'=5 | ||||
| ';'=6 | ||||
| '.'=7 | ||||
| @@ -104,3 +105,4 @@ FloatLiteral=60 | ||||
| 'AGGREGATE'=53 | ||||
| 'LIKE'=54 | ||||
| 'IN'=56 | ||||
| '@'=57 | ||||
|   | ||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -54,10 +54,11 @@ Aggregate=53 | ||||
| Like=54 | ||||
| Not=55 | ||||
| In=56 | ||||
| Identifier=57 | ||||
| StringLiteral=58 | ||||
| IntegerLiteral=59 | ||||
| FloatLiteral=60 | ||||
| Param=57 | ||||
| Identifier=58 | ||||
| StringLiteral=59 | ||||
| IntegerLiteral=60 | ||||
| FloatLiteral=61 | ||||
| ':'=5 | ||||
| ';'=6 | ||||
| '.'=7 | ||||
| @@ -104,3 +105,4 @@ FloatLiteral=60 | ||||
| 'AGGREGATE'=53 | ||||
| 'LIKE'=54 | ||||
| 'IN'=56 | ||||
| '@'=57 | ||||
|   | ||||
| @@ -14,7 +14,7 @@ var _ = fmt.Printf | ||||
| var _ = unicode.IsLetter | ||||
|  | ||||
| var serializedLexerAtn = []uint16{ | ||||
| 	3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 62, 502, | ||||
| 	3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 63, 506, | ||||
| 	8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, | ||||
| 	9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, | ||||
| 	4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, | ||||
| @@ -27,217 +27,219 @@ var serializedLexerAtn = []uint16{ | ||||
| 	49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, | ||||
| 	4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, | ||||
| 	60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, | ||||
| 	9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 3, 2, 3, | ||||
| 	2, 3, 2, 3, 2, 7, 2, 144, 10, 2, 12, 2, 14, 2, 147, 11, 2, 3, 2, 3, 2, | ||||
| 	3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 158, 10, 3, 12, 3, 14, | ||||
| 	3, 161, 11, 3, 3, 3, 3, 3, 3, 4, 6, 4, 166, 10, 4, 13, 4, 14, 4, 167, 3, | ||||
| 	4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, | ||||
| 	9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, | ||||
| 	3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, | ||||
| 	19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, | ||||
| 	3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, | ||||
| 	27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 5, 29, 233, | ||||
| 	10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 239, 10, 30, 3, 31, 3, 31, 3, | ||||
| 	31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, | ||||
| 	3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, | ||||
| 	37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, | ||||
| 	3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, | ||||
| 	40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, | ||||
| 	3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, | ||||
| 	44, 3, 44, 3, 44, 3, 44, 3, 44, 5, 44, 311, 10, 44, 3, 45, 3, 45, 3, 45, | ||||
| 	3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, | ||||
| 	47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, | ||||
| 	3, 47, 3, 47, 3, 47, 3, 47, 5, 47, 341, 10, 47, 3, 48, 3, 48, 3, 48, 3, | ||||
| 	48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, | ||||
| 	3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 3, | ||||
| 	52, 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, | ||||
| 	3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 56, 3, | ||||
| 	56, 3, 56, 3, 56, 5, 56, 391, 10, 56, 3, 57, 3, 57, 3, 57, 3, 58, 6, 58, | ||||
| 	397, 10, 58, 13, 58, 14, 58, 398, 3, 58, 3, 58, 7, 58, 403, 10, 58, 12, | ||||
| 	58, 14, 58, 406, 11, 58, 7, 58, 408, 10, 58, 12, 58, 14, 58, 411, 11, 58, | ||||
| 	3, 58, 3, 58, 7, 58, 415, 10, 58, 12, 58, 14, 58, 418, 11, 58, 7, 58, 420, | ||||
| 	10, 58, 12, 58, 14, 58, 423, 11, 58, 3, 59, 3, 59, 5, 59, 427, 10, 59, | ||||
| 	3, 60, 6, 60, 430, 10, 60, 13, 60, 14, 60, 431, 3, 61, 3, 61, 3, 61, 6, | ||||
| 	61, 437, 10, 61, 13, 61, 14, 61, 438, 3, 61, 5, 61, 442, 10, 61, 3, 61, | ||||
| 	3, 61, 5, 61, 446, 10, 61, 5, 61, 448, 10, 61, 3, 62, 3, 62, 3, 63, 3, | ||||
| 	63, 3, 63, 7, 63, 455, 10, 63, 12, 63, 14, 63, 458, 11, 63, 5, 63, 460, | ||||
| 	10, 63, 3, 64, 3, 64, 5, 64, 464, 10, 64, 3, 64, 6, 64, 467, 10, 64, 13, | ||||
| 	64, 14, 64, 468, 3, 65, 3, 65, 3, 66, 3, 66, 3, 67, 3, 67, 3, 68, 3, 68, | ||||
| 	3, 68, 3, 68, 3, 68, 3, 68, 7, 68, 483, 10, 68, 12, 68, 14, 68, 486, 11, | ||||
| 	68, 3, 68, 3, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 496, | ||||
| 	10, 69, 12, 69, 14, 69, 499, 11, 69, 3, 69, 3, 69, 3, 145, 2, 70, 3, 3, | ||||
| 	5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, | ||||
| 	25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, | ||||
| 	43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, | ||||
| 	61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, | ||||
| 	79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 93, 48, 95, 49, | ||||
| 	97, 50, 99, 51, 101, 52, 103, 53, 105, 54, 107, 55, 109, 56, 111, 57, 113, | ||||
| 	58, 115, 59, 117, 60, 119, 61, 121, 62, 123, 2, 125, 2, 127, 2, 129, 2, | ||||
| 	131, 2, 133, 2, 135, 2, 137, 2, 3, 2, 12, 5, 2, 12, 12, 15, 15, 8234, 8235, | ||||
| 	6, 2, 11, 11, 13, 14, 34, 34, 162, 162, 3, 2, 50, 59, 5, 2, 50, 59, 67, | ||||
| 	72, 99, 104, 3, 2, 51, 59, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, | ||||
| 	4, 2, 67, 92, 99, 124, 4, 2, 36, 36, 94, 94, 4, 2, 41, 41, 94, 94, 2, 524, | ||||
| 	2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, | ||||
| 	2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, | ||||
| 	2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, | ||||
| 	2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, | ||||
| 	2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, | ||||
| 	3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, | ||||
| 	49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, | ||||
| 	2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, | ||||
| 	2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, | ||||
| 	2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, | ||||
| 	2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, | ||||
| 	3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, | ||||
| 	95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, | ||||
| 	2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 2, 109, | ||||
| 	3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, | ||||
| 	2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 3, 139, 3, | ||||
| 	2, 2, 2, 5, 153, 3, 2, 2, 2, 7, 165, 3, 2, 2, 2, 9, 171, 3, 2, 2, 2, 11, | ||||
| 	175, 3, 2, 2, 2, 13, 177, 3, 2, 2, 2, 15, 179, 3, 2, 2, 2, 17, 181, 3, | ||||
| 	2, 2, 2, 19, 183, 3, 2, 2, 2, 21, 185, 3, 2, 2, 2, 23, 187, 3, 2, 2, 2, | ||||
| 	25, 189, 3, 2, 2, 2, 27, 191, 3, 2, 2, 2, 29, 193, 3, 2, 2, 2, 31, 195, | ||||
| 	3, 2, 2, 2, 33, 197, 3, 2, 2, 2, 35, 199, 3, 2, 2, 2, 37, 202, 3, 2, 2, | ||||
| 	2, 39, 205, 3, 2, 2, 2, 41, 208, 3, 2, 2, 2, 43, 211, 3, 2, 2, 2, 45, 213, | ||||
| 	3, 2, 2, 2, 47, 215, 3, 2, 2, 2, 49, 218, 3, 2, 2, 2, 51, 221, 3, 2, 2, | ||||
| 	2, 53, 223, 3, 2, 2, 2, 55, 225, 3, 2, 2, 2, 57, 232, 3, 2, 2, 2, 59, 238, | ||||
| 	3, 2, 2, 2, 61, 240, 3, 2, 2, 2, 63, 243, 3, 2, 2, 2, 65, 245, 3, 2, 2, | ||||
| 	2, 67, 247, 3, 2, 2, 2, 69, 250, 3, 2, 2, 2, 71, 253, 3, 2, 2, 2, 73, 257, | ||||
| 	3, 2, 2, 2, 75, 264, 3, 2, 2, 2, 77, 273, 3, 2, 2, 2, 79, 280, 3, 2, 2, | ||||
| 	2, 81, 285, 3, 2, 2, 2, 83, 291, 3, 2, 2, 2, 85, 295, 3, 2, 2, 2, 87, 310, | ||||
| 	3, 2, 2, 2, 89, 312, 3, 2, 2, 2, 91, 317, 3, 2, 2, 2, 93, 340, 3, 2, 2, | ||||
| 	2, 95, 342, 3, 2, 2, 2, 97, 347, 3, 2, 2, 2, 99, 352, 3, 2, 2, 2, 101, | ||||
| 	357, 3, 2, 2, 2, 103, 363, 3, 2, 2, 2, 105, 367, 3, 2, 2, 2, 107, 371, | ||||
| 	3, 2, 2, 2, 109, 381, 3, 2, 2, 2, 111, 390, 3, 2, 2, 2, 113, 392, 3, 2, | ||||
| 	2, 2, 115, 396, 3, 2, 2, 2, 117, 426, 3, 2, 2, 2, 119, 429, 3, 2, 2, 2, | ||||
| 	121, 447, 3, 2, 2, 2, 123, 449, 3, 2, 2, 2, 125, 459, 3, 2, 2, 2, 127, | ||||
| 	461, 3, 2, 2, 2, 129, 470, 3, 2, 2, 2, 131, 472, 3, 2, 2, 2, 133, 474, | ||||
| 	3, 2, 2, 2, 135, 476, 3, 2, 2, 2, 137, 489, 3, 2, 2, 2, 139, 140, 7, 49, | ||||
| 	2, 2, 140, 141, 7, 44, 2, 2, 141, 145, 3, 2, 2, 2, 142, 144, 11, 2, 2, | ||||
| 	2, 143, 142, 3, 2, 2, 2, 144, 147, 3, 2, 2, 2, 145, 146, 3, 2, 2, 2, 145, | ||||
| 	143, 3, 2, 2, 2, 146, 148, 3, 2, 2, 2, 147, 145, 3, 2, 2, 2, 148, 149, | ||||
| 	7, 44, 2, 2, 149, 150, 7, 49, 2, 2, 150, 151, 3, 2, 2, 2, 151, 152, 8, | ||||
| 	2, 2, 2, 152, 4, 3, 2, 2, 2, 153, 154, 7, 49, 2, 2, 154, 155, 7, 49, 2, | ||||
| 	2, 155, 159, 3, 2, 2, 2, 156, 158, 10, 2, 2, 2, 157, 156, 3, 2, 2, 2, 158, | ||||
| 	161, 3, 2, 2, 2, 159, 157, 3, 2, 2, 2, 159, 160, 3, 2, 2, 2, 160, 162, | ||||
| 	3, 2, 2, 2, 161, 159, 3, 2, 2, 2, 162, 163, 8, 3, 2, 2, 163, 6, 3, 2, 2, | ||||
| 	2, 164, 166, 9, 3, 2, 2, 165, 164, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, | ||||
| 	165, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 170, | ||||
| 	8, 4, 2, 2, 170, 8, 3, 2, 2, 2, 171, 172, 9, 2, 2, 2, 172, 173, 3, 2, 2, | ||||
| 	2, 173, 174, 8, 5, 2, 2, 174, 10, 3, 2, 2, 2, 175, 176, 7, 60, 2, 2, 176, | ||||
| 	12, 3, 2, 2, 2, 177, 178, 7, 61, 2, 2, 178, 14, 3, 2, 2, 2, 179, 180, 7, | ||||
| 	48, 2, 2, 180, 16, 3, 2, 2, 2, 181, 182, 7, 46, 2, 2, 182, 18, 3, 2, 2, | ||||
| 	2, 183, 184, 7, 93, 2, 2, 184, 20, 3, 2, 2, 2, 185, 186, 7, 95, 2, 2, 186, | ||||
| 	22, 3, 2, 2, 2, 187, 188, 7, 42, 2, 2, 188, 24, 3, 2, 2, 2, 189, 190, 7, | ||||
| 	43, 2, 2, 190, 26, 3, 2, 2, 2, 191, 192, 7, 125, 2, 2, 192, 28, 3, 2, 2, | ||||
| 	2, 193, 194, 7, 127, 2, 2, 194, 30, 3, 2, 2, 2, 195, 196, 7, 64, 2, 2, | ||||
| 	196, 32, 3, 2, 2, 2, 197, 198, 7, 62, 2, 2, 198, 34, 3, 2, 2, 2, 199, 200, | ||||
| 	7, 63, 2, 2, 200, 201, 7, 63, 2, 2, 201, 36, 3, 2, 2, 2, 202, 203, 7, 64, | ||||
| 	2, 2, 203, 204, 7, 63, 2, 2, 204, 38, 3, 2, 2, 2, 205, 206, 7, 62, 2, 2, | ||||
| 	206, 207, 7, 63, 2, 2, 207, 40, 3, 2, 2, 2, 208, 209, 7, 35, 2, 2, 209, | ||||
| 	210, 7, 63, 2, 2, 210, 42, 3, 2, 2, 2, 211, 212, 7, 45, 2, 2, 212, 44, | ||||
| 	3, 2, 2, 2, 213, 214, 7, 47, 2, 2, 214, 46, 3, 2, 2, 2, 215, 216, 7, 47, | ||||
| 	2, 2, 216, 217, 7, 47, 2, 2, 217, 48, 3, 2, 2, 2, 218, 219, 7, 45, 2, 2, | ||||
| 	219, 220, 7, 45, 2, 2, 220, 50, 3, 2, 2, 2, 221, 222, 7, 44, 2, 2, 222, | ||||
| 	52, 3, 2, 2, 2, 223, 224, 7, 49, 2, 2, 224, 54, 3, 2, 2, 2, 225, 226, 7, | ||||
| 	39, 2, 2, 226, 56, 3, 2, 2, 2, 227, 228, 7, 67, 2, 2, 228, 229, 7, 80, | ||||
| 	2, 2, 229, 233, 7, 70, 2, 2, 230, 231, 7, 40, 2, 2, 231, 233, 7, 40, 2, | ||||
| 	2, 232, 227, 3, 2, 2, 2, 232, 230, 3, 2, 2, 2, 233, 58, 3, 2, 2, 2, 234, | ||||
| 	235, 7, 81, 2, 2, 235, 239, 7, 84, 2, 2, 236, 237, 7, 126, 2, 2, 237, 239, | ||||
| 	7, 126, 2, 2, 238, 234, 3, 2, 2, 2, 238, 236, 3, 2, 2, 2, 239, 60, 3, 2, | ||||
| 	2, 2, 240, 241, 5, 15, 8, 2, 241, 242, 5, 15, 8, 2, 242, 62, 3, 2, 2, 2, | ||||
| 	243, 244, 7, 63, 2, 2, 244, 64, 3, 2, 2, 2, 245, 246, 7, 65, 2, 2, 246, | ||||
| 	66, 3, 2, 2, 2, 247, 248, 7, 35, 2, 2, 248, 249, 7, 128, 2, 2, 249, 68, | ||||
| 	3, 2, 2, 2, 250, 251, 7, 63, 2, 2, 251, 252, 7, 128, 2, 2, 252, 70, 3, | ||||
| 	2, 2, 2, 253, 254, 7, 72, 2, 2, 254, 255, 7, 81, 2, 2, 255, 256, 7, 84, | ||||
| 	2, 2, 256, 72, 3, 2, 2, 2, 257, 258, 7, 84, 2, 2, 258, 259, 7, 71, 2, 2, | ||||
| 	259, 260, 7, 86, 2, 2, 260, 261, 7, 87, 2, 2, 261, 262, 7, 84, 2, 2, 262, | ||||
| 	263, 7, 80, 2, 2, 263, 74, 3, 2, 2, 2, 264, 265, 7, 70, 2, 2, 265, 266, | ||||
| 	7, 75, 2, 2, 266, 267, 7, 85, 2, 2, 267, 268, 7, 86, 2, 2, 268, 269, 7, | ||||
| 	75, 2, 2, 269, 270, 7, 80, 2, 2, 270, 271, 7, 69, 2, 2, 271, 272, 7, 86, | ||||
| 	2, 2, 272, 76, 3, 2, 2, 2, 273, 274, 7, 72, 2, 2, 274, 275, 7, 75, 2, 2, | ||||
| 	275, 276, 7, 78, 2, 2, 276, 277, 7, 86, 2, 2, 277, 278, 7, 71, 2, 2, 278, | ||||
| 	279, 7, 84, 2, 2, 279, 78, 3, 2, 2, 2, 280, 281, 7, 85, 2, 2, 281, 282, | ||||
| 	7, 81, 2, 2, 282, 283, 7, 84, 2, 2, 283, 284, 7, 86, 2, 2, 284, 80, 3, | ||||
| 	2, 2, 2, 285, 286, 7, 78, 2, 2, 286, 287, 7, 75, 2, 2, 287, 288, 7, 79, | ||||
| 	2, 2, 288, 289, 7, 75, 2, 2, 289, 290, 7, 86, 2, 2, 290, 82, 3, 2, 2, 2, | ||||
| 	291, 292, 7, 78, 2, 2, 292, 293, 7, 71, 2, 2, 293, 294, 7, 86, 2, 2, 294, | ||||
| 	84, 3, 2, 2, 2, 295, 296, 7, 69, 2, 2, 296, 297, 7, 81, 2, 2, 297, 298, | ||||
| 	7, 78, 2, 2, 298, 299, 7, 78, 2, 2, 299, 300, 7, 71, 2, 2, 300, 301, 7, | ||||
| 	69, 2, 2, 301, 302, 7, 86, 2, 2, 302, 86, 3, 2, 2, 2, 303, 304, 7, 67, | ||||
| 	2, 2, 304, 305, 7, 85, 2, 2, 305, 311, 7, 69, 2, 2, 306, 307, 7, 70, 2, | ||||
| 	2, 307, 308, 7, 71, 2, 2, 308, 309, 7, 85, 2, 2, 309, 311, 7, 69, 2, 2, | ||||
| 	310, 303, 3, 2, 2, 2, 310, 306, 3, 2, 2, 2, 311, 88, 3, 2, 2, 2, 312, 313, | ||||
| 	7, 80, 2, 2, 313, 314, 7, 81, 2, 2, 314, 315, 7, 80, 2, 2, 315, 316, 7, | ||||
| 	71, 2, 2, 316, 90, 3, 2, 2, 2, 317, 318, 7, 80, 2, 2, 318, 319, 7, 87, | ||||
| 	2, 2, 319, 320, 7, 78, 2, 2, 320, 321, 7, 78, 2, 2, 321, 92, 3, 2, 2, 2, | ||||
| 	322, 323, 7, 86, 2, 2, 323, 324, 7, 84, 2, 2, 324, 325, 7, 87, 2, 2, 325, | ||||
| 	341, 7, 71, 2, 2, 326, 327, 7, 118, 2, 2, 327, 328, 7, 116, 2, 2, 328, | ||||
| 	329, 7, 119, 2, 2, 329, 341, 7, 103, 2, 2, 330, 331, 7, 72, 2, 2, 331, | ||||
| 	332, 7, 67, 2, 2, 332, 333, 7, 78, 2, 2, 333, 334, 7, 85, 2, 2, 334, 341, | ||||
| 	7, 71, 2, 2, 335, 336, 7, 104, 2, 2, 336, 337, 7, 99, 2, 2, 337, 338, 7, | ||||
| 	110, 2, 2, 338, 339, 7, 117, 2, 2, 339, 341, 7, 103, 2, 2, 340, 322, 3, | ||||
| 	2, 2, 2, 340, 326, 3, 2, 2, 2, 340, 330, 3, 2, 2, 2, 340, 335, 3, 2, 2, | ||||
| 	2, 341, 94, 3, 2, 2, 2, 342, 343, 7, 75, 2, 2, 343, 344, 7, 80, 2, 2, 344, | ||||
| 	345, 7, 86, 2, 2, 345, 346, 7, 81, 2, 2, 346, 96, 3, 2, 2, 2, 347, 348, | ||||
| 	7, 77, 2, 2, 348, 349, 7, 71, 2, 2, 349, 350, 7, 71, 2, 2, 350, 351, 7, | ||||
| 	82, 2, 2, 351, 98, 3, 2, 2, 2, 352, 353, 7, 89, 2, 2, 353, 354, 7, 75, | ||||
| 	2, 2, 354, 355, 7, 86, 2, 2, 355, 356, 7, 74, 2, 2, 356, 100, 3, 2, 2, | ||||
| 	2, 357, 358, 7, 69, 2, 2, 358, 359, 7, 81, 2, 2, 359, 360, 7, 87, 2, 2, | ||||
| 	360, 361, 7, 80, 2, 2, 361, 362, 7, 86, 2, 2, 362, 102, 3, 2, 2, 2, 363, | ||||
| 	364, 7, 67, 2, 2, 364, 365, 7, 78, 2, 2, 365, 366, 7, 78, 2, 2, 366, 104, | ||||
| 	3, 2, 2, 2, 367, 368, 7, 67, 2, 2, 368, 369, 7, 80, 2, 2, 369, 370, 7, | ||||
| 	91, 2, 2, 370, 106, 3, 2, 2, 2, 371, 372, 7, 67, 2, 2, 372, 373, 7, 73, | ||||
| 	2, 2, 373, 374, 7, 73, 2, 2, 374, 375, 7, 84, 2, 2, 375, 376, 7, 71, 2, | ||||
| 	2, 376, 377, 7, 73, 2, 2, 377, 378, 7, 67, 2, 2, 378, 379, 7, 86, 2, 2, | ||||
| 	379, 380, 7, 71, 2, 2, 380, 108, 3, 2, 2, 2, 381, 382, 7, 78, 2, 2, 382, | ||||
| 	383, 7, 75, 2, 2, 383, 384, 7, 77, 2, 2, 384, 385, 7, 71, 2, 2, 385, 110, | ||||
| 	3, 2, 2, 2, 386, 387, 7, 80, 2, 2, 387, 388, 7, 81, 2, 2, 388, 391, 7, | ||||
| 	86, 2, 2, 389, 391, 7, 35, 2, 2, 390, 386, 3, 2, 2, 2, 390, 389, 3, 2, | ||||
| 	2, 2, 391, 112, 3, 2, 2, 2, 392, 393, 7, 75, 2, 2, 393, 394, 7, 80, 2, | ||||
| 	2, 394, 114, 3, 2, 2, 2, 395, 397, 5, 129, 65, 2, 396, 395, 3, 2, 2, 2, | ||||
| 	397, 398, 3, 2, 2, 2, 398, 396, 3, 2, 2, 2, 398, 399, 3, 2, 2, 2, 399, | ||||
| 	409, 3, 2, 2, 2, 400, 404, 5, 131, 66, 2, 401, 403, 5, 115, 58, 2, 402, | ||||
| 	401, 3, 2, 2, 2, 403, 406, 3, 2, 2, 2, 404, 402, 3, 2, 2, 2, 404, 405, | ||||
| 	3, 2, 2, 2, 405, 408, 3, 2, 2, 2, 406, 404, 3, 2, 2, 2, 407, 400, 3, 2, | ||||
| 	2, 2, 408, 411, 3, 2, 2, 2, 409, 407, 3, 2, 2, 2, 409, 410, 3, 2, 2, 2, | ||||
| 	410, 421, 3, 2, 2, 2, 411, 409, 3, 2, 2, 2, 412, 416, 5, 133, 67, 2, 413, | ||||
| 	415, 5, 115, 58, 2, 414, 413, 3, 2, 2, 2, 415, 418, 3, 2, 2, 2, 416, 414, | ||||
| 	3, 2, 2, 2, 416, 417, 3, 2, 2, 2, 417, 420, 3, 2, 2, 2, 418, 416, 3, 2, | ||||
| 	2, 2, 419, 412, 3, 2, 2, 2, 420, 423, 3, 2, 2, 2, 421, 419, 3, 2, 2, 2, | ||||
| 	421, 422, 3, 2, 2, 2, 422, 116, 3, 2, 2, 2, 423, 421, 3, 2, 2, 2, 424, | ||||
| 	427, 5, 137, 69, 2, 425, 427, 5, 135, 68, 2, 426, 424, 3, 2, 2, 2, 426, | ||||
| 	425, 3, 2, 2, 2, 427, 118, 3, 2, 2, 2, 428, 430, 9, 4, 2, 2, 429, 428, | ||||
| 	3, 2, 2, 2, 430, 431, 3, 2, 2, 2, 431, 429, 3, 2, 2, 2, 431, 432, 3, 2, | ||||
| 	2, 2, 432, 120, 3, 2, 2, 2, 433, 434, 5, 125, 63, 2, 434, 436, 5, 15, 8, | ||||
| 	2, 435, 437, 9, 4, 2, 2, 436, 435, 3, 2, 2, 2, 437, 438, 3, 2, 2, 2, 438, | ||||
| 	436, 3, 2, 2, 2, 438, 439, 3, 2, 2, 2, 439, 441, 3, 2, 2, 2, 440, 442, | ||||
| 	5, 127, 64, 2, 441, 440, 3, 2, 2, 2, 441, 442, 3, 2, 2, 2, 442, 448, 3, | ||||
| 	2, 2, 2, 443, 445, 5, 125, 63, 2, 444, 446, 5, 127, 64, 2, 445, 444, 3, | ||||
| 	2, 2, 2, 445, 446, 3, 2, 2, 2, 446, 448, 3, 2, 2, 2, 447, 433, 3, 2, 2, | ||||
| 	2, 447, 443, 3, 2, 2, 2, 448, 122, 3, 2, 2, 2, 449, 450, 9, 5, 2, 2, 450, | ||||
| 	124, 3, 2, 2, 2, 451, 460, 7, 50, 2, 2, 452, 456, 9, 6, 2, 2, 453, 455, | ||||
| 	9, 4, 2, 2, 454, 453, 3, 2, 2, 2, 455, 458, 3, 2, 2, 2, 456, 454, 3, 2, | ||||
| 	2, 2, 456, 457, 3, 2, 2, 2, 457, 460, 3, 2, 2, 2, 458, 456, 3, 2, 2, 2, | ||||
| 	459, 451, 3, 2, 2, 2, 459, 452, 3, 2, 2, 2, 460, 126, 3, 2, 2, 2, 461, | ||||
| 	463, 9, 7, 2, 2, 462, 464, 9, 8, 2, 2, 463, 462, 3, 2, 2, 2, 463, 464, | ||||
| 	3, 2, 2, 2, 464, 466, 3, 2, 2, 2, 465, 467, 9, 4, 2, 2, 466, 465, 3, 2, | ||||
| 	2, 2, 467, 468, 3, 2, 2, 2, 468, 466, 3, 2, 2, 2, 468, 469, 3, 2, 2, 2, | ||||
| 	469, 128, 3, 2, 2, 2, 470, 471, 9, 9, 2, 2, 471, 130, 3, 2, 2, 2, 472, | ||||
| 	473, 7, 97, 2, 2, 473, 132, 3, 2, 2, 2, 474, 475, 4, 50, 59, 2, 475, 134, | ||||
| 	3, 2, 2, 2, 476, 484, 7, 36, 2, 2, 477, 478, 7, 94, 2, 2, 478, 483, 11, | ||||
| 	2, 2, 2, 479, 480, 7, 36, 2, 2, 480, 483, 7, 36, 2, 2, 481, 483, 10, 10, | ||||
| 	2, 2, 482, 477, 3, 2, 2, 2, 482, 479, 3, 2, 2, 2, 482, 481, 3, 2, 2, 2, | ||||
| 	483, 486, 3, 2, 2, 2, 484, 482, 3, 2, 2, 2, 484, 485, 3, 2, 2, 2, 485, | ||||
| 	487, 3, 2, 2, 2, 486, 484, 3, 2, 2, 2, 487, 488, 7, 36, 2, 2, 488, 136, | ||||
| 	3, 2, 2, 2, 489, 497, 7, 41, 2, 2, 490, 491, 7, 94, 2, 2, 491, 496, 11, | ||||
| 	2, 2, 2, 492, 493, 7, 41, 2, 2, 493, 496, 7, 41, 2, 2, 494, 496, 10, 11, | ||||
| 	2, 2, 495, 490, 3, 2, 2, 2, 495, 492, 3, 2, 2, 2, 495, 494, 3, 2, 2, 2, | ||||
| 	496, 499, 3, 2, 2, 2, 497, 495, 3, 2, 2, 2, 497, 498, 3, 2, 2, 2, 498, | ||||
| 	500, 3, 2, 2, 2, 499, 497, 3, 2, 2, 2, 500, 501, 7, 41, 2, 2, 501, 138, | ||||
| 	3, 2, 2, 2, 30, 2, 145, 159, 167, 232, 238, 310, 340, 390, 398, 404, 409, | ||||
| 	416, 421, 426, 431, 438, 441, 445, 447, 456, 459, 463, 468, 482, 484, 495, | ||||
| 	497, 3, 2, 3, 2, | ||||
| 	9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, | ||||
| 	70, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 146, 10, 2, 12, 2, 14, 2, 149, 11, 2, | ||||
| 	3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 160, 10, 3, | ||||
| 	12, 3, 14, 3, 163, 11, 3, 3, 3, 3, 3, 3, 4, 6, 4, 168, 10, 4, 13, 4, 14, | ||||
| 	4, 169, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, | ||||
| 	8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, | ||||
| 	13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, | ||||
| 	3, 18, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, | ||||
| 	22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 26, | ||||
| 	3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 5, | ||||
| 	29, 235, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 241, 10, 30, 3, 31, | ||||
| 	3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 35, 3, | ||||
| 	35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, | ||||
| 	3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, | ||||
| 	38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, | ||||
| 	3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, | ||||
| 	42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, | ||||
| 	3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 5, 44, 313, 10, 44, 3, 45, 3, | ||||
| 	45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 47, 3, 47, | ||||
| 	3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, | ||||
| 	47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 5, 47, 343, 10, 47, 3, 48, 3, 48, | ||||
| 	3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, | ||||
| 	50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, | ||||
| 	3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, | ||||
| 	54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, | ||||
| 	3, 56, 3, 56, 3, 56, 3, 56, 5, 56, 393, 10, 56, 3, 57, 3, 57, 3, 57, 3, | ||||
| 	58, 3, 58, 3, 59, 6, 59, 401, 10, 59, 13, 59, 14, 59, 402, 3, 59, 3, 59, | ||||
| 	7, 59, 407, 10, 59, 12, 59, 14, 59, 410, 11, 59, 7, 59, 412, 10, 59, 12, | ||||
| 	59, 14, 59, 415, 11, 59, 3, 59, 3, 59, 7, 59, 419, 10, 59, 12, 59, 14, | ||||
| 	59, 422, 11, 59, 7, 59, 424, 10, 59, 12, 59, 14, 59, 427, 11, 59, 3, 60, | ||||
| 	3, 60, 5, 60, 431, 10, 60, 3, 61, 6, 61, 434, 10, 61, 13, 61, 14, 61, 435, | ||||
| 	3, 62, 3, 62, 3, 62, 6, 62, 441, 10, 62, 13, 62, 14, 62, 442, 3, 62, 5, | ||||
| 	62, 446, 10, 62, 3, 62, 3, 62, 5, 62, 450, 10, 62, 5, 62, 452, 10, 62, | ||||
| 	3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 7, 64, 459, 10, 64, 12, 64, 14, 64, | ||||
| 	462, 11, 64, 5, 64, 464, 10, 64, 3, 65, 3, 65, 5, 65, 468, 10, 65, 3, 65, | ||||
| 	6, 65, 471, 10, 65, 13, 65, 14, 65, 472, 3, 66, 3, 66, 3, 67, 3, 67, 3, | ||||
| 	68, 3, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 487, 10, 69, | ||||
| 	12, 69, 14, 69, 490, 11, 69, 3, 69, 3, 69, 3, 70, 3, 70, 3, 70, 3, 70, | ||||
| 	3, 70, 3, 70, 7, 70, 500, 10, 70, 12, 70, 14, 70, 503, 11, 70, 3, 70, 3, | ||||
| 	70, 3, 147, 2, 71, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, | ||||
| 	19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, | ||||
| 	37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, | ||||
| 	55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, | ||||
| 	73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, | ||||
| 	91, 47, 93, 48, 95, 49, 97, 50, 99, 51, 101, 52, 103, 53, 105, 54, 107, | ||||
| 	55, 109, 56, 111, 57, 113, 58, 115, 59, 117, 60, 119, 61, 121, 62, 123, | ||||
| 	63, 125, 2, 127, 2, 129, 2, 131, 2, 133, 2, 135, 2, 137, 2, 139, 2, 3, | ||||
| 	2, 12, 5, 2, 12, 12, 15, 15, 8234, 8235, 6, 2, 11, 11, 13, 14, 34, 34, | ||||
| 	162, 162, 3, 2, 50, 59, 5, 2, 50, 59, 67, 72, 99, 104, 3, 2, 51, 59, 4, | ||||
| 	2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 4, 2, 67, 92, 99, 124, 4, 2, | ||||
| 	36, 36, 94, 94, 4, 2, 41, 41, 94, 94, 2, 528, 2, 3, 3, 2, 2, 2, 2, 5, 3, | ||||
| 	2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, | ||||
| 	3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, | ||||
| 	21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, | ||||
| 	2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, | ||||
| 	2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, | ||||
| 	2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, | ||||
| 	2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, | ||||
| 	3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, | ||||
| 	67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, | ||||
| 	2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, | ||||
| 	2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, | ||||
| 	2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, | ||||
| 	2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, | ||||
| 	105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, | ||||
| 	2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, | ||||
| 	3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2, 123, 3, 2, 2, 2, 3, 141, 3, 2, 2, 2, | ||||
| 	5, 155, 3, 2, 2, 2, 7, 167, 3, 2, 2, 2, 9, 173, 3, 2, 2, 2, 11, 177, 3, | ||||
| 	2, 2, 2, 13, 179, 3, 2, 2, 2, 15, 181, 3, 2, 2, 2, 17, 183, 3, 2, 2, 2, | ||||
| 	19, 185, 3, 2, 2, 2, 21, 187, 3, 2, 2, 2, 23, 189, 3, 2, 2, 2, 25, 191, | ||||
| 	3, 2, 2, 2, 27, 193, 3, 2, 2, 2, 29, 195, 3, 2, 2, 2, 31, 197, 3, 2, 2, | ||||
| 	2, 33, 199, 3, 2, 2, 2, 35, 201, 3, 2, 2, 2, 37, 204, 3, 2, 2, 2, 39, 207, | ||||
| 	3, 2, 2, 2, 41, 210, 3, 2, 2, 2, 43, 213, 3, 2, 2, 2, 45, 215, 3, 2, 2, | ||||
| 	2, 47, 217, 3, 2, 2, 2, 49, 220, 3, 2, 2, 2, 51, 223, 3, 2, 2, 2, 53, 225, | ||||
| 	3, 2, 2, 2, 55, 227, 3, 2, 2, 2, 57, 234, 3, 2, 2, 2, 59, 240, 3, 2, 2, | ||||
| 	2, 61, 242, 3, 2, 2, 2, 63, 245, 3, 2, 2, 2, 65, 247, 3, 2, 2, 2, 67, 249, | ||||
| 	3, 2, 2, 2, 69, 252, 3, 2, 2, 2, 71, 255, 3, 2, 2, 2, 73, 259, 3, 2, 2, | ||||
| 	2, 75, 266, 3, 2, 2, 2, 77, 275, 3, 2, 2, 2, 79, 282, 3, 2, 2, 2, 81, 287, | ||||
| 	3, 2, 2, 2, 83, 293, 3, 2, 2, 2, 85, 297, 3, 2, 2, 2, 87, 312, 3, 2, 2, | ||||
| 	2, 89, 314, 3, 2, 2, 2, 91, 319, 3, 2, 2, 2, 93, 342, 3, 2, 2, 2, 95, 344, | ||||
| 	3, 2, 2, 2, 97, 349, 3, 2, 2, 2, 99, 354, 3, 2, 2, 2, 101, 359, 3, 2, 2, | ||||
| 	2, 103, 365, 3, 2, 2, 2, 105, 369, 3, 2, 2, 2, 107, 373, 3, 2, 2, 2, 109, | ||||
| 	383, 3, 2, 2, 2, 111, 392, 3, 2, 2, 2, 113, 394, 3, 2, 2, 2, 115, 397, | ||||
| 	3, 2, 2, 2, 117, 400, 3, 2, 2, 2, 119, 430, 3, 2, 2, 2, 121, 433, 3, 2, | ||||
| 	2, 2, 123, 451, 3, 2, 2, 2, 125, 453, 3, 2, 2, 2, 127, 463, 3, 2, 2, 2, | ||||
| 	129, 465, 3, 2, 2, 2, 131, 474, 3, 2, 2, 2, 133, 476, 3, 2, 2, 2, 135, | ||||
| 	478, 3, 2, 2, 2, 137, 480, 3, 2, 2, 2, 139, 493, 3, 2, 2, 2, 141, 142, | ||||
| 	7, 49, 2, 2, 142, 143, 7, 44, 2, 2, 143, 147, 3, 2, 2, 2, 144, 146, 11, | ||||
| 	2, 2, 2, 145, 144, 3, 2, 2, 2, 146, 149, 3, 2, 2, 2, 147, 148, 3, 2, 2, | ||||
| 	2, 147, 145, 3, 2, 2, 2, 148, 150, 3, 2, 2, 2, 149, 147, 3, 2, 2, 2, 150, | ||||
| 	151, 7, 44, 2, 2, 151, 152, 7, 49, 2, 2, 152, 153, 3, 2, 2, 2, 153, 154, | ||||
| 	8, 2, 2, 2, 154, 4, 3, 2, 2, 2, 155, 156, 7, 49, 2, 2, 156, 157, 7, 49, | ||||
| 	2, 2, 157, 161, 3, 2, 2, 2, 158, 160, 10, 2, 2, 2, 159, 158, 3, 2, 2, 2, | ||||
| 	160, 163, 3, 2, 2, 2, 161, 159, 3, 2, 2, 2, 161, 162, 3, 2, 2, 2, 162, | ||||
| 	164, 3, 2, 2, 2, 163, 161, 3, 2, 2, 2, 164, 165, 8, 3, 2, 2, 165, 6, 3, | ||||
| 	2, 2, 2, 166, 168, 9, 3, 2, 2, 167, 166, 3, 2, 2, 2, 168, 169, 3, 2, 2, | ||||
| 	2, 169, 167, 3, 2, 2, 2, 169, 170, 3, 2, 2, 2, 170, 171, 3, 2, 2, 2, 171, | ||||
| 	172, 8, 4, 2, 2, 172, 8, 3, 2, 2, 2, 173, 174, 9, 2, 2, 2, 174, 175, 3, | ||||
| 	2, 2, 2, 175, 176, 8, 5, 2, 2, 176, 10, 3, 2, 2, 2, 177, 178, 7, 60, 2, | ||||
| 	2, 178, 12, 3, 2, 2, 2, 179, 180, 7, 61, 2, 2, 180, 14, 3, 2, 2, 2, 181, | ||||
| 	182, 7, 48, 2, 2, 182, 16, 3, 2, 2, 2, 183, 184, 7, 46, 2, 2, 184, 18, | ||||
| 	3, 2, 2, 2, 185, 186, 7, 93, 2, 2, 186, 20, 3, 2, 2, 2, 187, 188, 7, 95, | ||||
| 	2, 2, 188, 22, 3, 2, 2, 2, 189, 190, 7, 42, 2, 2, 190, 24, 3, 2, 2, 2, | ||||
| 	191, 192, 7, 43, 2, 2, 192, 26, 3, 2, 2, 2, 193, 194, 7, 125, 2, 2, 194, | ||||
| 	28, 3, 2, 2, 2, 195, 196, 7, 127, 2, 2, 196, 30, 3, 2, 2, 2, 197, 198, | ||||
| 	7, 64, 2, 2, 198, 32, 3, 2, 2, 2, 199, 200, 7, 62, 2, 2, 200, 34, 3, 2, | ||||
| 	2, 2, 201, 202, 7, 63, 2, 2, 202, 203, 7, 63, 2, 2, 203, 36, 3, 2, 2, 2, | ||||
| 	204, 205, 7, 64, 2, 2, 205, 206, 7, 63, 2, 2, 206, 38, 3, 2, 2, 2, 207, | ||||
| 	208, 7, 62, 2, 2, 208, 209, 7, 63, 2, 2, 209, 40, 3, 2, 2, 2, 210, 211, | ||||
| 	7, 35, 2, 2, 211, 212, 7, 63, 2, 2, 212, 42, 3, 2, 2, 2, 213, 214, 7, 45, | ||||
| 	2, 2, 214, 44, 3, 2, 2, 2, 215, 216, 7, 47, 2, 2, 216, 46, 3, 2, 2, 2, | ||||
| 	217, 218, 7, 47, 2, 2, 218, 219, 7, 47, 2, 2, 219, 48, 3, 2, 2, 2, 220, | ||||
| 	221, 7, 45, 2, 2, 221, 222, 7, 45, 2, 2, 222, 50, 3, 2, 2, 2, 223, 224, | ||||
| 	7, 44, 2, 2, 224, 52, 3, 2, 2, 2, 225, 226, 7, 49, 2, 2, 226, 54, 3, 2, | ||||
| 	2, 2, 227, 228, 7, 39, 2, 2, 228, 56, 3, 2, 2, 2, 229, 230, 7, 67, 2, 2, | ||||
| 	230, 231, 7, 80, 2, 2, 231, 235, 7, 70, 2, 2, 232, 233, 7, 40, 2, 2, 233, | ||||
| 	235, 7, 40, 2, 2, 234, 229, 3, 2, 2, 2, 234, 232, 3, 2, 2, 2, 235, 58, | ||||
| 	3, 2, 2, 2, 236, 237, 7, 81, 2, 2, 237, 241, 7, 84, 2, 2, 238, 239, 7, | ||||
| 	126, 2, 2, 239, 241, 7, 126, 2, 2, 240, 236, 3, 2, 2, 2, 240, 238, 3, 2, | ||||
| 	2, 2, 241, 60, 3, 2, 2, 2, 242, 243, 5, 15, 8, 2, 243, 244, 5, 15, 8, 2, | ||||
| 	244, 62, 3, 2, 2, 2, 245, 246, 7, 63, 2, 2, 246, 64, 3, 2, 2, 2, 247, 248, | ||||
| 	7, 65, 2, 2, 248, 66, 3, 2, 2, 2, 249, 250, 7, 35, 2, 2, 250, 251, 7, 128, | ||||
| 	2, 2, 251, 68, 3, 2, 2, 2, 252, 253, 7, 63, 2, 2, 253, 254, 7, 128, 2, | ||||
| 	2, 254, 70, 3, 2, 2, 2, 255, 256, 7, 72, 2, 2, 256, 257, 7, 81, 2, 2, 257, | ||||
| 	258, 7, 84, 2, 2, 258, 72, 3, 2, 2, 2, 259, 260, 7, 84, 2, 2, 260, 261, | ||||
| 	7, 71, 2, 2, 261, 262, 7, 86, 2, 2, 262, 263, 7, 87, 2, 2, 263, 264, 7, | ||||
| 	84, 2, 2, 264, 265, 7, 80, 2, 2, 265, 74, 3, 2, 2, 2, 266, 267, 7, 70, | ||||
| 	2, 2, 267, 268, 7, 75, 2, 2, 268, 269, 7, 85, 2, 2, 269, 270, 7, 86, 2, | ||||
| 	2, 270, 271, 7, 75, 2, 2, 271, 272, 7, 80, 2, 2, 272, 273, 7, 69, 2, 2, | ||||
| 	273, 274, 7, 86, 2, 2, 274, 76, 3, 2, 2, 2, 275, 276, 7, 72, 2, 2, 276, | ||||
| 	277, 7, 75, 2, 2, 277, 278, 7, 78, 2, 2, 278, 279, 7, 86, 2, 2, 279, 280, | ||||
| 	7, 71, 2, 2, 280, 281, 7, 84, 2, 2, 281, 78, 3, 2, 2, 2, 282, 283, 7, 85, | ||||
| 	2, 2, 283, 284, 7, 81, 2, 2, 284, 285, 7, 84, 2, 2, 285, 286, 7, 86, 2, | ||||
| 	2, 286, 80, 3, 2, 2, 2, 287, 288, 7, 78, 2, 2, 288, 289, 7, 75, 2, 2, 289, | ||||
| 	290, 7, 79, 2, 2, 290, 291, 7, 75, 2, 2, 291, 292, 7, 86, 2, 2, 292, 82, | ||||
| 	3, 2, 2, 2, 293, 294, 7, 78, 2, 2, 294, 295, 7, 71, 2, 2, 295, 296, 7, | ||||
| 	86, 2, 2, 296, 84, 3, 2, 2, 2, 297, 298, 7, 69, 2, 2, 298, 299, 7, 81, | ||||
| 	2, 2, 299, 300, 7, 78, 2, 2, 300, 301, 7, 78, 2, 2, 301, 302, 7, 71, 2, | ||||
| 	2, 302, 303, 7, 69, 2, 2, 303, 304, 7, 86, 2, 2, 304, 86, 3, 2, 2, 2, 305, | ||||
| 	306, 7, 67, 2, 2, 306, 307, 7, 85, 2, 2, 307, 313, 7, 69, 2, 2, 308, 309, | ||||
| 	7, 70, 2, 2, 309, 310, 7, 71, 2, 2, 310, 311, 7, 85, 2, 2, 311, 313, 7, | ||||
| 	69, 2, 2, 312, 305, 3, 2, 2, 2, 312, 308, 3, 2, 2, 2, 313, 88, 3, 2, 2, | ||||
| 	2, 314, 315, 7, 80, 2, 2, 315, 316, 7, 81, 2, 2, 316, 317, 7, 80, 2, 2, | ||||
| 	317, 318, 7, 71, 2, 2, 318, 90, 3, 2, 2, 2, 319, 320, 7, 80, 2, 2, 320, | ||||
| 	321, 7, 87, 2, 2, 321, 322, 7, 78, 2, 2, 322, 323, 7, 78, 2, 2, 323, 92, | ||||
| 	3, 2, 2, 2, 324, 325, 7, 86, 2, 2, 325, 326, 7, 84, 2, 2, 326, 327, 7, | ||||
| 	87, 2, 2, 327, 343, 7, 71, 2, 2, 328, 329, 7, 118, 2, 2, 329, 330, 7, 116, | ||||
| 	2, 2, 330, 331, 7, 119, 2, 2, 331, 343, 7, 103, 2, 2, 332, 333, 7, 72, | ||||
| 	2, 2, 333, 334, 7, 67, 2, 2, 334, 335, 7, 78, 2, 2, 335, 336, 7, 85, 2, | ||||
| 	2, 336, 343, 7, 71, 2, 2, 337, 338, 7, 104, 2, 2, 338, 339, 7, 99, 2, 2, | ||||
| 	339, 340, 7, 110, 2, 2, 340, 341, 7, 117, 2, 2, 341, 343, 7, 103, 2, 2, | ||||
| 	342, 324, 3, 2, 2, 2, 342, 328, 3, 2, 2, 2, 342, 332, 3, 2, 2, 2, 342, | ||||
| 	337, 3, 2, 2, 2, 343, 94, 3, 2, 2, 2, 344, 345, 7, 75, 2, 2, 345, 346, | ||||
| 	7, 80, 2, 2, 346, 347, 7, 86, 2, 2, 347, 348, 7, 81, 2, 2, 348, 96, 3, | ||||
| 	2, 2, 2, 349, 350, 7, 77, 2, 2, 350, 351, 7, 71, 2, 2, 351, 352, 7, 71, | ||||
| 	2, 2, 352, 353, 7, 82, 2, 2, 353, 98, 3, 2, 2, 2, 354, 355, 7, 89, 2, 2, | ||||
| 	355, 356, 7, 75, 2, 2, 356, 357, 7, 86, 2, 2, 357, 358, 7, 74, 2, 2, 358, | ||||
| 	100, 3, 2, 2, 2, 359, 360, 7, 69, 2, 2, 360, 361, 7, 81, 2, 2, 361, 362, | ||||
| 	7, 87, 2, 2, 362, 363, 7, 80, 2, 2, 363, 364, 7, 86, 2, 2, 364, 102, 3, | ||||
| 	2, 2, 2, 365, 366, 7, 67, 2, 2, 366, 367, 7, 78, 2, 2, 367, 368, 7, 78, | ||||
| 	2, 2, 368, 104, 3, 2, 2, 2, 369, 370, 7, 67, 2, 2, 370, 371, 7, 80, 2, | ||||
| 	2, 371, 372, 7, 91, 2, 2, 372, 106, 3, 2, 2, 2, 373, 374, 7, 67, 2, 2, | ||||
| 	374, 375, 7, 73, 2, 2, 375, 376, 7, 73, 2, 2, 376, 377, 7, 84, 2, 2, 377, | ||||
| 	378, 7, 71, 2, 2, 378, 379, 7, 73, 2, 2, 379, 380, 7, 67, 2, 2, 380, 381, | ||||
| 	7, 86, 2, 2, 381, 382, 7, 71, 2, 2, 382, 108, 3, 2, 2, 2, 383, 384, 7, | ||||
| 	78, 2, 2, 384, 385, 7, 75, 2, 2, 385, 386, 7, 77, 2, 2, 386, 387, 7, 71, | ||||
| 	2, 2, 387, 110, 3, 2, 2, 2, 388, 389, 7, 80, 2, 2, 389, 390, 7, 81, 2, | ||||
| 	2, 390, 393, 7, 86, 2, 2, 391, 393, 7, 35, 2, 2, 392, 388, 3, 2, 2, 2, | ||||
| 	392, 391, 3, 2, 2, 2, 393, 112, 3, 2, 2, 2, 394, 395, 7, 75, 2, 2, 395, | ||||
| 	396, 7, 80, 2, 2, 396, 114, 3, 2, 2, 2, 397, 398, 7, 66, 2, 2, 398, 116, | ||||
| 	3, 2, 2, 2, 399, 401, 5, 131, 66, 2, 400, 399, 3, 2, 2, 2, 401, 402, 3, | ||||
| 	2, 2, 2, 402, 400, 3, 2, 2, 2, 402, 403, 3, 2, 2, 2, 403, 413, 3, 2, 2, | ||||
| 	2, 404, 408, 5, 133, 67, 2, 405, 407, 5, 117, 59, 2, 406, 405, 3, 2, 2, | ||||
| 	2, 407, 410, 3, 2, 2, 2, 408, 406, 3, 2, 2, 2, 408, 409, 3, 2, 2, 2, 409, | ||||
| 	412, 3, 2, 2, 2, 410, 408, 3, 2, 2, 2, 411, 404, 3, 2, 2, 2, 412, 415, | ||||
| 	3, 2, 2, 2, 413, 411, 3, 2, 2, 2, 413, 414, 3, 2, 2, 2, 414, 425, 3, 2, | ||||
| 	2, 2, 415, 413, 3, 2, 2, 2, 416, 420, 5, 135, 68, 2, 417, 419, 5, 117, | ||||
| 	59, 2, 418, 417, 3, 2, 2, 2, 419, 422, 3, 2, 2, 2, 420, 418, 3, 2, 2, 2, | ||||
| 	420, 421, 3, 2, 2, 2, 421, 424, 3, 2, 2, 2, 422, 420, 3, 2, 2, 2, 423, | ||||
| 	416, 3, 2, 2, 2, 424, 427, 3, 2, 2, 2, 425, 423, 3, 2, 2, 2, 425, 426, | ||||
| 	3, 2, 2, 2, 426, 118, 3, 2, 2, 2, 427, 425, 3, 2, 2, 2, 428, 431, 5, 139, | ||||
| 	70, 2, 429, 431, 5, 137, 69, 2, 430, 428, 3, 2, 2, 2, 430, 429, 3, 2, 2, | ||||
| 	2, 431, 120, 3, 2, 2, 2, 432, 434, 9, 4, 2, 2, 433, 432, 3, 2, 2, 2, 434, | ||||
| 	435, 3, 2, 2, 2, 435, 433, 3, 2, 2, 2, 435, 436, 3, 2, 2, 2, 436, 122, | ||||
| 	3, 2, 2, 2, 437, 438, 5, 127, 64, 2, 438, 440, 5, 15, 8, 2, 439, 441, 9, | ||||
| 	4, 2, 2, 440, 439, 3, 2, 2, 2, 441, 442, 3, 2, 2, 2, 442, 440, 3, 2, 2, | ||||
| 	2, 442, 443, 3, 2, 2, 2, 443, 445, 3, 2, 2, 2, 444, 446, 5, 129, 65, 2, | ||||
| 	445, 444, 3, 2, 2, 2, 445, 446, 3, 2, 2, 2, 446, 452, 3, 2, 2, 2, 447, | ||||
| 	449, 5, 127, 64, 2, 448, 450, 5, 129, 65, 2, 449, 448, 3, 2, 2, 2, 449, | ||||
| 	450, 3, 2, 2, 2, 450, 452, 3, 2, 2, 2, 451, 437, 3, 2, 2, 2, 451, 447, | ||||
| 	3, 2, 2, 2, 452, 124, 3, 2, 2, 2, 453, 454, 9, 5, 2, 2, 454, 126, 3, 2, | ||||
| 	2, 2, 455, 464, 7, 50, 2, 2, 456, 460, 9, 6, 2, 2, 457, 459, 9, 4, 2, 2, | ||||
| 	458, 457, 3, 2, 2, 2, 459, 462, 3, 2, 2, 2, 460, 458, 3, 2, 2, 2, 460, | ||||
| 	461, 3, 2, 2, 2, 461, 464, 3, 2, 2, 2, 462, 460, 3, 2, 2, 2, 463, 455, | ||||
| 	3, 2, 2, 2, 463, 456, 3, 2, 2, 2, 464, 128, 3, 2, 2, 2, 465, 467, 9, 7, | ||||
| 	2, 2, 466, 468, 9, 8, 2, 2, 467, 466, 3, 2, 2, 2, 467, 468, 3, 2, 2, 2, | ||||
| 	468, 470, 3, 2, 2, 2, 469, 471, 9, 4, 2, 2, 470, 469, 3, 2, 2, 2, 471, | ||||
| 	472, 3, 2, 2, 2, 472, 470, 3, 2, 2, 2, 472, 473, 3, 2, 2, 2, 473, 130, | ||||
| 	3, 2, 2, 2, 474, 475, 9, 9, 2, 2, 475, 132, 3, 2, 2, 2, 476, 477, 7, 97, | ||||
| 	2, 2, 477, 134, 3, 2, 2, 2, 478, 479, 4, 50, 59, 2, 479, 136, 3, 2, 2, | ||||
| 	2, 480, 488, 7, 36, 2, 2, 481, 482, 7, 94, 2, 2, 482, 487, 11, 2, 2, 2, | ||||
| 	483, 484, 7, 36, 2, 2, 484, 487, 7, 36, 2, 2, 485, 487, 10, 10, 2, 2, 486, | ||||
| 	481, 3, 2, 2, 2, 486, 483, 3, 2, 2, 2, 486, 485, 3, 2, 2, 2, 487, 490, | ||||
| 	3, 2, 2, 2, 488, 486, 3, 2, 2, 2, 488, 489, 3, 2, 2, 2, 489, 491, 3, 2, | ||||
| 	2, 2, 490, 488, 3, 2, 2, 2, 491, 492, 7, 36, 2, 2, 492, 138, 3, 2, 2, 2, | ||||
| 	493, 501, 7, 41, 2, 2, 494, 495, 7, 94, 2, 2, 495, 500, 11, 2, 2, 2, 496, | ||||
| 	497, 7, 41, 2, 2, 497, 500, 7, 41, 2, 2, 498, 500, 10, 11, 2, 2, 499, 494, | ||||
| 	3, 2, 2, 2, 499, 496, 3, 2, 2, 2, 499, 498, 3, 2, 2, 2, 500, 503, 3, 2, | ||||
| 	2, 2, 501, 499, 3, 2, 2, 2, 501, 502, 3, 2, 2, 2, 502, 504, 3, 2, 2, 2, | ||||
| 	503, 501, 3, 2, 2, 2, 504, 505, 7, 41, 2, 2, 505, 140, 3, 2, 2, 2, 30, | ||||
| 	2, 147, 161, 169, 234, 240, 312, 342, 392, 402, 408, 413, 420, 425, 430, | ||||
| 	435, 442, 445, 449, 451, 460, 463, 467, 472, 486, 488, 499, 501, 3, 2, | ||||
| 	3, 2, | ||||
| } | ||||
|  | ||||
| var lexerDeserializer = antlr.NewATNDeserializer(nil) | ||||
| @@ -257,7 +259,7 @@ var lexerLiteralNames = []string{ | ||||
| 	"'--'", "'++'", "'*'", "'/'", "'%'", "", "", "", "'='", "'?'", "'!~'", | ||||
| 	"'=~'", "'FOR'", "'RETURN'", "'DISTINCT'", "'FILTER'", "'SORT'", "'LIMIT'", | ||||
| 	"'LET'", "'COLLECT'", "", "'NONE'", "'NULL'", "", "'INTO'", "'KEEP'", "'WITH'", | ||||
| 	"'COUNT'", "'ALL'", "'ANY'", "'AGGREGATE'", "'LIKE'", "", "'IN'", | ||||
| 	"'COUNT'", "'ALL'", "'ANY'", "'AGGREGATE'", "'LIKE'", "", "'IN'", "'@'", | ||||
| } | ||||
|  | ||||
| var lexerSymbolicNames = []string{ | ||||
| @@ -268,7 +270,7 @@ var lexerSymbolicNames = []string{ | ||||
| 	"And", "Or", "Range", "Assign", "QuestionMark", "RegexNotMatch", "RegexMatch", | ||||
| 	"For", "Return", "Distinct", "Filter", "Sort", "Limit", "Let", "Collect", | ||||
| 	"SortDirection", "None", "Null", "BooleanLiteral", "Into", "Keep", "With", | ||||
| 	"Count", "All", "Any", "Aggregate", "Like", "Not", "In", "Identifier", | ||||
| 	"Count", "All", "Any", "Aggregate", "Like", "Not", "In", "Param", "Identifier", | ||||
| 	"StringLiteral", "IntegerLiteral", "FloatLiteral", | ||||
| } | ||||
|  | ||||
| @@ -280,7 +282,7 @@ var lexerRuleNames = []string{ | ||||
| 	"And", "Or", "Range", "Assign", "QuestionMark", "RegexNotMatch", "RegexMatch", | ||||
| 	"For", "Return", "Distinct", "Filter", "Sort", "Limit", "Let", "Collect", | ||||
| 	"SortDirection", "None", "Null", "BooleanLiteral", "Into", "Keep", "With", | ||||
| 	"Count", "All", "Any", "Aggregate", "Like", "Not", "In", "Identifier", | ||||
| 	"Count", "All", "Any", "Aggregate", "Like", "Not", "In", "Param", "Identifier", | ||||
| 	"StringLiteral", "IntegerLiteral", "FloatLiteral", "HexDigit", "DecimalIntegerLiteral", | ||||
| 	"ExponentPart", "Letter", "Symbols", "Digit", "DQSring", "SQString", | ||||
| } | ||||
| @@ -376,8 +378,9 @@ const ( | ||||
| 	FqlLexerLike              = 54 | ||||
| 	FqlLexerNot               = 55 | ||||
| 	FqlLexerIn                = 56 | ||||
| 	FqlLexerIdentifier        = 57 | ||||
| 	FqlLexerStringLiteral     = 58 | ||||
| 	FqlLexerIntegerLiteral    = 59 | ||||
| 	FqlLexerFloatLiteral      = 60 | ||||
| 	FqlLexerParam             = 57 | ||||
| 	FqlLexerIdentifier        = 58 | ||||
| 	FqlLexerStringLiteral     = 59 | ||||
| 	FqlLexerIntegerLiteral    = 60 | ||||
| 	FqlLexerFloatLiteral      = 61 | ||||
| ) | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -174,6 +174,12 @@ func (s *BaseFqlParserListener) EnterVariableDeclaration(ctx *VariableDeclaratio | ||||
| // ExitVariableDeclaration is called when production variableDeclaration is exited. | ||||
| func (s *BaseFqlParserListener) ExitVariableDeclaration(ctx *VariableDeclarationContext) {} | ||||
|  | ||||
| // EnterParam is called when production param is entered. | ||||
| func (s *BaseFqlParserListener) EnterParam(ctx *ParamContext) {} | ||||
|  | ||||
| // ExitParam is called when production param is exited. | ||||
| func (s *BaseFqlParserListener) ExitParam(ctx *ParamContext) {} | ||||
|  | ||||
| // EnterVariable is called when production variable is entered. | ||||
| func (s *BaseFqlParserListener) EnterVariable(ctx *VariableContext) {} | ||||
|  | ||||
|   | ||||
| @@ -107,6 +107,10 @@ func (v *BaseFqlParserVisitor) VisitVariableDeclaration(ctx *VariableDeclaration | ||||
| 	return v.VisitChildren(ctx) | ||||
| } | ||||
|  | ||||
| func (v *BaseFqlParserVisitor) VisitParam(ctx *ParamContext) interface{} { | ||||
| 	return v.VisitChildren(ctx) | ||||
| } | ||||
|  | ||||
| func (v *BaseFqlParserVisitor) VisitVariable(ctx *VariableContext) interface{} { | ||||
| 	return v.VisitChildren(ctx) | ||||
| } | ||||
|   | ||||
| @@ -82,6 +82,9 @@ type FqlParserListener interface { | ||||
| 	// EnterVariableDeclaration is called when entering the variableDeclaration production. | ||||
| 	EnterVariableDeclaration(c *VariableDeclarationContext) | ||||
|  | ||||
| 	// EnterParam is called when entering the param production. | ||||
| 	EnterParam(c *ParamContext) | ||||
|  | ||||
| 	// EnterVariable is called when entering the variable production. | ||||
| 	EnterVariable(c *VariableContext) | ||||
|  | ||||
| @@ -229,6 +232,9 @@ type FqlParserListener interface { | ||||
| 	// ExitVariableDeclaration is called when exiting the variableDeclaration production. | ||||
| 	ExitVariableDeclaration(c *VariableDeclarationContext) | ||||
|  | ||||
| 	// ExitParam is called when exiting the param production. | ||||
| 	ExitParam(c *ParamContext) | ||||
|  | ||||
| 	// ExitVariable is called when exiting the variable production. | ||||
| 	ExitVariable(c *VariableContext) | ||||
|  | ||||
|   | ||||
| @@ -82,6 +82,9 @@ type FqlParserVisitor interface { | ||||
| 	// Visit a parse tree produced by FqlParser#variableDeclaration. | ||||
| 	VisitVariableDeclaration(ctx *VariableDeclarationContext) interface{} | ||||
|  | ||||
| 	// Visit a parse tree produced by FqlParser#param. | ||||
| 	VisitParam(ctx *ParamContext) interface{} | ||||
|  | ||||
| 	// Visit a parse tree produced by FqlParser#variable. | ||||
| 	VisitVariable(ctx *VariableContext) interface{} | ||||
|  | ||||
|   | ||||
							
								
								
									
										37
									
								
								pkg/runtime/core/param.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								pkg/runtime/core/param.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,37 @@ | ||||
| package core | ||||
|  | ||||
| import "context" | ||||
|  | ||||
| const paramsKey = "params" | ||||
|  | ||||
| func ParamsWith(ctx context.Context, params map[string]Value) context.Context { | ||||
| 	return context.WithValue(ctx, paramsKey, params) | ||||
| } | ||||
|  | ||||
| func ParamsFrom(ctx context.Context) (map[string]Value, error) { | ||||
| 	val := ctx.Value(paramsKey) | ||||
|  | ||||
| 	param, ok := val.(map[string]Value) | ||||
|  | ||||
| 	if !ok { | ||||
| 		return nil, Error(ErrNotFound, "parameters") | ||||
| 	} | ||||
|  | ||||
| 	return param, nil | ||||
| } | ||||
|  | ||||
| func ParamFrom(ctx context.Context, name string) (Value, error) { | ||||
| 	params, err := ParamsFrom(ctx) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
|  | ||||
| 	param, found := params[name] | ||||
|  | ||||
| 	if !found { | ||||
| 		return nil, Error(ErrNotFound, "parameter."+name) | ||||
| 	} | ||||
|  | ||||
| 	return param, nil | ||||
| } | ||||
							
								
								
									
										47
									
								
								pkg/runtime/expressions/param.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								pkg/runtime/expressions/param.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,47 @@ | ||||
| package expressions | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"github.com/MontFerret/ferret/pkg/runtime/collections" | ||||
| 	"github.com/MontFerret/ferret/pkg/runtime/core" | ||||
| 	"github.com/MontFerret/ferret/pkg/runtime/values" | ||||
| ) | ||||
|  | ||||
| type ParameterExpression struct { | ||||
| 	src  core.SourceMap | ||||
| 	name string | ||||
| } | ||||
|  | ||||
| func NewParameterExpression(src core.SourceMap, name string) (*ParameterExpression, error) { | ||||
| 	if name == "" { | ||||
| 		return nil, core.Error(core.ErrMissedArgument, "name") | ||||
| 	} | ||||
|  | ||||
| 	return &ParameterExpression{src, name}, nil | ||||
| } | ||||
|  | ||||
| func (e *ParameterExpression) Iterate(ctx context.Context, scope *core.Scope) (collections.Iterator, error) { | ||||
| 	value, err := e.Exec(ctx, scope) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return nil, core.SourceError(e.src, err) | ||||
| 	} | ||||
|  | ||||
| 	iter, err := collections.ToIterator(value) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return nil, core.SourceError(e.src, err) | ||||
| 	} | ||||
|  | ||||
| 	return iter, nil | ||||
| } | ||||
|  | ||||
| func (e *ParameterExpression) Exec(ctx context.Context, scope *core.Scope) (core.Value, error) { | ||||
| 	param, err := core.ParamFrom(ctx, e.name) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return values.None, core.SourceError(e.src, err) | ||||
| 	} | ||||
|  | ||||
| 	return param, nil | ||||
| } | ||||
| @@ -2,10 +2,19 @@ package logging | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"github.com/gofrs/uuid" | ||||
| 	"github.com/rs/zerolog" | ||||
| 	"io" | ||||
| ) | ||||
|  | ||||
| type Level uint8 | ||||
| type ( | ||||
| 	Level uint8 | ||||
|  | ||||
| 	Options struct { | ||||
| 		Writer io.Writer | ||||
| 		Level  Level | ||||
| 	} | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| 	DebugLevel Level = iota | ||||
| @@ -18,6 +27,23 @@ const ( | ||||
| 	Disabled | ||||
| ) | ||||
|  | ||||
| func From(ctx context.Context) *zerolog.Logger { | ||||
| func WithContext(ctx context.Context, opts *Options) context.Context { | ||||
| 	id, err := uuid.NewV4() | ||||
|  | ||||
| 	if err != nil { | ||||
| 		panic(err) | ||||
| 	} | ||||
|  | ||||
| 	logger := zerolog.New(opts.Writer). | ||||
| 		With(). | ||||
| 		Str("id", id.String()). | ||||
| 		Logger() | ||||
|  | ||||
| 	logger.WithLevel(zerolog.Level(opts.Level)) | ||||
|  | ||||
| 	return logger.WithContext(ctx) | ||||
| } | ||||
|  | ||||
| func FromContext(ctx context.Context) *zerolog.Logger { | ||||
| 	return zerolog.Ctx(ctx) | ||||
| } | ||||
|   | ||||
| @@ -2,20 +2,19 @@ package runtime | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"github.com/MontFerret/ferret/pkg/runtime/core" | ||||
| 	"github.com/MontFerret/ferret/pkg/runtime/logging" | ||||
| 	"github.com/gofrs/uuid" | ||||
| 	"github.com/rs/zerolog" | ||||
| 	"github.com/MontFerret/ferret/pkg/runtime/values" | ||||
| 	"io" | ||||
| 	"os" | ||||
| ) | ||||
|  | ||||
| type ( | ||||
| 	Options struct { | ||||
| 		proxy     string | ||||
| 		cdp       string | ||||
| 		variables map[string]interface{} | ||||
| 		logWriter io.Writer | ||||
| 		logLevel  zerolog.Level | ||||
| 		proxy   string | ||||
| 		cdp     string | ||||
| 		params  map[string]core.Value | ||||
| 		logging *logging.Options | ||||
| 	} | ||||
|  | ||||
| 	Option func(*Options) | ||||
| @@ -23,16 +22,26 @@ type ( | ||||
|  | ||||
| func newOptions() *Options { | ||||
| 	return &Options{ | ||||
| 		cdp:       "http://0.0.0.0:9222", | ||||
| 		variables: make(map[string]interface{}), | ||||
| 		logWriter: os.Stdout, | ||||
| 		logLevel:  zerolog.ErrorLevel, | ||||
| 		cdp:    "http://0.0.0.0:9222", | ||||
| 		params: make(map[string]core.Value), | ||||
| 		logging: &logging.Options{ | ||||
| 			Writer: os.Stdout, | ||||
| 			Level:  logging.ErrorLevel, | ||||
| 		}, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func WithParam(name string, value interface{}) Option { | ||||
| 	return func(options *Options) { | ||||
| 		options.variables[name] = value | ||||
| 		options.params[name] = values.Parse(value) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func WithParams(params map[string]interface{}) Option { | ||||
| 	return func(options *Options) { | ||||
| 		for name, value := range params { | ||||
| 			options.params[name] = values.Parse(value) | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @@ -51,36 +60,19 @@ func WithProxy(address string) Option { | ||||
|  | ||||
| func WithLog(writer io.Writer) Option { | ||||
| 	return func(options *Options) { | ||||
| 		options.logWriter = writer | ||||
| 		options.logging.Writer = writer | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func WithLogLevel(lvl logging.Level) Option { | ||||
| 	return func(options *Options) { | ||||
| 		options.logLevel = zerolog.Level(lvl) | ||||
| 		options.logging.Level = lvl | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func (opts *Options) withContext(parent context.Context) context.Context { | ||||
| 	ctx := context.WithValue( | ||||
| 		parent, | ||||
| 		"variables", | ||||
| 		opts.variables, | ||||
| 	) | ||||
|  | ||||
| 	id, err := uuid.NewV4() | ||||
|  | ||||
| 	if err != nil { | ||||
| 		panic(err) | ||||
| 	} | ||||
|  | ||||
| 	logger := zerolog.New(opts.logWriter). | ||||
| 		With(). | ||||
| 		Str("id", id.String()). | ||||
| 		Logger() | ||||
| 	logger.WithLevel(opts.logLevel) | ||||
|  | ||||
| 	ctx = logger.WithContext(ctx) | ||||
| 	ctx := core.ParamsWith(parent, opts.params) | ||||
| 	ctx = logging.WithContext(ctx, opts.logging) | ||||
|  | ||||
| 	return ctx | ||||
| } | ||||
|   | ||||
| @@ -3,6 +3,7 @@ package values | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"github.com/MontFerret/ferret/pkg/runtime/core" | ||||
| 	"reflect" | ||||
| 	"time" | ||||
| ) | ||||
|  | ||||
| @@ -214,9 +215,53 @@ func Parse(input interface{}) core.Value { | ||||
| 		return obj | ||||
| 	case []byte: | ||||
| 		return NewBinary(input.([]byte)) | ||||
| 	} | ||||
| 	default: | ||||
| 		v := reflect.ValueOf(input) | ||||
| 		t := reflect.TypeOf(input) | ||||
| 		kind := t.Kind() | ||||
|  | ||||
| 	return None | ||||
| 		if kind == reflect.Slice || kind == reflect.Array { | ||||
| 			size := v.Len() | ||||
| 			arr := NewArray(size) | ||||
|  | ||||
| 			for i := 0; i < size; i += 1 { | ||||
| 				value := v.Index(i) | ||||
| 				arr.Push(Parse(value.Interface())) | ||||
| 			} | ||||
|  | ||||
| 			return arr | ||||
| 		} | ||||
|  | ||||
| 		if kind == reflect.Map { | ||||
| 			keys := v.MapKeys() | ||||
| 			obj := NewObject() | ||||
|  | ||||
| 			for _, k := range keys { | ||||
| 				key := Parse(k.Interface()) | ||||
| 				value := v.MapIndex(k) | ||||
|  | ||||
| 				obj.Set(NewString(key.String()), Parse(value.Interface())) | ||||
| 			} | ||||
|  | ||||
| 			return obj | ||||
| 		} | ||||
|  | ||||
| 		if kind == reflect.Struct { | ||||
| 			obj := NewObject() | ||||
| 			size := t.NumField() | ||||
|  | ||||
| 			for i := 0; i < size; i += 1 { | ||||
| 				field := t.Field(i) | ||||
| 				value := v.Field(i) | ||||
|  | ||||
| 				obj.Set(NewString(field.Name), Parse(value.Interface())) | ||||
| 			} | ||||
|  | ||||
| 			return obj | ||||
| 		} | ||||
|  | ||||
| 		return None | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func Unmarshal(value json.RawMessage) (core.Value, error) { | ||||
|   | ||||
| @@ -97,7 +97,7 @@ func LoadHtmlDocument( | ||||
| 	} | ||||
|  | ||||
| 	return NewHtmlDocument( | ||||
| 		logging.From(ctx), | ||||
| 		logging.FromContext(ctx), | ||||
| 		conn, | ||||
| 		client, | ||||
| 		broker, | ||||
|   | ||||
| @@ -37,7 +37,7 @@ func Log(ctx context.Context, inputs ...core.Value) (core.Value, error) { | ||||
| 		args = append(args, input) | ||||
| 	} | ||||
|  | ||||
| 	logger := logging.From(ctx) | ||||
| 	logger := logging.FromContext(ctx) | ||||
|  | ||||
| 	logger.Print(args...) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user