This repository was archived by the owner on Nov 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +11
-9
lines changed
Expand file tree Collapse file tree 5 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,15 @@ namespace lib_ruby_parser
99
1010 extern " C"
1111 {
12- ParserResultBlob LIB_RUBY_PARSER_parse (ParserOptionsBlob options, ByteListBlob input );
12+ ParserResultBlob LIB_RUBY_PARSER_parse (ByteListBlob input, ParserOptionsBlob options );
1313 }
1414
15- ParserResult parse (ParserOptions options, ByteList input )
15+ ParserResult parse (ByteList input, ParserOptions options )
1616 {
1717 return from_blob<ParserResultBlob, ParserResult>(
1818 LIB_RUBY_PARSER_parse (
19- into_blob<ParserOptions, ParserOptionsBlob >(std::move (options )),
20- into_blob<ByteList, ByteListBlob >(std::move (input ))));
19+ into_blob<ByteList, ByteListBlob >(std::move (input )),
20+ into_blob<ParserOptions, ParserOptionsBlob >(std::move (options ))));
2121 }
2222}
2323
@@ -39,7 +39,9 @@ namespace lib_ruby_parser
3939
4040 ByteList input = ByteList::Copied (" 2 + 3" , 5 );
4141
42- ParserResult result = parse (std::move (options), std::move (input));
42+ ParserResult result = parse (
43+ std::move (input),
44+ std::move (options));
4345
4446 assert_eq (result.ast ->tag , Node::Tag::SEND);
4547 assert_eq (result.tokens .len , 4 ); // tINT tPLUS tINT EOF
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ namespace lib_ruby_parser
1010 Parses given `input` according to `option`.
1111 This is the main entrypoint API.
1212 */
13- ParserResult parse (ParserOptions options, ByteList input );
13+ ParserResult parse (ByteList input, ParserOptions options );
1414
1515#ifdef TEST_ENV
1616 void run_test_group_api (void );
Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ int main()
3030 lib_ruby_parser::ByteList input = std::move (file.content );
3131
3232 lib_ruby_parser::parse (
33- std::move (options ),
34- std::move (input ));
33+ std::move (input ),
34+ std::move (options ));
3535 }
3636
3737 std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now ();
Original file line number Diff line number Diff line change @@ -81,8 +81,8 @@ pub extern "C" fn LIB_RUBY_PARSER_drop_parser_result(parser_result: *mut ParserR
8181
8282#[ no_mangle]
8383pub extern "C" fn LIB_RUBY_PARSER_parse (
84- options : ParserOptionsBlob ,
8584 input : ByteListBlob ,
85+ options : ParserOptionsBlob ,
8686) -> ParserResultBlob {
8787 let options = CParserOptions :: from ( options) ;
8888 let options = lib_ruby_parser:: ParserOptions :: from ( options) ;
You can’t perform that action at this time.
0 commit comments