Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FluxTestPackages = []*ast.Package{&ast.Package{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: nil, }, Files: []*ast.File{&ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "package dict_test\n\n\nimport \"testing\"\nimport \"dict\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ncodes1 = dict.fromList(pairs: [{key: \"internal\", value: 0}, {key: \"invalid\", value: 1}, {key: \"unknown\", value: 3}])\ncodes2 = dict.remove(dict: codes1, key: \"unknown\")\ncodes3 = dict.insert(dict: codes2, key: \"unimplemented\", value: 2)\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,string\n#group,false,false,false,true,true,true,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,error_type,_value\n,,0,2018-05-22T19:53:26Z,requests,error,internal,some internal error\n,,0,2018-05-22T19:53:36Z,requests,error,internal,another internal error\n,,1,2018-05-22T19:53:46Z,requests,error,invalid,unknown parameter\n,,1,2018-05-22T19:53:56Z,requests,error,invalid,cannot use duration as value\n,,2,2018-05-22T19:54:06Z,requests,error,unimplemented,implement me\n,,2,2018-05-22T19:54:16Z,requests,error,unimplemented,not implemented\n,,3,2018-05-22T19:53:26Z,requests,error,unknown,unknown error\n,,3,2018-05-22T19:53:36Z,requests,error,unknown,network error\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,string,long,long,long\n#group,false,false,false,true,true,true,false,false,false,false\n#default,_result,,,,,,,,,\n,result,table,_time,_measurement,_field,error_type,_value,error_code1,error_code2,error_code3\n,,0,2018-05-22T19:53:26Z,requests,error,internal,some internal error,0,0,0\n,,0,2018-05-22T19:53:36Z,requests,error,internal,another internal error,0,0,0\n,,1,2018-05-22T19:53:46Z,requests,error,invalid,unknown parameter,1,1,1\n,,1,2018-05-22T19:53:56Z,requests,error,invalid,cannot use duration as value,1,1,1\n,,2,2018-05-22T19:54:06Z,requests,error,unimplemented,implement me,-1,-1,2\n,,2,2018-05-22T19:54:16Z,requests,error,unimplemented,not implemented,-1,-1,2\n,,3,2018-05-22T19:53:26Z,requests,error,unknown,unknown error,3,-1,-1\n,,3,2018-05-22T19:53:36Z,requests,error,unknown,network error,3,-1,-1\n\"\nt_dict = (table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(\n fn: (r) => {\n error_code1 = dict.get(dict: codes1, key: r.error_type, default: -1)\n error_code2 = dict.get(dict: codes2, key: r.error_type, default: -1)\n error_code3 = dict.get(dict: codes3, key: r.error_type, default: -1)\n \n return {r with error_code1: error_code1, error_code2: error_code2, error_code3: error_code3}\n },\n )\n\ntest _dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "dict_insert_remove_test.flux", Source: "now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 8, Line: 7, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 7, }, File: "dict_insert_remove_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 7, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "dict_insert_remove_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "dict_insert_remove_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "dict_insert_remove_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 117, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "codes1 = dict.fromList(pairs: [{key: \"internal\", value: 0}, {key: \"invalid\", value: 1}, {key: \"unknown\", value: 3}])", Start: ast.Position{ Column: 1, Line: 9, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "codes1", Start: ast.Position{ Column: 1, Line: 9, }, }, }, Name: "codes1", }, Init: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 116, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "pairs: [{key: \"internal\", value: 0}, {key: \"invalid\", value: 1}, {key: \"unknown\", value: 3}]", Start: ast.Position{ Column: 24, Line: 9, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 116, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "pairs: [{key: \"internal\", value: 0}, {key: \"invalid\", value: 1}, {key: \"unknown\", value: 3}]", Start: ast.Position{ Column: 24, Line: 9, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "pairs", Start: ast.Position{ Column: 24, Line: 9, }, }, }, Name: "pairs", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 116, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "[{key: \"internal\", value: 0}, {key: \"invalid\", value: 1}, {key: \"unknown\", value: 3}]", Start: ast.Position{ Column: 31, Line: 9, }, }, }, Elements: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "{key: \"internal\", value: 0}", Start: ast.Position{ Column: 32, Line: 9, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "key: \"internal\"", Start: ast.Position{ Column: 33, Line: 9, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "key", Start: ast.Position{ Column: 33, Line: 9, }, }, }, Name: "key", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "\"internal\"", Start: ast.Position{ Column: 38, Line: 9, }, }, }, Value: "internal", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "value: 0", Start: ast.Position{ Column: 50, Line: 9, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "value", Start: ast.Position{ Column: 50, Line: 9, }, }, }, Name: "value", }, Separator: nil, Value: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "0", Start: ast.Position{ Column: 57, Line: 9, }, }, }, Value: int64(0), }, }}, Rbrace: nil, With: nil, }, &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "{key: \"invalid\", value: 1}", Start: ast.Position{ Column: 61, Line: 9, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "key: \"invalid\"", Start: ast.Position{ Column: 62, Line: 9, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "key", Start: ast.Position{ Column: 62, Line: 9, }, }, }, Name: "key", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "\"invalid\"", Start: ast.Position{ Column: 67, Line: 9, }, }, }, Value: "invalid", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 86, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "value: 1", Start: ast.Position{ Column: 78, Line: 9, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "value", Start: ast.Position{ Column: 78, Line: 9, }, }, }, Name: "value", }, Separator: nil, Value: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 86, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "1", Start: ast.Position{ Column: 85, Line: 9, }, }, }, Value: int64(1), }, }}, Rbrace: nil, With: nil, }, &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 115, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "{key: \"unknown\", value: 3}", Start: ast.Position{ Column: 89, Line: 9, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "key: \"unknown\"", Start: ast.Position{ Column: 90, Line: 9, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 93, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "key", Start: ast.Position{ Column: 90, Line: 9, }, }, }, Name: "key", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "\"unknown\"", Start: ast.Position{ Column: 95, Line: 9, }, }, }, Value: "unknown", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 114, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "value: 3", Start: ast.Position{ Column: 106, Line: 9, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 111, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "value", Start: ast.Position{ Column: 106, Line: 9, }, }, }, Name: "value", }, Separator: nil, Value: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 114, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "3", Start: ast.Position{ Column: 113, Line: 9, }, }, }, Value: int64(3), }, }}, Rbrace: nil, With: nil, }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 117, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "dict.fromList(pairs: [{key: \"internal\", value: 0}, {key: \"invalid\", value: 1}, {key: \"unknown\", value: 3}])", Start: ast.Position{ Column: 10, Line: 9, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "dict.fromList", Start: ast.Position{ Column: 10, Line: 9, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "dict", Start: ast.Position{ Column: 10, Line: 9, }, }, }, Name: "dict", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 9, }, File: "dict_insert_remove_test.flux", Source: "fromList", Start: ast.Position{ Column: 15, Line: 9, }, }, }, Name: "fromList", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 10, }, File: "dict_insert_remove_test.flux", Source: "codes2 = dict.remove(dict: codes1, key: \"unknown\")", Start: ast.Position{ Column: 1, Line: 10, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 10, }, File: "dict_insert_remove_test.flux", Source: "codes2", Start: ast.Position{ Column: 1, Line: 10, }, }, }, Name: "codes2", }, Init: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 10, }, File: "dict_insert_remove_test.flux", Source: "dict: codes1, key: \"unknown\"", Start: ast.Position{ Column: 22, Line: 10, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 10, }, File: "dict_insert_remove_test.flux", Source: "dict: codes1", Start: ast.Position{ Column: 22, Line: 10, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 10, }, File: "dict_insert_remove_test.flux", Source: "dict", Start: ast.Position{ Column: 22, Line: 10, }, }, }, Name: "dict", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 10, }, File: "dict_insert_remove_test.flux", Source: "codes1", Start: ast.Position{ Column: 28, Line: 10, }, }, }, Name: "codes1", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 10, }, File: "dict_insert_remove_test.flux", Source: "key: \"unknown\"", Start: ast.Position{ Column: 36, Line: 10, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 10, }, File: "dict_insert_remove_test.flux", Source: "key", Start: ast.Position{ Column: 36, Line: 10, }, }, }, Name: "key", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 10, }, File: "dict_insert_remove_test.flux", Source: "\"unknown\"", Start: ast.Position{ Column: 41, Line: 10, }, }, }, Value: "unknown", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 10, }, File: "dict_insert_remove_test.flux", Source: "dict.remove(dict: codes1, key: \"unknown\")", Start: ast.Position{ Column: 10, Line: 10, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 10, }, File: "dict_insert_remove_test.flux", Source: "dict.remove", Start: ast.Position{ Column: 10, Line: 10, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 10, }, File: "dict_insert_remove_test.flux", Source: "dict", Start: ast.Position{ Column: 10, Line: 10, }, }, }, Name: "dict", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 10, }, File: "dict_insert_remove_test.flux", Source: "remove", Start: ast.Position{ Column: 15, Line: 10, }, }, }, Name: "remove", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 11, }, File: "dict_insert_remove_test.flux", Source: "codes3 = dict.insert(dict: codes2, key: \"unimplemented\", value: 2)", Start: ast.Position{ Column: 1, Line: 11, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 11, }, File: "dict_insert_remove_test.flux", Source: "codes3", Start: ast.Position{ Column: 1, Line: 11, }, }, }, Name: "codes3", }, Init: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 11, }, File: "dict_insert_remove_test.flux", Source: "dict: codes2, key: \"unimplemented\", value: 2", Start: ast.Position{ Column: 22, Line: 11, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 11, }, File: "dict_insert_remove_test.flux", Source: "dict: codes2", Start: ast.Position{ Column: 22, Line: 11, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 11, }, File: "dict_insert_remove_test.flux", Source: "dict", Start: ast.Position{ Column: 22, Line: 11, }, }, }, Name: "dict", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 11, }, File: "dict_insert_remove_test.flux", Source: "codes2", Start: ast.Position{ Column: 28, Line: 11, }, }, }, Name: "codes2", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 11, }, File: "dict_insert_remove_test.flux", Source: "key: \"unimplemented\"", Start: ast.Position{ Column: 36, Line: 11, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 11, }, File: "dict_insert_remove_test.flux", Source: "key", Start: ast.Position{ Column: 36, Line: 11, }, }, }, Name: "key", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 11, }, File: "dict_insert_remove_test.flux", Source: "\"unimplemented\"", Start: ast.Position{ Column: 41, Line: 11, }, }, }, Value: "unimplemented", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 11, }, File: "dict_insert_remove_test.flux", Source: "value: 2", Start: ast.Position{ Column: 58, Line: 11, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 11, }, File: "dict_insert_remove_test.flux", Source: "value", Start: ast.Position{ Column: 58, Line: 11, }, }, }, Name: "value", }, Separator: nil, Value: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 11, }, File: "dict_insert_remove_test.flux", Source: "2", Start: ast.Position{ Column: 65, Line: 11, }, }, }, Value: int64(2), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 11, }, File: "dict_insert_remove_test.flux", Source: "dict.insert(dict: codes2, key: \"unimplemented\", value: 2)", Start: ast.Position{ Column: 10, Line: 11, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 11, }, File: "dict_insert_remove_test.flux", Source: "dict.insert", Start: ast.Position{ Column: 10, Line: 11, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 11, }, File: "dict_insert_remove_test.flux", Source: "dict", Start: ast.Position{ Column: 10, Line: 11, }, }, }, Name: "dict", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 11, }, File: "dict_insert_remove_test.flux", Source: "insert", Start: ast.Position{ Column: 15, Line: 11, }, }, }, Name: "insert", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "dict_insert_remove_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,string\n#group,false,false,false,true,true,true,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,error_type,_value\n,,0,2018-05-22T19:53:26Z,requests,error,internal,some internal error\n,,0,2018-05-22T19:53:36Z,requests,error,internal,another internal error\n,,1,2018-05-22T19:53:46Z,requests,error,invalid,unknown parameter\n,,1,2018-05-22T19:53:56Z,requests,error,invalid,cannot use duration as value\n,,2,2018-05-22T19:54:06Z,requests,error,unimplemented,implement me\n,,2,2018-05-22T19:54:16Z,requests,error,unimplemented,not implemented\n,,3,2018-05-22T19:53:26Z,requests,error,unknown,unknown error\n,,3,2018-05-22T19:53:36Z,requests,error,unknown,network error\n\"", Start: ast.Position{ Column: 1, Line: 12, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 12, }, File: "dict_insert_remove_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 12, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "dict_insert_remove_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,string,string\n#group,false,false,false,true,true,true,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,error_type,_value\n,,0,2018-05-22T19:53:26Z,requests,error,internal,some internal error\n,,0,2018-05-22T19:53:36Z,requests,error,internal,another internal error\n,,1,2018-05-22T19:53:46Z,requests,error,invalid,unknown parameter\n,,1,2018-05-22T19:53:56Z,requests,error,invalid,cannot use duration as value\n,,2,2018-05-22T19:54:06Z,requests,error,unimplemented,implement me\n,,2,2018-05-22T19:54:16Z,requests,error,unimplemented,not implemented\n,,3,2018-05-22T19:53:26Z,requests,error,unknown,unknown error\n,,3,2018-05-22T19:53:36Z,requests,error,unknown,network error\n\"", Start: ast.Position{ Column: 10, Line: 12, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,string,string\n#group,false,false,false,true,true,true,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,error_type,_value\n,,0,2018-05-22T19:53:26Z,requests,error,internal,some internal error\n,,0,2018-05-22T19:53:36Z,requests,error,internal,another internal error\n,,1,2018-05-22T19:53:46Z,requests,error,invalid,unknown parameter\n,,1,2018-05-22T19:53:56Z,requests,error,invalid,cannot use duration as value\n,,2,2018-05-22T19:54:06Z,requests,error,unimplemented,implement me\n,,2,2018-05-22T19:54:16Z,requests,error,unimplemented,not implemented\n,,3,2018-05-22T19:53:26Z,requests,error,unknown,unknown error\n,,3,2018-05-22T19:53:36Z,requests,error,unknown,network error\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 39, }, File: "dict_insert_remove_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,string,long,long,long\n#group,false,false,false,true,true,true,false,false,false,false\n#default,_result,,,,,,,,,\n,result,table,_time,_measurement,_field,error_type,_value,error_code1,error_code2,error_code3\n,,0,2018-05-22T19:53:26Z,requests,error,internal,some internal error,0,0,0\n,,0,2018-05-22T19:53:36Z,requests,error,internal,another internal error,0,0,0\n,,1,2018-05-22T19:53:46Z,requests,error,invalid,unknown parameter,1,1,1\n,,1,2018-05-22T19:53:56Z,requests,error,invalid,cannot use duration as value,1,1,1\n,,2,2018-05-22T19:54:06Z,requests,error,unimplemented,implement me,-1,-1,2\n,,2,2018-05-22T19:54:16Z,requests,error,unimplemented,not implemented,-1,-1,2\n,,3,2018-05-22T19:53:26Z,requests,error,unknown,unknown error,3,-1,-1\n,,3,2018-05-22T19:53:36Z,requests,error,unknown,network error,3,-1,-1\n\"", Start: ast.Position{ Column: 1, Line: 26, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 26, }, File: "dict_insert_remove_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 26, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 39, }, File: "dict_insert_remove_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,string,string,long,long,long\n#group,false,false,false,true,true,true,false,false,false,false\n#default,_result,,,,,,,,,\n,result,table,_time,_measurement,_field,error_type,_value,error_code1,error_code2,error_code3\n,,0,2018-05-22T19:53:26Z,requests,error,internal,some internal error,0,0,0\n,,0,2018-05-22T19:53:36Z,requests,error,internal,another internal error,0,0,0\n,,1,2018-05-22T19:53:46Z,requests,error,invalid,unknown parameter,1,1,1\n,,1,2018-05-22T19:53:56Z,requests,error,invalid,cannot use duration as value,1,1,1\n,,2,2018-05-22T19:54:06Z,requests,error,unimplemented,implement me,-1,-1,2\n,,2,2018-05-22T19:54:16Z,requests,error,unimplemented,not implemented,-1,-1,2\n,,3,2018-05-22T19:53:26Z,requests,error,unknown,unknown error,3,-1,-1\n,,3,2018-05-22T19:53:36Z,requests,error,unknown,network error,3,-1,-1\n\"", Start: ast.Position{ Column: 11, Line: 26, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,string,string,long,long,long\n#group,false,false,false,true,true,true,false,false,false,false\n#default,_result,,,,,,,,,\n,result,table,_time,_measurement,_field,error_type,_value,error_code1,error_code2,error_code3\n,,0,2018-05-22T19:53:26Z,requests,error,internal,some internal error,0,0,0\n,,0,2018-05-22T19:53:36Z,requests,error,internal,another internal error,0,0,0\n,,1,2018-05-22T19:53:46Z,requests,error,invalid,unknown parameter,1,1,1\n,,1,2018-05-22T19:53:56Z,requests,error,invalid,cannot use duration as value,1,1,1\n,,2,2018-05-22T19:54:06Z,requests,error,unimplemented,implement me,-1,-1,2\n,,2,2018-05-22T19:54:16Z,requests,error,unimplemented,not implemented,-1,-1,2\n,,3,2018-05-22T19:53:26Z,requests,error,unknown,unknown error,3,-1,-1\n,,3,2018-05-22T19:53:36Z,requests,error,unknown,network error,3,-1,-1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 51, }, File: "dict_insert_remove_test.flux", Source: "t_dict = (table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(\n fn: (r) => {\n error_code1 = dict.get(dict: codes1, key: r.error_type, default: -1)\n error_code2 = dict.get(dict: codes2, key: r.error_type, default: -1)\n error_code3 = dict.get(dict: codes3, key: r.error_type, default: -1)\n \n return {r with error_code1: error_code1, error_code2: error_code2, error_code3: error_code3}\n },\n )", Start: ast.Position{ Column: 1, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 40, }, File: "dict_insert_remove_test.flux", Source: "t_dict", Start: ast.Position{ Column: 1, Line: 40, }, }, }, Name: "t_dict", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 51, }, File: "dict_insert_remove_test.flux", Source: "(table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(\n fn: (r) => {\n error_code1 = dict.get(dict: codes1, key: r.error_type, default: -1)\n error_code2 = dict.get(dict: codes2, key: r.error_type, default: -1)\n error_code3 = dict.get(dict: codes3, key: r.error_type, default: -1)\n \n return {r with error_code1: error_code1, error_code2: error_code2, error_code3: error_code3}\n },\n )", Start: ast.Position{ Column: 10, Line: 40, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 40, }, File: "dict_insert_remove_test.flux", Source: "table", Start: ast.Position{ Column: 24, Line: 40, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "dict_insert_remove_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)", Start: ast.Position{ Column: 24, Line: 40, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 41, }, File: "dict_insert_remove_test.flux", Source: "start: 2018-05-22T19:53:26Z", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 41, }, File: "dict_insert_remove_test.flux", Source: "start: 2018-05-22T19:53:26Z", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 41, }, File: "dict_insert_remove_test.flux", Source: "start", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 41, }, File: "dict_insert_remove_test.flux", Source: "2018-05-22T19:53:26Z", Start: ast.Position{ Column: 21, Line: 41, }, }, }, Value: parser.MustParseTime("2018-05-22T19:53:26Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "dict_insert_remove_test.flux", Source: "range(start: 2018-05-22T19:53:26Z)", Start: ast.Position{ Column: 8, Line: 41, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 41, }, File: "dict_insert_remove_test.flux", Source: "range", Start: ast.Position{ Column: 8, Line: 41, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 42, }, File: "dict_insert_remove_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 24, Line: 40, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 42, }, File: "dict_insert_remove_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 13, Line: 42, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 42, }, File: "dict_insert_remove_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 13, Line: 42, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 42, }, File: "dict_insert_remove_test.flux", Source: "columns", Start: ast.Position{ Column: 13, Line: 42, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 42, }, File: "dict_insert_remove_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 22, Line: 42, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 42, }, File: "dict_insert_remove_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 23, Line: 42, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 42, }, File: "dict_insert_remove_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 33, Line: 42, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 42, }, File: "dict_insert_remove_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 8, Line: 42, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 42, }, File: "dict_insert_remove_test.flux", Source: "drop", Start: ast.Position{ Column: 8, Line: 42, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 51, }, File: "dict_insert_remove_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(\n fn: (r) => {\n error_code1 = dict.get(dict: codes1, key: r.error_type, default: -1)\n error_code2 = dict.get(dict: codes2, key: r.error_type, default: -1)\n error_code3 = dict.get(dict: codes3, key: r.error_type, default: -1)\n \n return {r with error_code1: error_code1, error_code2: error_code2, error_code3: error_code3}\n },\n )", Start: ast.Position{ Column: 24, Line: 40, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 50, }, File: "dict_insert_remove_test.flux", Source: "fn: (r) => {\n error_code1 = dict.get(dict: codes1, key: r.error_type, default: -1)\n error_code2 = dict.get(dict: codes2, key: r.error_type, default: -1)\n error_code3 = dict.get(dict: codes3, key: r.error_type, default: -1)\n \n return {r with error_code1: error_code1, error_code2: error_code2, error_code3: error_code3}\n }", Start: ast.Position{ Column: 9, Line: 44, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 50, }, File: "dict_insert_remove_test.flux", Source: "fn: (r) => {\n error_code1 = dict.get(dict: codes1, key: r.error_type, default: -1)\n error_code2 = dict.get(dict: codes2, key: r.error_type, default: -1)\n error_code3 = dict.get(dict: codes3, key: r.error_type, default: -1)\n \n return {r with error_code1: error_code1, error_code2: error_code2, error_code3: error_code3}\n }", Start: ast.Position{ Column: 9, Line: 44, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 44, }, File: "dict_insert_remove_test.flux", Source: "fn", Start: ast.Position{ Column: 9, Line: 44, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 50, }, File: "dict_insert_remove_test.flux", Source: "(r) => {\n error_code1 = dict.get(dict: codes1, key: r.error_type, default: -1)\n error_code2 = dict.get(dict: codes2, key: r.error_type, default: -1)\n error_code3 = dict.get(dict: codes3, key: r.error_type, default: -1)\n \n return {r with error_code1: error_code1, error_code2: error_code2, error_code3: error_code3}\n }", Start: ast.Position{ Column: 13, Line: 44, }, }, }, Body: &ast.Block{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 50, }, File: "dict_insert_remove_test.flux", Source: "{\n error_code1 = dict.get(dict: codes1, key: r.error_type, default: -1)\n error_code2 = dict.get(dict: codes2, key: r.error_type, default: -1)\n error_code3 = dict.get(dict: codes3, key: r.error_type, default: -1)\n \n return {r with error_code1: error_code1, error_code2: error_code2, error_code3: error_code3}\n }", Start: ast.Position{ Column: 20, Line: 44, }, }, }, Body: []ast.Statement{&ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "error_code1 = dict.get(dict: codes1, key: r.error_type, default: -1)", Start: ast.Position{ Column: 13, Line: 45, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "error_code1", Start: ast.Position{ Column: 13, Line: 45, }, }, }, Name: "error_code1", }, Init: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "dict: codes1, key: r.error_type, default: -1", Start: ast.Position{ Column: 36, Line: 45, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "dict: codes1", Start: ast.Position{ Column: 36, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "dict", Start: ast.Position{ Column: 36, Line: 45, }, }, }, Name: "dict", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "codes1", Start: ast.Position{ Column: 42, Line: 45, }, }, }, Name: "codes1", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "key: r.error_type", Start: ast.Position{ Column: 50, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "key", Start: ast.Position{ Column: 50, Line: 45, }, }, }, Name: "key", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "r.error_type", Start: ast.Position{ Column: 55, Line: 45, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "r", Start: ast.Position{ Column: 55, Line: 45, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "error_type", Start: ast.Position{ Column: 57, Line: 45, }, }, }, Name: "error_type", }, Rbrack: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "default: -1", Start: ast.Position{ Column: 69, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "default", Start: ast.Position{ Column: 69, Line: 45, }, }, }, Name: "default", }, Separator: nil, Value: &ast.UnaryExpression{ Argument: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "1", Start: ast.Position{ Column: 79, Line: 45, }, }, }, Value: int64(1), }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "-1", Start: ast.Position{ Column: 78, Line: 45, }, }, }, Operator: 6, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "dict.get(dict: codes1, key: r.error_type, default: -1)", Start: ast.Position{ Column: 27, Line: 45, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "dict.get", Start: ast.Position{ Column: 27, Line: 45, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "dict", Start: ast.Position{ Column: 27, Line: 45, }, }, }, Name: "dict", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 45, }, File: "dict_insert_remove_test.flux", Source: "get", Start: ast.Position{ Column: 32, Line: 45, }, }, }, Name: "get", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "error_code2 = dict.get(dict: codes2, key: r.error_type, default: -1)", Start: ast.Position{ Column: 13, Line: 46, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "error_code2", Start: ast.Position{ Column: 13, Line: 46, }, }, }, Name: "error_code2", }, Init: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "dict: codes2, key: r.error_type, default: -1", Start: ast.Position{ Column: 36, Line: 46, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "dict: codes2", Start: ast.Position{ Column: 36, Line: 46, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "dict", Start: ast.Position{ Column: 36, Line: 46, }, }, }, Name: "dict", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "codes2", Start: ast.Position{ Column: 42, Line: 46, }, }, }, Name: "codes2", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "key: r.error_type", Start: ast.Position{ Column: 50, Line: 46, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "key", Start: ast.Position{ Column: 50, Line: 46, }, }, }, Name: "key", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "r.error_type", Start: ast.Position{ Column: 55, Line: 46, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "r", Start: ast.Position{ Column: 55, Line: 46, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "error_type", Start: ast.Position{ Column: 57, Line: 46, }, }, }, Name: "error_type", }, Rbrack: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "default: -1", Start: ast.Position{ Column: 69, Line: 46, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "default", Start: ast.Position{ Column: 69, Line: 46, }, }, }, Name: "default", }, Separator: nil, Value: &ast.UnaryExpression{ Argument: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "1", Start: ast.Position{ Column: 79, Line: 46, }, }, }, Value: int64(1), }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "-1", Start: ast.Position{ Column: 78, Line: 46, }, }, }, Operator: 6, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "dict.get(dict: codes2, key: r.error_type, default: -1)", Start: ast.Position{ Column: 27, Line: 46, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "dict.get", Start: ast.Position{ Column: 27, Line: 46, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "dict", Start: ast.Position{ Column: 27, Line: 46, }, }, }, Name: "dict", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 46, }, File: "dict_insert_remove_test.flux", Source: "get", Start: ast.Position{ Column: 32, Line: 46, }, }, }, Name: "get", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "error_code3 = dict.get(dict: codes3, key: r.error_type, default: -1)", Start: ast.Position{ Column: 13, Line: 47, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "error_code3", Start: ast.Position{ Column: 13, Line: 47, }, }, }, Name: "error_code3", }, Init: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "dict: codes3, key: r.error_type, default: -1", Start: ast.Position{ Column: 36, Line: 47, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "dict: codes3", Start: ast.Position{ Column: 36, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "dict", Start: ast.Position{ Column: 36, Line: 47, }, }, }, Name: "dict", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "codes3", Start: ast.Position{ Column: 42, Line: 47, }, }, }, Name: "codes3", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "key: r.error_type", Start: ast.Position{ Column: 50, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "key", Start: ast.Position{ Column: 50, Line: 47, }, }, }, Name: "key", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "r.error_type", Start: ast.Position{ Column: 55, Line: 47, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "r", Start: ast.Position{ Column: 55, Line: 47, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "error_type", Start: ast.Position{ Column: 57, Line: 47, }, }, }, Name: "error_type", }, Rbrack: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "default: -1", Start: ast.Position{ Column: 69, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "default", Start: ast.Position{ Column: 69, Line: 47, }, }, }, Name: "default", }, Separator: nil, Value: &ast.UnaryExpression{ Argument: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "1", Start: ast.Position{ Column: 79, Line: 47, }, }, }, Value: int64(1), }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "-1", Start: ast.Position{ Column: 78, Line: 47, }, }, }, Operator: 6, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "dict.get(dict: codes3, key: r.error_type, default: -1)", Start: ast.Position{ Column: 27, Line: 47, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "dict.get", Start: ast.Position{ Column: 27, Line: 47, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "dict", Start: ast.Position{ Column: 27, Line: 47, }, }, }, Name: "dict", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 47, }, File: "dict_insert_remove_test.flux", Source: "get", Start: ast.Position{ Column: 32, Line: 47, }, }, }, Name: "get", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.ReturnStatement{ Argument: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 49, }, File: "dict_insert_remove_test.flux", Source: "{r with error_code1: error_code1, error_code2: error_code2, error_code3: error_code3}", Start: ast.Position{ Column: 20, Line: 49, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 49, }, File: "dict_insert_remove_test.flux", Source: "error_code1: error_code1", Start: ast.Position{ Column: 28, Line: 49, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 49, }, File: "dict_insert_remove_test.flux", Source: "error_code1", Start: ast.Position{ Column: 28, Line: 49, }, }, }, Name: "error_code1", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 49, }, File: "dict_insert_remove_test.flux", Source: "error_code1", Start: ast.Position{ Column: 41, Line: 49, }, }, }, Name: "error_code1", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 49, }, File: "dict_insert_remove_test.flux", Source: "error_code2: error_code2", Start: ast.Position{ Column: 54, Line: 49, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 49, }, File: "dict_insert_remove_test.flux", Source: "error_code2", Start: ast.Position{ Column: 54, Line: 49, }, }, }, Name: "error_code2", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 49, }, File: "dict_insert_remove_test.flux", Source: "error_code2", Start: ast.Position{ Column: 67, Line: 49, }, }, }, Name: "error_code2", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 49, }, File: "dict_insert_remove_test.flux", Source: "error_code3: error_code3", Start: ast.Position{ Column: 80, Line: 49, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 91, Line: 49, }, File: "dict_insert_remove_test.flux", Source: "error_code3", Start: ast.Position{ Column: 80, Line: 49, }, }, }, Name: "error_code3", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 49, }, File: "dict_insert_remove_test.flux", Source: "error_code3", Start: ast.Position{ Column: 93, Line: 49, }, }, }, Name: "error_code3", }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 49, }, File: "dict_insert_remove_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 49, }, }, }, Name: "r", }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 49, }, File: "dict_insert_remove_test.flux", Source: "return {r with error_code1: error_code1, error_code2: error_code2, error_code3: error_code3}", Start: ast.Position{ Column: 13, Line: 49, }, }, }, }}, Lbrace: nil, Rbrace: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 44, }, File: "dict_insert_remove_test.flux", Source: "r", Start: ast.Position{ Column: 14, Line: 44, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 44, }, File: "dict_insert_remove_test.flux", Source: "r", Start: ast.Position{ Column: 14, Line: 44, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 51, }, File: "dict_insert_remove_test.flux", Source: "map(\n fn: (r) => {\n error_code1 = dict.get(dict: codes1, key: r.error_type, default: -1)\n error_code2 = dict.get(dict: codes2, key: r.error_type, default: -1)\n error_code3 = dict.get(dict: codes3, key: r.error_type, default: -1)\n \n return {r with error_code1: error_code1, error_code2: error_code2, error_code3: error_code3}\n },\n )", Start: ast.Position{ Column: 8, Line: 43, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 43, }, File: "dict_insert_remove_test.flux", Source: "map", Start: ast.Position{ Column: 8, Line: 43, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 40, }, File: "dict_insert_remove_test.flux", Source: "table=<-", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 40, }, File: "dict_insert_remove_test.flux", Source: "table", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 40, }, File: "dict_insert_remove_test.flux", Source: "<-", Start: ast.Position{ Column: 17, Line: 40, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "_dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 6, Line: 53, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "_dict", Start: ast.Position{ Column: 6, Line: 53, }, }, }, Name: "_dict", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "() => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 14, Line: 53, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 20, Line: 53, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 111, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict}", Start: ast.Position{ Column: 21, Line: 53, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 22, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "input", Start: ast.Position{ Column: 22, Line: 53, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 49, Line: 53, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 49, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "csv", Start: ast.Position{ Column: 49, Line: 53, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "inData", Start: ast.Position{ Column: 54, Line: 53, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 29, Line: 53, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 29, Line: 53, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "testing", Start: ast.Position{ Column: 29, Line: 53, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 37, Line: 53, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 63, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "want", Start: ast.Position{ Column: 63, Line: 53, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 85, Line: 53, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 85, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "csv", Start: ast.Position{ Column: 85, Line: 53, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "outData", Start: ast.Position{ Column: 90, Line: 53, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 69, Line: 53, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 69, Line: 53, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "testing", Start: ast.Position{ Column: 69, Line: 53, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "loadMem", Start: ast.Position{ Column: 77, Line: 53, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "fn: t_dict", Start: ast.Position{ Column: 100, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "fn", Start: ast.Position{ Column: 100, Line: 53, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "t_dict", Start: ast.Position{ Column: 104, Line: 53, }, }, }, Name: "t_dict", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 53, }, File: "dict_insert_remove_test.flux", Source: "test _dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 1, Line: 53, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "dict_insert_remove_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "dict_insert_remove_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "dict_insert_remove_test.flux", Source: "import \"dict\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "dict_insert_remove_test.flux", Source: "\"dict\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "dict", }, }}, Metadata: "parser-type=rust", Name: "dict_insert_remove_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "dict_insert_remove_test.flux", Source: "package dict_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "dict_insert_remove_test.flux", Source: "dict_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "dict_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "package dict_test\n\n\nimport \"testing\"\nimport \"dict\"\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:26Z,_m,_f,0\n,,0,2018-05-22T19:53:36Z,_m,_f,1\n,,0,2018-05-22T19:53:46Z,_m,_f,2\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long,string\n#group,false,false,false,true,true,false,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,_value,code\n,,0,2018-05-22T19:53:26Z,_m,_f,0,a\n,,0,2018-05-22T19:53:36Z,_m,_f,1,b\n,,0,2018-05-22T19:53:46Z,_m,_f,2,c\n\"\nt_dict = (table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(\n fn: (r) => {\n codes = [0: \"a\", 1: \"b\"]\n \n return {r with code: dict.get(dict: codes, key: r._value, default: \"c\")}\n },\n )\n\ntest _dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 15, }, File: "dict_lit_lambda_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:26Z,_m,_f,0\n,,0,2018-05-22T19:53:36Z,_m,_f,1\n,,0,2018-05-22T19:53:46Z,_m,_f,2\n\"", Start: ast.Position{ Column: 1, Line: 7, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 7, }, File: "dict_lit_lambda_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 7, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 15, }, File: "dict_lit_lambda_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:26Z,_m,_f,0\n,,0,2018-05-22T19:53:36Z,_m,_f,1\n,,0,2018-05-22T19:53:46Z,_m,_f,2\n\"", Start: ast.Position{ Column: 10, Line: 7, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:26Z,_m,_f,0\n,,0,2018-05-22T19:53:36Z,_m,_f,1\n,,0,2018-05-22T19:53:46Z,_m,_f,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 24, }, File: "dict_lit_lambda_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long,string\n#group,false,false,false,true,true,false,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,_value,code\n,,0,2018-05-22T19:53:26Z,_m,_f,0,a\n,,0,2018-05-22T19:53:36Z,_m,_f,1,b\n,,0,2018-05-22T19:53:46Z,_m,_f,2,c\n\"", Start: ast.Position{ Column: 1, Line: 16, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 16, }, File: "dict_lit_lambda_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 16, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 24, }, File: "dict_lit_lambda_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long,string\n#group,false,false,false,true,true,false,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,_value,code\n,,0,2018-05-22T19:53:26Z,_m,_f,0,a\n,,0,2018-05-22T19:53:36Z,_m,_f,1,b\n,,0,2018-05-22T19:53:46Z,_m,_f,2,c\n\"", Start: ast.Position{ Column: 11, Line: 16, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long,string\n#group,false,false,false,true,true,false,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,_value,code\n,,0,2018-05-22T19:53:26Z,_m,_f,0,a\n,,0,2018-05-22T19:53:36Z,_m,_f,1,b\n,,0,2018-05-22T19:53:46Z,_m,_f,2,c\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 34, }, File: "dict_lit_lambda_test.flux", Source: "t_dict = (table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(\n fn: (r) => {\n codes = [0: \"a\", 1: \"b\"]\n \n return {r with code: dict.get(dict: codes, key: r._value, default: \"c\")}\n },\n )", Start: ast.Position{ Column: 1, Line: 25, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 25, }, File: "dict_lit_lambda_test.flux", Source: "t_dict", Start: ast.Position{ Column: 1, Line: 25, }, }, }, Name: "t_dict", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 34, }, File: "dict_lit_lambda_test.flux", Source: "(table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(\n fn: (r) => {\n codes = [0: \"a\", 1: \"b\"]\n \n return {r with code: dict.get(dict: codes, key: r._value, default: \"c\")}\n },\n )", Start: ast.Position{ Column: 10, Line: 25, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 25, }, File: "dict_lit_lambda_test.flux", Source: "table", Start: ast.Position{ Column: 24, Line: 25, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 26, }, File: "dict_lit_lambda_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)", Start: ast.Position{ Column: 24, Line: 25, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 26, }, File: "dict_lit_lambda_test.flux", Source: "start: 2018-05-22T19:53:26Z", Start: ast.Position{ Column: 14, Line: 26, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 26, }, File: "dict_lit_lambda_test.flux", Source: "start: 2018-05-22T19:53:26Z", Start: ast.Position{ Column: 14, Line: 26, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 26, }, File: "dict_lit_lambda_test.flux", Source: "start", Start: ast.Position{ Column: 14, Line: 26, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 26, }, File: "dict_lit_lambda_test.flux", Source: "2018-05-22T19:53:26Z", Start: ast.Position{ Column: 21, Line: 26, }, }, }, Value: parser.MustParseTime("2018-05-22T19:53:26Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 26, }, File: "dict_lit_lambda_test.flux", Source: "range(start: 2018-05-22T19:53:26Z)", Start: ast.Position{ Column: 8, Line: 26, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 26, }, File: "dict_lit_lambda_test.flux", Source: "range", Start: ast.Position{ Column: 8, Line: 26, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 27, }, File: "dict_lit_lambda_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 24, Line: 25, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 27, }, File: "dict_lit_lambda_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 13, Line: 27, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 27, }, File: "dict_lit_lambda_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 13, Line: 27, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 27, }, File: "dict_lit_lambda_test.flux", Source: "columns", Start: ast.Position{ Column: 13, Line: 27, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 27, }, File: "dict_lit_lambda_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 22, Line: 27, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 27, }, File: "dict_lit_lambda_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 23, Line: 27, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 27, }, File: "dict_lit_lambda_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 33, Line: 27, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 27, }, File: "dict_lit_lambda_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 8, Line: 27, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 27, }, File: "dict_lit_lambda_test.flux", Source: "drop", Start: ast.Position{ Column: 8, Line: 27, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 34, }, File: "dict_lit_lambda_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(\n fn: (r) => {\n codes = [0: \"a\", 1: \"b\"]\n \n return {r with code: dict.get(dict: codes, key: r._value, default: \"c\")}\n },\n )", Start: ast.Position{ Column: 24, Line: 25, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 33, }, File: "dict_lit_lambda_test.flux", Source: "fn: (r) => {\n codes = [0: \"a\", 1: \"b\"]\n \n return {r with code: dict.get(dict: codes, key: r._value, default: \"c\")}\n }", Start: ast.Position{ Column: 9, Line: 29, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 33, }, File: "dict_lit_lambda_test.flux", Source: "fn: (r) => {\n codes = [0: \"a\", 1: \"b\"]\n \n return {r with code: dict.get(dict: codes, key: r._value, default: \"c\")}\n }", Start: ast.Position{ Column: 9, Line: 29, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 29, }, File: "dict_lit_lambda_test.flux", Source: "fn", Start: ast.Position{ Column: 9, Line: 29, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 33, }, File: "dict_lit_lambda_test.flux", Source: "(r) => {\n codes = [0: \"a\", 1: \"b\"]\n \n return {r with code: dict.get(dict: codes, key: r._value, default: \"c\")}\n }", Start: ast.Position{ Column: 13, Line: 29, }, }, }, Body: &ast.Block{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 33, }, File: "dict_lit_lambda_test.flux", Source: "{\n codes = [0: \"a\", 1: \"b\"]\n \n return {r with code: dict.get(dict: codes, key: r._value, default: \"c\")}\n }", Start: ast.Position{ Column: 20, Line: 29, }, }, }, Body: []ast.Statement{&ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 30, }, File: "dict_lit_lambda_test.flux", Source: "codes = [0: \"a\", 1: \"b\"]", Start: ast.Position{ Column: 13, Line: 30, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 30, }, File: "dict_lit_lambda_test.flux", Source: "codes", Start: ast.Position{ Column: 13, Line: 30, }, }, }, Name: "codes", }, Init: &ast.DictExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 30, }, File: "dict_lit_lambda_test.flux", Source: "[0: \"a\", 1: \"b\"]", Start: ast.Position{ Column: 21, Line: 30, }, }, }, Elements: []*ast.DictItem{&ast.DictItem{ Comma: nil, Key: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 30, }, File: "dict_lit_lambda_test.flux", Source: "0", Start: ast.Position{ Column: 22, Line: 30, }, }, }, Value: int64(0), }, Val: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 30, }, File: "dict_lit_lambda_test.flux", Source: "\"a\"", Start: ast.Position{ Column: 25, Line: 30, }, }, }, Value: "a", }, }, &ast.DictItem{ Comma: nil, Key: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 30, }, File: "dict_lit_lambda_test.flux", Source: "1", Start: ast.Position{ Column: 30, Line: 30, }, }, }, Value: int64(1), }, Val: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 30, }, File: "dict_lit_lambda_test.flux", Source: "\"b\"", Start: ast.Position{ Column: 33, Line: 30, }, }, }, Value: "b", }, }}, Lbrack: nil, Rbrack: nil, }, }, &ast.ReturnStatement{ Argument: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "{r with code: dict.get(dict: codes, key: r._value, default: \"c\")}", Start: ast.Position{ Column: 20, Line: 32, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "code: dict.get(dict: codes, key: r._value, default: \"c\")", Start: ast.Position{ Column: 28, Line: 32, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "code", Start: ast.Position{ Column: 28, Line: 32, }, }, }, Name: "code", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "dict: codes, key: r._value, default: \"c\"", Start: ast.Position{ Column: 43, Line: 32, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "dict: codes", Start: ast.Position{ Column: 43, Line: 32, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "dict", Start: ast.Position{ Column: 43, Line: 32, }, }, }, Name: "dict", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "codes", Start: ast.Position{ Column: 49, Line: 32, }, }, }, Name: "codes", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "key: r._value", Start: ast.Position{ Column: 56, Line: 32, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "key", Start: ast.Position{ Column: 56, Line: 32, }, }, }, Name: "key", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "r._value", Start: ast.Position{ Column: 61, Line: 32, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "r", Start: ast.Position{ Column: 61, Line: 32, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "_value", Start: ast.Position{ Column: 63, Line: 32, }, }, }, Name: "_value", }, Rbrack: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "default: \"c\"", Start: ast.Position{ Column: 71, Line: 32, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "default", Start: ast.Position{ Column: 71, Line: 32, }, }, }, Name: "default", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "\"c\"", Start: ast.Position{ Column: 80, Line: 32, }, }, }, Value: "c", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "dict.get(dict: codes, key: r._value, default: \"c\")", Start: ast.Position{ Column: 34, Line: 32, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "dict.get", Start: ast.Position{ Column: 34, Line: 32, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "dict", Start: ast.Position{ Column: 34, Line: 32, }, }, }, Name: "dict", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "get", Start: ast.Position{ Column: 39, Line: 32, }, }, }, Name: "get", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 32, }, }, }, Name: "r", }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 32, }, File: "dict_lit_lambda_test.flux", Source: "return {r with code: dict.get(dict: codes, key: r._value, default: \"c\")}", Start: ast.Position{ Column: 13, Line: 32, }, }, }, }}, Lbrace: nil, Rbrace: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 29, }, File: "dict_lit_lambda_test.flux", Source: "r", Start: ast.Position{ Column: 14, Line: 29, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 29, }, File: "dict_lit_lambda_test.flux", Source: "r", Start: ast.Position{ Column: 14, Line: 29, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 34, }, File: "dict_lit_lambda_test.flux", Source: "map(\n fn: (r) => {\n codes = [0: \"a\", 1: \"b\"]\n \n return {r with code: dict.get(dict: codes, key: r._value, default: \"c\")}\n },\n )", Start: ast.Position{ Column: 8, Line: 28, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 28, }, File: "dict_lit_lambda_test.flux", Source: "map", Start: ast.Position{ Column: 8, Line: 28, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 25, }, File: "dict_lit_lambda_test.flux", Source: "table=<-", Start: ast.Position{ Column: 11, Line: 25, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 25, }, File: "dict_lit_lambda_test.flux", Source: "table", Start: ast.Position{ Column: 11, Line: 25, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 25, }, File: "dict_lit_lambda_test.flux", Source: "<-", Start: ast.Position{ Column: 17, Line: 25, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "_dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 6, Line: 36, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "_dict", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "_dict", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "() => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 14, Line: 36, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 20, Line: 36, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 111, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict}", Start: ast.Position{ Column: 21, Line: 36, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 22, Line: 36, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "input", Start: ast.Position{ Column: 22, Line: 36, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 49, Line: 36, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 49, Line: 36, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "csv", Start: ast.Position{ Column: 49, Line: 36, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "inData", Start: ast.Position{ Column: 54, Line: 36, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 29, Line: 36, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 29, Line: 36, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "testing", Start: ast.Position{ Column: 29, Line: 36, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 37, Line: 36, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 63, Line: 36, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "want", Start: ast.Position{ Column: 63, Line: 36, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 85, Line: 36, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 85, Line: 36, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "csv", Start: ast.Position{ Column: 85, Line: 36, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "outData", Start: ast.Position{ Column: 90, Line: 36, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 69, Line: 36, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 69, Line: 36, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "testing", Start: ast.Position{ Column: 69, Line: 36, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "loadMem", Start: ast.Position{ Column: 77, Line: 36, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "fn: t_dict", Start: ast.Position{ Column: 100, Line: 36, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "fn", Start: ast.Position{ Column: 100, Line: 36, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "t_dict", Start: ast.Position{ Column: 104, Line: 36, }, }, }, Name: "t_dict", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 36, }, File: "dict_lit_lambda_test.flux", Source: "test _dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 1, Line: 36, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "dict_lit_lambda_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "dict_lit_lambda_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "dict_lit_lambda_test.flux", Source: "import \"dict\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "dict_lit_lambda_test.flux", Source: "\"dict\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "dict", }, }}, Metadata: "parser-type=rust", Name: "dict_lit_lambda_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "dict_lit_lambda_test.flux", Source: "package dict_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "dict_lit_lambda_test.flux", Source: "dict_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "dict_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 31, }, File: "dict_lit_test.flux", Source: "package dict_test\n\n\nimport \"testing\"\nimport \"dict\"\n\ncodes = [0: \"a\", 1: \"b\"]\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:26Z,_m,_f,0\n,,0,2018-05-22T19:53:36Z,_m,_f,1\n,,0,2018-05-22T19:53:46Z,_m,_f,2\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long,string\n#group,false,false,false,true,true,false,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,_value,code\n,,0,2018-05-22T19:53:26Z,_m,_f,0,a\n,,0,2018-05-22T19:53:36Z,_m,_f,1,b\n,,0,2018-05-22T19:53:46Z,_m,_f,2,c\n\"\nt_dict = (table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(fn: (r) => ({r with code: dict.get(dict: codes, key: r._value, default: \"c\")}))\n\ntest _dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 7, }, File: "dict_lit_test.flux", Source: "codes = [0: \"a\", 1: \"b\"]", Start: ast.Position{ Column: 1, Line: 7, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 7, }, File: "dict_lit_test.flux", Source: "codes", Start: ast.Position{ Column: 1, Line: 7, }, }, }, Name: "codes", }, Init: &ast.DictExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 7, }, File: "dict_lit_test.flux", Source: "[0: \"a\", 1: \"b\"]", Start: ast.Position{ Column: 9, Line: 7, }, }, }, Elements: []*ast.DictItem{&ast.DictItem{ Comma: nil, Key: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 7, }, File: "dict_lit_test.flux", Source: "0", Start: ast.Position{ Column: 10, Line: 7, }, }, }, Value: int64(0), }, Val: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 7, }, File: "dict_lit_test.flux", Source: "\"a\"", Start: ast.Position{ Column: 13, Line: 7, }, }, }, Value: "a", }, }, &ast.DictItem{ Comma: nil, Key: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 7, }, File: "dict_lit_test.flux", Source: "1", Start: ast.Position{ Column: 18, Line: 7, }, }, }, Value: int64(1), }, Val: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 7, }, File: "dict_lit_test.flux", Source: "\"b\"", Start: ast.Position{ Column: 21, Line: 7, }, }, }, Value: "b", }, }}, Lbrack: nil, Rbrack: nil, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 16, }, File: "dict_lit_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:26Z,_m,_f,0\n,,0,2018-05-22T19:53:36Z,_m,_f,1\n,,0,2018-05-22T19:53:46Z,_m,_f,2\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "dict_lit_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 16, }, File: "dict_lit_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:26Z,_m,_f,0\n,,0,2018-05-22T19:53:36Z,_m,_f,1\n,,0,2018-05-22T19:53:46Z,_m,_f,2\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:26Z,_m,_f,0\n,,0,2018-05-22T19:53:36Z,_m,_f,1\n,,0,2018-05-22T19:53:46Z,_m,_f,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "dict_lit_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long,string\n#group,false,false,false,true,true,false,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,_value,code\n,,0,2018-05-22T19:53:26Z,_m,_f,0,a\n,,0,2018-05-22T19:53:36Z,_m,_f,1,b\n,,0,2018-05-22T19:53:46Z,_m,_f,2,c\n\"", Start: ast.Position{ Column: 1, Line: 17, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 17, }, File: "dict_lit_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 17, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "dict_lit_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long,string\n#group,false,false,false,true,true,false,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,_value,code\n,,0,2018-05-22T19:53:26Z,_m,_f,0,a\n,,0,2018-05-22T19:53:36Z,_m,_f,1,b\n,,0,2018-05-22T19:53:46Z,_m,_f,2,c\n\"", Start: ast.Position{ Column: 11, Line: 17, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long,string\n#group,false,false,false,true,true,false,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,_value,code\n,,0,2018-05-22T19:53:26Z,_m,_f,0,a\n,,0,2018-05-22T19:53:36Z,_m,_f,1,b\n,,0,2018-05-22T19:53:46Z,_m,_f,2,c\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 91, Line: 29, }, File: "dict_lit_test.flux", Source: "t_dict = (table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(fn: (r) => ({r with code: dict.get(dict: codes, key: r._value, default: \"c\")}))", Start: ast.Position{ Column: 1, Line: 26, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 26, }, File: "dict_lit_test.flux", Source: "t_dict", Start: ast.Position{ Column: 1, Line: 26, }, }, }, Name: "t_dict", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 91, Line: 29, }, File: "dict_lit_test.flux", Source: "(table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(fn: (r) => ({r with code: dict.get(dict: codes, key: r._value, default: \"c\")}))", Start: ast.Position{ Column: 10, Line: 26, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 26, }, File: "dict_lit_test.flux", Source: "table", Start: ast.Position{ Column: 24, Line: 26, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 27, }, File: "dict_lit_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)", Start: ast.Position{ Column: 24, Line: 26, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 27, }, File: "dict_lit_test.flux", Source: "start: 2018-05-22T19:53:26Z", Start: ast.Position{ Column: 14, Line: 27, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 27, }, File: "dict_lit_test.flux", Source: "start: 2018-05-22T19:53:26Z", Start: ast.Position{ Column: 14, Line: 27, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 27, }, File: "dict_lit_test.flux", Source: "start", Start: ast.Position{ Column: 14, Line: 27, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 27, }, File: "dict_lit_test.flux", Source: "2018-05-22T19:53:26Z", Start: ast.Position{ Column: 21, Line: 27, }, }, }, Value: parser.MustParseTime("2018-05-22T19:53:26Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 27, }, File: "dict_lit_test.flux", Source: "range(start: 2018-05-22T19:53:26Z)", Start: ast.Position{ Column: 8, Line: 27, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 27, }, File: "dict_lit_test.flux", Source: "range", Start: ast.Position{ Column: 8, Line: 27, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 28, }, File: "dict_lit_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 24, Line: 26, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 28, }, File: "dict_lit_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 13, Line: 28, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 28, }, File: "dict_lit_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 13, Line: 28, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 28, }, File: "dict_lit_test.flux", Source: "columns", Start: ast.Position{ Column: 13, Line: 28, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 28, }, File: "dict_lit_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 22, Line: 28, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 28, }, File: "dict_lit_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 23, Line: 28, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 28, }, File: "dict_lit_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 33, Line: 28, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 28, }, File: "dict_lit_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 8, Line: 28, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 28, }, File: "dict_lit_test.flux", Source: "drop", Start: ast.Position{ Column: 8, Line: 28, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 91, Line: 29, }, File: "dict_lit_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(fn: (r) => ({r with code: dict.get(dict: codes, key: r._value, default: \"c\")}))", Start: ast.Position{ Column: 24, Line: 26, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 90, Line: 29, }, File: "dict_lit_test.flux", Source: "fn: (r) => ({r with code: dict.get(dict: codes, key: r._value, default: \"c\")})", Start: ast.Position{ Column: 12, Line: 29, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 90, Line: 29, }, File: "dict_lit_test.flux", Source: "fn: (r) => ({r with code: dict.get(dict: codes, key: r._value, default: \"c\")})", Start: ast.Position{ Column: 12, Line: 29, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 29, }, File: "dict_lit_test.flux", Source: "fn", Start: ast.Position{ Column: 12, Line: 29, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 90, Line: 29, }, File: "dict_lit_test.flux", Source: "(r) => ({r with code: dict.get(dict: codes, key: r._value, default: \"c\")})", Start: ast.Position{ Column: 16, Line: 29, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 90, Line: 29, }, File: "dict_lit_test.flux", Source: "({r with code: dict.get(dict: codes, key: r._value, default: \"c\")})", Start: ast.Position{ Column: 23, Line: 29, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 89, Line: 29, }, File: "dict_lit_test.flux", Source: "{r with code: dict.get(dict: codes, key: r._value, default: \"c\")}", Start: ast.Position{ Column: 24, Line: 29, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 29, }, File: "dict_lit_test.flux", Source: "code: dict.get(dict: codes, key: r._value, default: \"c\")", Start: ast.Position{ Column: 32, Line: 29, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 29, }, File: "dict_lit_test.flux", Source: "code", Start: ast.Position{ Column: 32, Line: 29, }, }, }, Name: "code", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 29, }, File: "dict_lit_test.flux", Source: "dict: codes, key: r._value, default: \"c\"", Start: ast.Position{ Column: 47, Line: 29, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 29, }, File: "dict_lit_test.flux", Source: "dict: codes", Start: ast.Position{ Column: 47, Line: 29, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 29, }, File: "dict_lit_test.flux", Source: "dict", Start: ast.Position{ Column: 47, Line: 29, }, }, }, Name: "dict", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 29, }, File: "dict_lit_test.flux", Source: "codes", Start: ast.Position{ Column: 53, Line: 29, }, }, }, Name: "codes", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 29, }, File: "dict_lit_test.flux", Source: "key: r._value", Start: ast.Position{ Column: 60, Line: 29, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 29, }, File: "dict_lit_test.flux", Source: "key", Start: ast.Position{ Column: 60, Line: 29, }, }, }, Name: "key", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 29, }, File: "dict_lit_test.flux", Source: "r._value", Start: ast.Position{ Column: 65, Line: 29, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 29, }, File: "dict_lit_test.flux", Source: "r", Start: ast.Position{ Column: 65, Line: 29, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 29, }, File: "dict_lit_test.flux", Source: "_value", Start: ast.Position{ Column: 67, Line: 29, }, }, }, Name: "_value", }, Rbrack: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 29, }, File: "dict_lit_test.flux", Source: "default: \"c\"", Start: ast.Position{ Column: 75, Line: 29, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 29, }, File: "dict_lit_test.flux", Source: "default", Start: ast.Position{ Column: 75, Line: 29, }, }, }, Name: "default", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 29, }, File: "dict_lit_test.flux", Source: "\"c\"", Start: ast.Position{ Column: 84, Line: 29, }, }, }, Value: "c", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 29, }, File: "dict_lit_test.flux", Source: "dict.get(dict: codes, key: r._value, default: \"c\")", Start: ast.Position{ Column: 38, Line: 29, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 29, }, File: "dict_lit_test.flux", Source: "dict.get", Start: ast.Position{ Column: 38, Line: 29, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 29, }, File: "dict_lit_test.flux", Source: "dict", Start: ast.Position{ Column: 38, Line: 29, }, }, }, Name: "dict", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 29, }, File: "dict_lit_test.flux", Source: "get", Start: ast.Position{ Column: 43, Line: 29, }, }, }, Name: "get", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 29, }, File: "dict_lit_test.flux", Source: "r", Start: ast.Position{ Column: 25, Line: 29, }, }, }, Name: "r", }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 29, }, File: "dict_lit_test.flux", Source: "r", Start: ast.Position{ Column: 17, Line: 29, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 29, }, File: "dict_lit_test.flux", Source: "r", Start: ast.Position{ Column: 17, Line: 29, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 91, Line: 29, }, File: "dict_lit_test.flux", Source: "map(fn: (r) => ({r with code: dict.get(dict: codes, key: r._value, default: \"c\")}))", Start: ast.Position{ Column: 8, Line: 29, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 29, }, File: "dict_lit_test.flux", Source: "map", Start: ast.Position{ Column: 8, Line: 29, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 26, }, File: "dict_lit_test.flux", Source: "table=<-", Start: ast.Position{ Column: 11, Line: 26, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 26, }, File: "dict_lit_test.flux", Source: "table", Start: ast.Position{ Column: 11, Line: 26, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 26, }, File: "dict_lit_test.flux", Source: "<-", Start: ast.Position{ Column: 17, Line: 26, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 31, }, File: "dict_lit_test.flux", Source: "_dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 6, Line: 31, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 31, }, File: "dict_lit_test.flux", Source: "_dict", Start: ast.Position{ Column: 6, Line: 31, }, }, }, Name: "_dict", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 31, }, File: "dict_lit_test.flux", Source: "() => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 14, Line: 31, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 31, }, File: "dict_lit_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 20, Line: 31, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 111, Line: 31, }, File: "dict_lit_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict}", Start: ast.Position{ Column: 21, Line: 31, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 31, }, File: "dict_lit_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 22, Line: 31, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 31, }, File: "dict_lit_test.flux", Source: "input", Start: ast.Position{ Column: 22, Line: 31, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 31, }, File: "dict_lit_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 49, Line: 31, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 31, }, File: "dict_lit_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 49, Line: 31, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 31, }, File: "dict_lit_test.flux", Source: "csv", Start: ast.Position{ Column: 49, Line: 31, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 31, }, File: "dict_lit_test.flux", Source: "inData", Start: ast.Position{ Column: 54, Line: 31, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 31, }, File: "dict_lit_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 29, Line: 31, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 31, }, File: "dict_lit_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 29, Line: 31, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 31, }, File: "dict_lit_test.flux", Source: "testing", Start: ast.Position{ Column: 29, Line: 31, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 31, }, File: "dict_lit_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 37, Line: 31, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 31, }, File: "dict_lit_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 63, Line: 31, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 31, }, File: "dict_lit_test.flux", Source: "want", Start: ast.Position{ Column: 63, Line: 31, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 31, }, File: "dict_lit_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 85, Line: 31, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 31, }, File: "dict_lit_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 85, Line: 31, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 31, }, File: "dict_lit_test.flux", Source: "csv", Start: ast.Position{ Column: 85, Line: 31, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 31, }, File: "dict_lit_test.flux", Source: "outData", Start: ast.Position{ Column: 90, Line: 31, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 31, }, File: "dict_lit_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 69, Line: 31, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 31, }, File: "dict_lit_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 69, Line: 31, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 31, }, File: "dict_lit_test.flux", Source: "testing", Start: ast.Position{ Column: 69, Line: 31, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 31, }, File: "dict_lit_test.flux", Source: "loadMem", Start: ast.Position{ Column: 77, Line: 31, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 31, }, File: "dict_lit_test.flux", Source: "fn: t_dict", Start: ast.Position{ Column: 100, Line: 31, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 31, }, File: "dict_lit_test.flux", Source: "fn", Start: ast.Position{ Column: 100, Line: 31, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 31, }, File: "dict_lit_test.flux", Source: "t_dict", Start: ast.Position{ Column: 104, Line: 31, }, }, }, Name: "t_dict", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 31, }, File: "dict_lit_test.flux", Source: "test _dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 1, Line: 31, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "dict_lit_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "dict_lit_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "dict_lit_test.flux", Source: "import \"dict\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "dict_lit_test.flux", Source: "\"dict\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "dict", }, }}, Metadata: "parser-type=rust", Name: "dict_lit_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "dict_lit_test.flux", Source: "package dict_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "dict_lit_test.flux", Source: "dict_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "dict_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 49, }, File: "dict_test.flux", Source: "package dict_test\n\n\nimport \"testing\"\nimport \"dict\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ncodes = dict.fromList(pairs: [{key: \"internal\", value: 0}, {key: \"invalid\", value: 1}, {key: \"unimplemented\", value: 2}])\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,string\n#group,false,false,false,true,true,true,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,error_type,_value\n,,0,2018-05-22T19:53:26Z,requests,error,internal,some internal error\n,,0,2018-05-22T19:53:36Z,requests,error,internal,another internal error\n,,1,2018-05-22T19:53:46Z,requests,error,invalid,unknown parameter\n,,1,2018-05-22T19:53:56Z,requests,error,invalid,cannot use duration as value\n,,2,2018-05-22T19:54:06Z,requests,error,unimplemented,implement me\n,,2,2018-05-22T19:54:16Z,requests,error,unimplemented,not implemented\n,,3,2018-05-22T19:53:26Z,requests,error,unknown,unknown error\n,,3,2018-05-22T19:53:36Z,requests,error,unknown,network error\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,string,long\n#group,false,false,false,true,true,true,false,false\n#default,_result,,,,,,,\n,result,table,_time,_measurement,_field,error_type,_value,error_code\n,,0,2018-05-22T19:53:26Z,requests,error,internal,some internal error,0\n,,0,2018-05-22T19:53:36Z,requests,error,internal,another internal error,0\n,,1,2018-05-22T19:53:46Z,requests,error,invalid,unknown parameter,1\n,,1,2018-05-22T19:53:56Z,requests,error,invalid,cannot use duration as value,1\n,,2,2018-05-22T19:54:06Z,requests,error,unimplemented,implement me,2\n,,2,2018-05-22T19:54:16Z,requests,error,unimplemented,not implemented,2\n,,3,2018-05-22T19:53:26Z,requests,error,unknown,unknown error,-1\n,,3,2018-05-22T19:53:36Z,requests,error,unknown,network error,-1\n\"\nt_dict = (table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(\n fn: (r) => {\n error_code = dict.get(dict: codes, key: r.error_type, default: -1)\n \n return {r with error_code: error_code}\n },\n )\n\ntest _dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "dict_test.flux", Source: "now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 8, Line: 7, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 7, }, File: "dict_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 7, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "dict_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "dict_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "dict_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 122, Line: 9, }, File: "dict_test.flux", Source: "codes = dict.fromList(pairs: [{key: \"internal\", value: 0}, {key: \"invalid\", value: 1}, {key: \"unimplemented\", value: 2}])", Start: ast.Position{ Column: 1, Line: 9, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 9, }, File: "dict_test.flux", Source: "codes", Start: ast.Position{ Column: 1, Line: 9, }, }, }, Name: "codes", }, Init: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 121, Line: 9, }, File: "dict_test.flux", Source: "pairs: [{key: \"internal\", value: 0}, {key: \"invalid\", value: 1}, {key: \"unimplemented\", value: 2}]", Start: ast.Position{ Column: 23, Line: 9, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 121, Line: 9, }, File: "dict_test.flux", Source: "pairs: [{key: \"internal\", value: 0}, {key: \"invalid\", value: 1}, {key: \"unimplemented\", value: 2}]", Start: ast.Position{ Column: 23, Line: 9, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 9, }, File: "dict_test.flux", Source: "pairs", Start: ast.Position{ Column: 23, Line: 9, }, }, }, Name: "pairs", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 121, Line: 9, }, File: "dict_test.flux", Source: "[{key: \"internal\", value: 0}, {key: \"invalid\", value: 1}, {key: \"unimplemented\", value: 2}]", Start: ast.Position{ Column: 30, Line: 9, }, }, }, Elements: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 9, }, File: "dict_test.flux", Source: "{key: \"internal\", value: 0}", Start: ast.Position{ Column: 31, Line: 9, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 9, }, File: "dict_test.flux", Source: "key: \"internal\"", Start: ast.Position{ Column: 32, Line: 9, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 9, }, File: "dict_test.flux", Source: "key", Start: ast.Position{ Column: 32, Line: 9, }, }, }, Name: "key", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 9, }, File: "dict_test.flux", Source: "\"internal\"", Start: ast.Position{ Column: 37, Line: 9, }, }, }, Value: "internal", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 57, Line: 9, }, File: "dict_test.flux", Source: "value: 0", Start: ast.Position{ Column: 49, Line: 9, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 9, }, File: "dict_test.flux", Source: "value", Start: ast.Position{ Column: 49, Line: 9, }, }, }, Name: "value", }, Separator: nil, Value: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 57, Line: 9, }, File: "dict_test.flux", Source: "0", Start: ast.Position{ Column: 56, Line: 9, }, }, }, Value: int64(0), }, }}, Rbrace: nil, With: nil, }, &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 86, Line: 9, }, File: "dict_test.flux", Source: "{key: \"invalid\", value: 1}", Start: ast.Position{ Column: 60, Line: 9, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 9, }, File: "dict_test.flux", Source: "key: \"invalid\"", Start: ast.Position{ Column: 61, Line: 9, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 9, }, File: "dict_test.flux", Source: "key", Start: ast.Position{ Column: 61, Line: 9, }, }, }, Name: "key", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 9, }, File: "dict_test.flux", Source: "\"invalid\"", Start: ast.Position{ Column: 66, Line: 9, }, }, }, Value: "invalid", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 9, }, File: "dict_test.flux", Source: "value: 1", Start: ast.Position{ Column: 77, Line: 9, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 9, }, File: "dict_test.flux", Source: "value", Start: ast.Position{ Column: 77, Line: 9, }, }, }, Name: "value", }, Separator: nil, Value: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 9, }, File: "dict_test.flux", Source: "1", Start: ast.Position{ Column: 84, Line: 9, }, }, }, Value: int64(1), }, }}, Rbrace: nil, With: nil, }, &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 120, Line: 9, }, File: "dict_test.flux", Source: "{key: \"unimplemented\", value: 2}", Start: ast.Position{ Column: 88, Line: 9, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 9, }, File: "dict_test.flux", Source: "key: \"unimplemented\"", Start: ast.Position{ Column: 89, Line: 9, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 92, Line: 9, }, File: "dict_test.flux", Source: "key", Start: ast.Position{ Column: 89, Line: 9, }, }, }, Name: "key", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 9, }, File: "dict_test.flux", Source: "\"unimplemented\"", Start: ast.Position{ Column: 94, Line: 9, }, }, }, Value: "unimplemented", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 119, Line: 9, }, File: "dict_test.flux", Source: "value: 2", Start: ast.Position{ Column: 111, Line: 9, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 116, Line: 9, }, File: "dict_test.flux", Source: "value", Start: ast.Position{ Column: 111, Line: 9, }, }, }, Name: "value", }, Separator: nil, Value: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 119, Line: 9, }, File: "dict_test.flux", Source: "2", Start: ast.Position{ Column: 118, Line: 9, }, }, }, Value: int64(2), }, }}, Rbrace: nil, With: nil, }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 122, Line: 9, }, File: "dict_test.flux", Source: "dict.fromList(pairs: [{key: \"internal\", value: 0}, {key: \"invalid\", value: 1}, {key: \"unimplemented\", value: 2}])", Start: ast.Position{ Column: 9, Line: 9, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 9, }, File: "dict_test.flux", Source: "dict.fromList", Start: ast.Position{ Column: 9, Line: 9, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 9, }, File: "dict_test.flux", Source: "dict", Start: ast.Position{ Column: 9, Line: 9, }, }, }, Name: "dict", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 9, }, File: "dict_test.flux", Source: "fromList", Start: ast.Position{ Column: 14, Line: 9, }, }, }, Name: "fromList", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 23, }, File: "dict_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,string\n#group,false,false,false,true,true,true,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,error_type,_value\n,,0,2018-05-22T19:53:26Z,requests,error,internal,some internal error\n,,0,2018-05-22T19:53:36Z,requests,error,internal,another internal error\n,,1,2018-05-22T19:53:46Z,requests,error,invalid,unknown parameter\n,,1,2018-05-22T19:53:56Z,requests,error,invalid,cannot use duration as value\n,,2,2018-05-22T19:54:06Z,requests,error,unimplemented,implement me\n,,2,2018-05-22T19:54:16Z,requests,error,unimplemented,not implemented\n,,3,2018-05-22T19:53:26Z,requests,error,unknown,unknown error\n,,3,2018-05-22T19:53:36Z,requests,error,unknown,network error\n\"", Start: ast.Position{ Column: 1, Line: 10, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 10, }, File: "dict_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 10, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 23, }, File: "dict_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,string,string\n#group,false,false,false,true,true,true,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,error_type,_value\n,,0,2018-05-22T19:53:26Z,requests,error,internal,some internal error\n,,0,2018-05-22T19:53:36Z,requests,error,internal,another internal error\n,,1,2018-05-22T19:53:46Z,requests,error,invalid,unknown parameter\n,,1,2018-05-22T19:53:56Z,requests,error,invalid,cannot use duration as value\n,,2,2018-05-22T19:54:06Z,requests,error,unimplemented,implement me\n,,2,2018-05-22T19:54:16Z,requests,error,unimplemented,not implemented\n,,3,2018-05-22T19:53:26Z,requests,error,unknown,unknown error\n,,3,2018-05-22T19:53:36Z,requests,error,unknown,network error\n\"", Start: ast.Position{ Column: 10, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,string,string\n#group,false,false,false,true,true,true,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,error_type,_value\n,,0,2018-05-22T19:53:26Z,requests,error,internal,some internal error\n,,0,2018-05-22T19:53:36Z,requests,error,internal,another internal error\n,,1,2018-05-22T19:53:46Z,requests,error,invalid,unknown parameter\n,,1,2018-05-22T19:53:56Z,requests,error,invalid,cannot use duration as value\n,,2,2018-05-22T19:54:06Z,requests,error,unimplemented,implement me\n,,2,2018-05-22T19:54:16Z,requests,error,unimplemented,not implemented\n,,3,2018-05-22T19:53:26Z,requests,error,unknown,unknown error\n,,3,2018-05-22T19:53:36Z,requests,error,unknown,network error\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 37, }, File: "dict_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,string,long\n#group,false,false,false,true,true,true,false,false\n#default,_result,,,,,,,\n,result,table,_time,_measurement,_field,error_type,_value,error_code\n,,0,2018-05-22T19:53:26Z,requests,error,internal,some internal error,0\n,,0,2018-05-22T19:53:36Z,requests,error,internal,another internal error,0\n,,1,2018-05-22T19:53:46Z,requests,error,invalid,unknown parameter,1\n,,1,2018-05-22T19:53:56Z,requests,error,invalid,cannot use duration as value,1\n,,2,2018-05-22T19:54:06Z,requests,error,unimplemented,implement me,2\n,,2,2018-05-22T19:54:16Z,requests,error,unimplemented,not implemented,2\n,,3,2018-05-22T19:53:26Z,requests,error,unknown,unknown error,-1\n,,3,2018-05-22T19:53:36Z,requests,error,unknown,network error,-1\n\"", Start: ast.Position{ Column: 1, Line: 24, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 24, }, File: "dict_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 24, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 37, }, File: "dict_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,string,string,long\n#group,false,false,false,true,true,true,false,false\n#default,_result,,,,,,,\n,result,table,_time,_measurement,_field,error_type,_value,error_code\n,,0,2018-05-22T19:53:26Z,requests,error,internal,some internal error,0\n,,0,2018-05-22T19:53:36Z,requests,error,internal,another internal error,0\n,,1,2018-05-22T19:53:46Z,requests,error,invalid,unknown parameter,1\n,,1,2018-05-22T19:53:56Z,requests,error,invalid,cannot use duration as value,1\n,,2,2018-05-22T19:54:06Z,requests,error,unimplemented,implement me,2\n,,2,2018-05-22T19:54:16Z,requests,error,unimplemented,not implemented,2\n,,3,2018-05-22T19:53:26Z,requests,error,unknown,unknown error,-1\n,,3,2018-05-22T19:53:36Z,requests,error,unknown,network error,-1\n\"", Start: ast.Position{ Column: 11, Line: 24, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,string,string,long\n#group,false,false,false,true,true,true,false,false\n#default,_result,,,,,,,\n,result,table,_time,_measurement,_field,error_type,_value,error_code\n,,0,2018-05-22T19:53:26Z,requests,error,internal,some internal error,0\n,,0,2018-05-22T19:53:36Z,requests,error,internal,another internal error,0\n,,1,2018-05-22T19:53:46Z,requests,error,invalid,unknown parameter,1\n,,1,2018-05-22T19:53:56Z,requests,error,invalid,cannot use duration as value,1\n,,2,2018-05-22T19:54:06Z,requests,error,unimplemented,implement me,2\n,,2,2018-05-22T19:54:16Z,requests,error,unimplemented,not implemented,2\n,,3,2018-05-22T19:53:26Z,requests,error,unknown,unknown error,-1\n,,3,2018-05-22T19:53:36Z,requests,error,unknown,network error,-1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 47, }, File: "dict_test.flux", Source: "t_dict = (table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(\n fn: (r) => {\n error_code = dict.get(dict: codes, key: r.error_type, default: -1)\n \n return {r with error_code: error_code}\n },\n )", Start: ast.Position{ Column: 1, Line: 38, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 38, }, File: "dict_test.flux", Source: "t_dict", Start: ast.Position{ Column: 1, Line: 38, }, }, }, Name: "t_dict", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 47, }, File: "dict_test.flux", Source: "(table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(\n fn: (r) => {\n error_code = dict.get(dict: codes, key: r.error_type, default: -1)\n \n return {r with error_code: error_code}\n },\n )", Start: ast.Position{ Column: 10, Line: 38, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 38, }, File: "dict_test.flux", Source: "table", Start: ast.Position{ Column: 24, Line: 38, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 39, }, File: "dict_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)", Start: ast.Position{ Column: 24, Line: 38, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 39, }, File: "dict_test.flux", Source: "start: 2018-05-22T19:53:26Z", Start: ast.Position{ Column: 14, Line: 39, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 39, }, File: "dict_test.flux", Source: "start: 2018-05-22T19:53:26Z", Start: ast.Position{ Column: 14, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 39, }, File: "dict_test.flux", Source: "start", Start: ast.Position{ Column: 14, Line: 39, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 39, }, File: "dict_test.flux", Source: "2018-05-22T19:53:26Z", Start: ast.Position{ Column: 21, Line: 39, }, }, }, Value: parser.MustParseTime("2018-05-22T19:53:26Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 39, }, File: "dict_test.flux", Source: "range(start: 2018-05-22T19:53:26Z)", Start: ast.Position{ Column: 8, Line: 39, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 39, }, File: "dict_test.flux", Source: "range", Start: ast.Position{ Column: 8, Line: 39, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "dict_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 24, Line: 38, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 40, }, File: "dict_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 13, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 40, }, File: "dict_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 13, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 40, }, File: "dict_test.flux", Source: "columns", Start: ast.Position{ Column: 13, Line: 40, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 40, }, File: "dict_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 22, Line: 40, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 40, }, File: "dict_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 23, Line: 40, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 40, }, File: "dict_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 33, Line: 40, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "dict_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 8, Line: 40, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 40, }, File: "dict_test.flux", Source: "drop", Start: ast.Position{ Column: 8, Line: 40, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 47, }, File: "dict_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(\n fn: (r) => {\n error_code = dict.get(dict: codes, key: r.error_type, default: -1)\n \n return {r with error_code: error_code}\n },\n )", Start: ast.Position{ Column: 24, Line: 38, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 46, }, File: "dict_test.flux", Source: "fn: (r) => {\n error_code = dict.get(dict: codes, key: r.error_type, default: -1)\n \n return {r with error_code: error_code}\n }", Start: ast.Position{ Column: 9, Line: 42, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 46, }, File: "dict_test.flux", Source: "fn: (r) => {\n error_code = dict.get(dict: codes, key: r.error_type, default: -1)\n \n return {r with error_code: error_code}\n }", Start: ast.Position{ Column: 9, Line: 42, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 42, }, File: "dict_test.flux", Source: "fn", Start: ast.Position{ Column: 9, Line: 42, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 46, }, File: "dict_test.flux", Source: "(r) => {\n error_code = dict.get(dict: codes, key: r.error_type, default: -1)\n \n return {r with error_code: error_code}\n }", Start: ast.Position{ Column: 13, Line: 42, }, }, }, Body: &ast.Block{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 46, }, File: "dict_test.flux", Source: "{\n error_code = dict.get(dict: codes, key: r.error_type, default: -1)\n \n return {r with error_code: error_code}\n }", Start: ast.Position{ Column: 20, Line: 42, }, }, }, Body: []ast.Statement{&ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 43, }, File: "dict_test.flux", Source: "error_code = dict.get(dict: codes, key: r.error_type, default: -1)", Start: ast.Position{ Column: 13, Line: 43, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 43, }, File: "dict_test.flux", Source: "error_code", Start: ast.Position{ Column: 13, Line: 43, }, }, }, Name: "error_code", }, Init: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 43, }, File: "dict_test.flux", Source: "dict: codes, key: r.error_type, default: -1", Start: ast.Position{ Column: 35, Line: 43, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 43, }, File: "dict_test.flux", Source: "dict: codes", Start: ast.Position{ Column: 35, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 43, }, File: "dict_test.flux", Source: "dict", Start: ast.Position{ Column: 35, Line: 43, }, }, }, Name: "dict", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 43, }, File: "dict_test.flux", Source: "codes", Start: ast.Position{ Column: 41, Line: 43, }, }, }, Name: "codes", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 43, }, File: "dict_test.flux", Source: "key: r.error_type", Start: ast.Position{ Column: 48, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 43, }, File: "dict_test.flux", Source: "key", Start: ast.Position{ Column: 48, Line: 43, }, }, }, Name: "key", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 43, }, File: "dict_test.flux", Source: "r.error_type", Start: ast.Position{ Column: 53, Line: 43, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 43, }, File: "dict_test.flux", Source: "r", Start: ast.Position{ Column: 53, Line: 43, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 43, }, File: "dict_test.flux", Source: "error_type", Start: ast.Position{ Column: 55, Line: 43, }, }, }, Name: "error_type", }, Rbrack: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 43, }, File: "dict_test.flux", Source: "default: -1", Start: ast.Position{ Column: 67, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 43, }, File: "dict_test.flux", Source: "default", Start: ast.Position{ Column: 67, Line: 43, }, }, }, Name: "default", }, Separator: nil, Value: &ast.UnaryExpression{ Argument: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 43, }, File: "dict_test.flux", Source: "1", Start: ast.Position{ Column: 77, Line: 43, }, }, }, Value: int64(1), }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 43, }, File: "dict_test.flux", Source: "-1", Start: ast.Position{ Column: 76, Line: 43, }, }, }, Operator: 6, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 43, }, File: "dict_test.flux", Source: "dict.get(dict: codes, key: r.error_type, default: -1)", Start: ast.Position{ Column: 26, Line: 43, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 43, }, File: "dict_test.flux", Source: "dict.get", Start: ast.Position{ Column: 26, Line: 43, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 43, }, File: "dict_test.flux", Source: "dict", Start: ast.Position{ Column: 26, Line: 43, }, }, }, Name: "dict", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 43, }, File: "dict_test.flux", Source: "get", Start: ast.Position{ Column: 31, Line: 43, }, }, }, Name: "get", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.ReturnStatement{ Argument: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 45, }, File: "dict_test.flux", Source: "{r with error_code: error_code}", Start: ast.Position{ Column: 20, Line: 45, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 45, }, File: "dict_test.flux", Source: "error_code: error_code", Start: ast.Position{ Column: 28, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 45, }, File: "dict_test.flux", Source: "error_code", Start: ast.Position{ Column: 28, Line: 45, }, }, }, Name: "error_code", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 45, }, File: "dict_test.flux", Source: "error_code", Start: ast.Position{ Column: 40, Line: 45, }, }, }, Name: "error_code", }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 45, }, File: "dict_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 45, }, }, }, Name: "r", }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 45, }, File: "dict_test.flux", Source: "return {r with error_code: error_code}", Start: ast.Position{ Column: 13, Line: 45, }, }, }, }}, Lbrace: nil, Rbrace: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 42, }, File: "dict_test.flux", Source: "r", Start: ast.Position{ Column: 14, Line: 42, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 42, }, File: "dict_test.flux", Source: "r", Start: ast.Position{ Column: 14, Line: 42, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 47, }, File: "dict_test.flux", Source: "map(\n fn: (r) => {\n error_code = dict.get(dict: codes, key: r.error_type, default: -1)\n \n return {r with error_code: error_code}\n },\n )", Start: ast.Position{ Column: 8, Line: 41, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 41, }, File: "dict_test.flux", Source: "map", Start: ast.Position{ Column: 8, Line: 41, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 38, }, File: "dict_test.flux", Source: "table=<-", Start: ast.Position{ Column: 11, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 38, }, File: "dict_test.flux", Source: "table", Start: ast.Position{ Column: 11, Line: 38, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 38, }, File: "dict_test.flux", Source: "<-", Start: ast.Position{ Column: 17, Line: 38, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 49, }, File: "dict_test.flux", Source: "_dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 6, Line: 49, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 49, }, File: "dict_test.flux", Source: "_dict", Start: ast.Position{ Column: 6, Line: 49, }, }, }, Name: "_dict", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 49, }, File: "dict_test.flux", Source: "() => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 14, Line: 49, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 49, }, File: "dict_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 20, Line: 49, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 111, Line: 49, }, File: "dict_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict}", Start: ast.Position{ Column: 21, Line: 49, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 49, }, File: "dict_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 22, Line: 49, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 49, }, File: "dict_test.flux", Source: "input", Start: ast.Position{ Column: 22, Line: 49, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 49, }, File: "dict_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 49, Line: 49, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 49, }, File: "dict_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 49, Line: 49, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 49, }, File: "dict_test.flux", Source: "csv", Start: ast.Position{ Column: 49, Line: 49, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 49, }, File: "dict_test.flux", Source: "inData", Start: ast.Position{ Column: 54, Line: 49, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 49, }, File: "dict_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 29, Line: 49, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 49, }, File: "dict_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 29, Line: 49, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 49, }, File: "dict_test.flux", Source: "testing", Start: ast.Position{ Column: 29, Line: 49, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 49, }, File: "dict_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 37, Line: 49, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 49, }, File: "dict_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 63, Line: 49, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 49, }, File: "dict_test.flux", Source: "want", Start: ast.Position{ Column: 63, Line: 49, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 49, }, File: "dict_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 85, Line: 49, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 49, }, File: "dict_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 85, Line: 49, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 49, }, File: "dict_test.flux", Source: "csv", Start: ast.Position{ Column: 85, Line: 49, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 49, }, File: "dict_test.flux", Source: "outData", Start: ast.Position{ Column: 90, Line: 49, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 49, }, File: "dict_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 69, Line: 49, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 49, }, File: "dict_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 69, Line: 49, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 49, }, File: "dict_test.flux", Source: "testing", Start: ast.Position{ Column: 69, Line: 49, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 49, }, File: "dict_test.flux", Source: "loadMem", Start: ast.Position{ Column: 77, Line: 49, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 49, }, File: "dict_test.flux", Source: "fn: t_dict", Start: ast.Position{ Column: 100, Line: 49, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 49, }, File: "dict_test.flux", Source: "fn", Start: ast.Position{ Column: 100, Line: 49, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 49, }, File: "dict_test.flux", Source: "t_dict", Start: ast.Position{ Column: 104, Line: 49, }, }, }, Name: "t_dict", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 49, }, File: "dict_test.flux", Source: "test _dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 1, Line: 49, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "dict_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "dict_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "dict_test.flux", Source: "import \"dict\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "dict_test.flux", Source: "\"dict\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "dict", }, }}, Metadata: "parser-type=rust", Name: "dict_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "dict_test.flux", Source: "package dict_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "dict_test.flux", Source: "dict_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "dict_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "package dict_test\n\n\nimport \"testing\"\nimport \"dict\"\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:26Z,_m,_f,0\n,,0,2018-05-22T19:53:36Z,_m,_f,0\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long,long\n#group,false,false,false,true,true,false,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,_value,code\n,,0,2018-05-22T19:53:26Z,_m,_f,0,2\n,,0,2018-05-22T19:53:36Z,_m,_f,0,2\n\"\nt_dict = (table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(\n fn: (r) => {\n codes = [:]\n \n return {r with code: dict.get(dict: codes, key: 0, default: 2)}\n },\n )\n\ntest _dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 14, }, File: "empty_dict_lambda_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:26Z,_m,_f,0\n,,0,2018-05-22T19:53:36Z,_m,_f,0\n\"", Start: ast.Position{ Column: 1, Line: 7, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 7, }, File: "empty_dict_lambda_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 7, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 14, }, File: "empty_dict_lambda_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:26Z,_m,_f,0\n,,0,2018-05-22T19:53:36Z,_m,_f,0\n\"", Start: ast.Position{ Column: 10, Line: 7, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:26Z,_m,_f,0\n,,0,2018-05-22T19:53:36Z,_m,_f,0\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 22, }, File: "empty_dict_lambda_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long,long\n#group,false,false,false,true,true,false,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,_value,code\n,,0,2018-05-22T19:53:26Z,_m,_f,0,2\n,,0,2018-05-22T19:53:36Z,_m,_f,0,2\n\"", Start: ast.Position{ Column: 1, Line: 15, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "empty_dict_lambda_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 15, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 22, }, File: "empty_dict_lambda_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long,long\n#group,false,false,false,true,true,false,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,_value,code\n,,0,2018-05-22T19:53:26Z,_m,_f,0,2\n,,0,2018-05-22T19:53:36Z,_m,_f,0,2\n\"", Start: ast.Position{ Column: 11, Line: 15, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long,long\n#group,false,false,false,true,true,false,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,_value,code\n,,0,2018-05-22T19:53:26Z,_m,_f,0,2\n,,0,2018-05-22T19:53:36Z,_m,_f,0,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 32, }, File: "empty_dict_lambda_test.flux", Source: "t_dict = (table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(\n fn: (r) => {\n codes = [:]\n \n return {r with code: dict.get(dict: codes, key: 0, default: 2)}\n },\n )", Start: ast.Position{ Column: 1, Line: 23, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 23, }, File: "empty_dict_lambda_test.flux", Source: "t_dict", Start: ast.Position{ Column: 1, Line: 23, }, }, }, Name: "t_dict", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 32, }, File: "empty_dict_lambda_test.flux", Source: "(table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(\n fn: (r) => {\n codes = [:]\n \n return {r with code: dict.get(dict: codes, key: 0, default: 2)}\n },\n )", Start: ast.Position{ Column: 10, Line: 23, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 23, }, File: "empty_dict_lambda_test.flux", Source: "table", Start: ast.Position{ Column: 24, Line: 23, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 24, }, File: "empty_dict_lambda_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)", Start: ast.Position{ Column: 24, Line: 23, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 24, }, File: "empty_dict_lambda_test.flux", Source: "start: 2018-05-22T19:53:26Z", Start: ast.Position{ Column: 14, Line: 24, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 24, }, File: "empty_dict_lambda_test.flux", Source: "start: 2018-05-22T19:53:26Z", Start: ast.Position{ Column: 14, Line: 24, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 24, }, File: "empty_dict_lambda_test.flux", Source: "start", Start: ast.Position{ Column: 14, Line: 24, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 24, }, File: "empty_dict_lambda_test.flux", Source: "2018-05-22T19:53:26Z", Start: ast.Position{ Column: 21, Line: 24, }, }, }, Value: parser.MustParseTime("2018-05-22T19:53:26Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 24, }, File: "empty_dict_lambda_test.flux", Source: "range(start: 2018-05-22T19:53:26Z)", Start: ast.Position{ Column: 8, Line: 24, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 24, }, File: "empty_dict_lambda_test.flux", Source: "range", Start: ast.Position{ Column: 8, Line: 24, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 25, }, File: "empty_dict_lambda_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 24, Line: 23, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 25, }, File: "empty_dict_lambda_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 13, Line: 25, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 25, }, File: "empty_dict_lambda_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 13, Line: 25, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 25, }, File: "empty_dict_lambda_test.flux", Source: "columns", Start: ast.Position{ Column: 13, Line: 25, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 25, }, File: "empty_dict_lambda_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 22, Line: 25, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 25, }, File: "empty_dict_lambda_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 23, Line: 25, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 25, }, File: "empty_dict_lambda_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 33, Line: 25, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 25, }, File: "empty_dict_lambda_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 8, Line: 25, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 25, }, File: "empty_dict_lambda_test.flux", Source: "drop", Start: ast.Position{ Column: 8, Line: 25, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 32, }, File: "empty_dict_lambda_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(\n fn: (r) => {\n codes = [:]\n \n return {r with code: dict.get(dict: codes, key: 0, default: 2)}\n },\n )", Start: ast.Position{ Column: 24, Line: 23, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 31, }, File: "empty_dict_lambda_test.flux", Source: "fn: (r) => {\n codes = [:]\n \n return {r with code: dict.get(dict: codes, key: 0, default: 2)}\n }", Start: ast.Position{ Column: 9, Line: 27, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 31, }, File: "empty_dict_lambda_test.flux", Source: "fn: (r) => {\n codes = [:]\n \n return {r with code: dict.get(dict: codes, key: 0, default: 2)}\n }", Start: ast.Position{ Column: 9, Line: 27, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 27, }, File: "empty_dict_lambda_test.flux", Source: "fn", Start: ast.Position{ Column: 9, Line: 27, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 31, }, File: "empty_dict_lambda_test.flux", Source: "(r) => {\n codes = [:]\n \n return {r with code: dict.get(dict: codes, key: 0, default: 2)}\n }", Start: ast.Position{ Column: 13, Line: 27, }, }, }, Body: &ast.Block{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 31, }, File: "empty_dict_lambda_test.flux", Source: "{\n codes = [:]\n \n return {r with code: dict.get(dict: codes, key: 0, default: 2)}\n }", Start: ast.Position{ Column: 20, Line: 27, }, }, }, Body: []ast.Statement{&ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 28, }, File: "empty_dict_lambda_test.flux", Source: "codes = [:]", Start: ast.Position{ Column: 13, Line: 28, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 28, }, File: "empty_dict_lambda_test.flux", Source: "codes", Start: ast.Position{ Column: 13, Line: 28, }, }, }, Name: "codes", }, Init: &ast.DictExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 28, }, File: "empty_dict_lambda_test.flux", Source: "[:]", Start: ast.Position{ Column: 21, Line: 28, }, }, }, Elements: []*ast.DictItem{}, Lbrack: nil, Rbrack: nil, }, }, &ast.ReturnStatement{ Argument: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "{r with code: dict.get(dict: codes, key: 0, default: 2)}", Start: ast.Position{ Column: 20, Line: 30, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "code: dict.get(dict: codes, key: 0, default: 2)", Start: ast.Position{ Column: 28, Line: 30, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "code", Start: ast.Position{ Column: 28, Line: 30, }, }, }, Name: "code", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "dict: codes, key: 0, default: 2", Start: ast.Position{ Column: 43, Line: 30, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "dict: codes", Start: ast.Position{ Column: 43, Line: 30, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "dict", Start: ast.Position{ Column: 43, Line: 30, }, }, }, Name: "dict", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "codes", Start: ast.Position{ Column: 49, Line: 30, }, }, }, Name: "codes", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "key: 0", Start: ast.Position{ Column: 56, Line: 30, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "key", Start: ast.Position{ Column: 56, Line: 30, }, }, }, Name: "key", }, Separator: nil, Value: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "0", Start: ast.Position{ Column: 61, Line: 30, }, }, }, Value: int64(0), }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "default: 2", Start: ast.Position{ Column: 64, Line: 30, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "default", Start: ast.Position{ Column: 64, Line: 30, }, }, }, Name: "default", }, Separator: nil, Value: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "2", Start: ast.Position{ Column: 73, Line: 30, }, }, }, Value: int64(2), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "dict.get(dict: codes, key: 0, default: 2)", Start: ast.Position{ Column: 34, Line: 30, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "dict.get", Start: ast.Position{ Column: 34, Line: 30, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "dict", Start: ast.Position{ Column: 34, Line: 30, }, }, }, Name: "dict", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "get", Start: ast.Position{ Column: 39, Line: 30, }, }, }, Name: "get", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 30, }, }, }, Name: "r", }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 30, }, File: "empty_dict_lambda_test.flux", Source: "return {r with code: dict.get(dict: codes, key: 0, default: 2)}", Start: ast.Position{ Column: 13, Line: 30, }, }, }, }}, Lbrace: nil, Rbrace: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 27, }, File: "empty_dict_lambda_test.flux", Source: "r", Start: ast.Position{ Column: 14, Line: 27, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 27, }, File: "empty_dict_lambda_test.flux", Source: "r", Start: ast.Position{ Column: 14, Line: 27, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 32, }, File: "empty_dict_lambda_test.flux", Source: "map(\n fn: (r) => {\n codes = [:]\n \n return {r with code: dict.get(dict: codes, key: 0, default: 2)}\n },\n )", Start: ast.Position{ Column: 8, Line: 26, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 26, }, File: "empty_dict_lambda_test.flux", Source: "map", Start: ast.Position{ Column: 8, Line: 26, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 23, }, File: "empty_dict_lambda_test.flux", Source: "table=<-", Start: ast.Position{ Column: 11, Line: 23, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 23, }, File: "empty_dict_lambda_test.flux", Source: "table", Start: ast.Position{ Column: 11, Line: 23, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 23, }, File: "empty_dict_lambda_test.flux", Source: "<-", Start: ast.Position{ Column: 17, Line: 23, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "_dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 6, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "_dict", Start: ast.Position{ Column: 6, Line: 34, }, }, }, Name: "_dict", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "() => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 14, Line: 34, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 20, Line: 34, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 111, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict}", Start: ast.Position{ Column: 21, Line: 34, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 22, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "input", Start: ast.Position{ Column: 22, Line: 34, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 49, Line: 34, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 49, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "csv", Start: ast.Position{ Column: 49, Line: 34, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "inData", Start: ast.Position{ Column: 54, Line: 34, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 29, Line: 34, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 29, Line: 34, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "testing", Start: ast.Position{ Column: 29, Line: 34, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 37, Line: 34, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 63, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "want", Start: ast.Position{ Column: 63, Line: 34, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 85, Line: 34, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 85, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "csv", Start: ast.Position{ Column: 85, Line: 34, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "outData", Start: ast.Position{ Column: 90, Line: 34, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 69, Line: 34, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 69, Line: 34, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "testing", Start: ast.Position{ Column: 69, Line: 34, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "loadMem", Start: ast.Position{ Column: 77, Line: 34, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "fn: t_dict", Start: ast.Position{ Column: 100, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "fn", Start: ast.Position{ Column: 100, Line: 34, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "t_dict", Start: ast.Position{ Column: 104, Line: 34, }, }, }, Name: "t_dict", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 34, }, File: "empty_dict_lambda_test.flux", Source: "test _dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 1, Line: 34, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "empty_dict_lambda_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "empty_dict_lambda_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "empty_dict_lambda_test.flux", Source: "import \"dict\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "empty_dict_lambda_test.flux", Source: "\"dict\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "dict", }, }}, Metadata: "parser-type=rust", Name: "empty_dict_lambda_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "empty_dict_lambda_test.flux", Source: "package dict_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "empty_dict_lambda_test.flux", Source: "dict_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "dict_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "package dict_test\n\n\nimport \"testing\"\nimport \"dict\"\n\ncodes = [:]\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:26Z,_m,_f,0\n,,0,2018-05-22T19:53:36Z,_m,_f,0\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long,long\n#group,false,false,false,true,true,false,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,_value,code\n,,0,2018-05-22T19:53:26Z,_m,_f,0,2\n,,0,2018-05-22T19:53:36Z,_m,_f,0,2\n\"\nt_dict = (table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(fn: (r) => ({r with code: dict.get(dict: codes, key: 1, default: 2)}))\n\ntest _dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 7, }, File: "empty_dict_lit_test.flux", Source: "codes = [:]", Start: ast.Position{ Column: 1, Line: 7, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 7, }, File: "empty_dict_lit_test.flux", Source: "codes", Start: ast.Position{ Column: 1, Line: 7, }, }, }, Name: "codes", }, Init: &ast.DictExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 7, }, File: "empty_dict_lit_test.flux", Source: "[:]", Start: ast.Position{ Column: 9, Line: 7, }, }, }, Elements: []*ast.DictItem{}, Lbrack: nil, Rbrack: nil, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 15, }, File: "empty_dict_lit_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:26Z,_m,_f,0\n,,0,2018-05-22T19:53:36Z,_m,_f,0\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "empty_dict_lit_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 15, }, File: "empty_dict_lit_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:26Z,_m,_f,0\n,,0,2018-05-22T19:53:36Z,_m,_f,0\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:26Z,_m,_f,0\n,,0,2018-05-22T19:53:36Z,_m,_f,0\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 23, }, File: "empty_dict_lit_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long,long\n#group,false,false,false,true,true,false,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,_value,code\n,,0,2018-05-22T19:53:26Z,_m,_f,0,2\n,,0,2018-05-22T19:53:36Z,_m,_f,0,2\n\"", Start: ast.Position{ Column: 1, Line: 16, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 16, }, File: "empty_dict_lit_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 16, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 23, }, File: "empty_dict_lit_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long,long\n#group,false,false,false,true,true,false,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,_value,code\n,,0,2018-05-22T19:53:26Z,_m,_f,0,2\n,,0,2018-05-22T19:53:36Z,_m,_f,0,2\n\"", Start: ast.Position{ Column: 11, Line: 16, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long,long\n#group,false,false,false,true,true,false,false\n#default,_result,,,,,,\n,result,table,_time,_measurement,_field,_value,code\n,,0,2018-05-22T19:53:26Z,_m,_f,0,2\n,,0,2018-05-22T19:53:36Z,_m,_f,0,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "t_dict = (table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(fn: (r) => ({r with code: dict.get(dict: codes, key: 1, default: 2)}))", Start: ast.Position{ Column: 1, Line: 24, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 24, }, File: "empty_dict_lit_test.flux", Source: "t_dict", Start: ast.Position{ Column: 1, Line: 24, }, }, }, Name: "t_dict", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "(table=<-) => table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(fn: (r) => ({r with code: dict.get(dict: codes, key: 1, default: 2)}))", Start: ast.Position{ Column: 10, Line: 24, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 24, }, File: "empty_dict_lit_test.flux", Source: "table", Start: ast.Position{ Column: 24, Line: 24, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 25, }, File: "empty_dict_lit_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)", Start: ast.Position{ Column: 24, Line: 24, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 25, }, File: "empty_dict_lit_test.flux", Source: "start: 2018-05-22T19:53:26Z", Start: ast.Position{ Column: 14, Line: 25, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 25, }, File: "empty_dict_lit_test.flux", Source: "start: 2018-05-22T19:53:26Z", Start: ast.Position{ Column: 14, Line: 25, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 25, }, File: "empty_dict_lit_test.flux", Source: "start", Start: ast.Position{ Column: 14, Line: 25, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 25, }, File: "empty_dict_lit_test.flux", Source: "2018-05-22T19:53:26Z", Start: ast.Position{ Column: 21, Line: 25, }, }, }, Value: parser.MustParseTime("2018-05-22T19:53:26Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 25, }, File: "empty_dict_lit_test.flux", Source: "range(start: 2018-05-22T19:53:26Z)", Start: ast.Position{ Column: 8, Line: 25, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 25, }, File: "empty_dict_lit_test.flux", Source: "range", Start: ast.Position{ Column: 8, Line: 25, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 26, }, File: "empty_dict_lit_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 24, Line: 24, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 26, }, File: "empty_dict_lit_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 13, Line: 26, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 26, }, File: "empty_dict_lit_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 13, Line: 26, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 26, }, File: "empty_dict_lit_test.flux", Source: "columns", Start: ast.Position{ Column: 13, Line: 26, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 26, }, File: "empty_dict_lit_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 22, Line: 26, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 26, }, File: "empty_dict_lit_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 23, Line: 26, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 26, }, File: "empty_dict_lit_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 33, Line: 26, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 26, }, File: "empty_dict_lit_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 8, Line: 26, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 26, }, File: "empty_dict_lit_test.flux", Source: "drop", Start: ast.Position{ Column: 8, Line: 26, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:26Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(fn: (r) => ({r with code: dict.get(dict: codes, key: 1, default: 2)}))", Start: ast.Position{ Column: 24, Line: 24, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "fn: (r) => ({r with code: dict.get(dict: codes, key: 1, default: 2)})", Start: ast.Position{ Column: 12, Line: 27, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "fn: (r) => ({r with code: dict.get(dict: codes, key: 1, default: 2)})", Start: ast.Position{ Column: 12, Line: 27, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "fn", Start: ast.Position{ Column: 12, Line: 27, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "(r) => ({r with code: dict.get(dict: codes, key: 1, default: 2)})", Start: ast.Position{ Column: 16, Line: 27, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "({r with code: dict.get(dict: codes, key: 1, default: 2)})", Start: ast.Position{ Column: 23, Line: 27, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "{r with code: dict.get(dict: codes, key: 1, default: 2)}", Start: ast.Position{ Column: 24, Line: 27, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "code: dict.get(dict: codes, key: 1, default: 2)", Start: ast.Position{ Column: 32, Line: 27, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "code", Start: ast.Position{ Column: 32, Line: 27, }, }, }, Name: "code", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "dict: codes, key: 1, default: 2", Start: ast.Position{ Column: 47, Line: 27, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "dict: codes", Start: ast.Position{ Column: 47, Line: 27, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "dict", Start: ast.Position{ Column: 47, Line: 27, }, }, }, Name: "dict", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "codes", Start: ast.Position{ Column: 53, Line: 27, }, }, }, Name: "codes", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "key: 1", Start: ast.Position{ Column: 60, Line: 27, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "key", Start: ast.Position{ Column: 60, Line: 27, }, }, }, Name: "key", }, Separator: nil, Value: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "1", Start: ast.Position{ Column: 65, Line: 27, }, }, }, Value: int64(1), }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "default: 2", Start: ast.Position{ Column: 68, Line: 27, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "default", Start: ast.Position{ Column: 68, Line: 27, }, }, }, Name: "default", }, Separator: nil, Value: &ast.IntegerLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "2", Start: ast.Position{ Column: 77, Line: 27, }, }, }, Value: int64(2), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "dict.get(dict: codes, key: 1, default: 2)", Start: ast.Position{ Column: 38, Line: 27, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "dict.get", Start: ast.Position{ Column: 38, Line: 27, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "dict", Start: ast.Position{ Column: 38, Line: 27, }, }, }, Name: "dict", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "get", Start: ast.Position{ Column: 43, Line: 27, }, }, }, Name: "get", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "r", Start: ast.Position{ Column: 25, Line: 27, }, }, }, Name: "r", }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "r", Start: ast.Position{ Column: 17, Line: 27, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "r", Start: ast.Position{ Column: 17, Line: 27, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "map(fn: (r) => ({r with code: dict.get(dict: codes, key: 1, default: 2)}))", Start: ast.Position{ Column: 8, Line: 27, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 27, }, File: "empty_dict_lit_test.flux", Source: "map", Start: ast.Position{ Column: 8, Line: 27, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 24, }, File: "empty_dict_lit_test.flux", Source: "table=<-", Start: ast.Position{ Column: 11, Line: 24, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 24, }, File: "empty_dict_lit_test.flux", Source: "table", Start: ast.Position{ Column: 11, Line: 24, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 24, }, File: "empty_dict_lit_test.flux", Source: "<-", Start: ast.Position{ Column: 17, Line: 24, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "_dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 6, Line: 29, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "_dict", Start: ast.Position{ Column: 6, Line: 29, }, }, }, Name: "_dict", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "() => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 14, Line: 29, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 20, Line: 29, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 111, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict}", Start: ast.Position{ Column: 21, Line: 29, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 22, Line: 29, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "input", Start: ast.Position{ Column: 22, Line: 29, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 49, Line: 29, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 49, Line: 29, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "csv", Start: ast.Position{ Column: 49, Line: 29, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "inData", Start: ast.Position{ Column: 54, Line: 29, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 29, Line: 29, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 29, Line: 29, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "testing", Start: ast.Position{ Column: 29, Line: 29, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 37, Line: 29, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 63, Line: 29, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "want", Start: ast.Position{ Column: 63, Line: 29, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 85, Line: 29, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 85, Line: 29, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "csv", Start: ast.Position{ Column: 85, Line: 29, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "outData", Start: ast.Position{ Column: 90, Line: 29, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 69, Line: 29, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 69, Line: 29, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "testing", Start: ast.Position{ Column: 69, Line: 29, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "loadMem", Start: ast.Position{ Column: 77, Line: 29, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "fn: t_dict", Start: ast.Position{ Column: 100, Line: 29, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "fn", Start: ast.Position{ Column: 100, Line: 29, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "t_dict", Start: ast.Position{ Column: 104, Line: 29, }, }, }, Name: "t_dict", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 29, }, File: "empty_dict_lit_test.flux", Source: "test _dict = () => ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_dict})", Start: ast.Position{ Column: 1, Line: 29, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "empty_dict_lit_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "empty_dict_lit_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "empty_dict_lit_test.flux", Source: "import \"dict\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "empty_dict_lit_test.flux", Source: "\"dict\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "dict", }, }}, Metadata: "parser-type=rust", Name: "empty_dict_lit_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "empty_dict_lit_test.flux", Source: "package dict_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "empty_dict_lit_test.flux", Source: "dict_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "dict_test", }, }, }}, Package: "dict_test", Path: "dict", }}
Functions ¶
func FromList ¶
func FromList(args interpreter.Arguments) (values.Value, error)
FromList will convert a list of values into a Dictionary.
func Get ¶
func Get(args interpreter.Arguments) (values.Value, error)
Get will retrieve a value from a Dictionary.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.