Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix https://github.com/roogle-rs/roogle/issues/18 #19

Merged

Conversation

asukaminato0721
Copy link
Contributor

@asukaminato0721 asukaminato0721 commented Jul 13, 2024

If I understand the parser correctly,

it doesn't support

type -> type

the bracket is necessary. As #5 said.

so I just change to multispace0.

the result:

curl -X GET \
  -d "fn(Option<Result<T, E>>) -> Result<Option<T>, E>>" \
                                         "localhost:8000/search?scope=set:libstd"
[{"name":"transpose","path":["core","option","Option","transpose"],"link":["core","option","enum.Option.html#method.transpose"],"docs":"Transposes an `Option` of a [`Result`] into a [`Result`] of an `Option`.\n\n[`None`] will be mapped to <code>[Ok]\\([None])</code>.\n<code>[Some]\\([Ok]\\(\\_))

and

curl -X GET \
 -d "fn (Option<Result<T, E>>) -> Result<Option<T>, E>>" \
                                         "localhost:8000/search?scope=set:libstd"
[{"name":"transpose","path":["core","option","Option","transpose"],"link":["core","option","enum.Option.html#method.transpose"],"docs":"Transposes an `Option` of a [`Result`] into a [`Result`] of an `Option`.\n\n[`None`] will be mapped to <code>[Ok]\\([None])</code>.\n<code>[Some]\\([Ok]\\(\\_))</code> 

so it seems work properly.


to fix the

fn(xx)
vs
fn f(xx)

I let the space before f, instead of after fn.


to fix #5, I guess add a alt may help.

or something like delimited( opt( char('(') ), xx , opt( char(')') ) )

@asukaminato0721
Copy link
Contributor Author

asukaminato0721 commented Jul 13, 2024

this may have problem with fn f(xx) -> xx fixed.

@asukaminato0721 asukaminato0721 changed the title fix part of https://github.com/roogle-rs/roogle/issues/18 fix https://github.com/roogle-rs/roogle/issues/18 Jul 13, 2024
@asukaminato0721
Copy link
Contributor Author

@hkmatsumoto now it should work.

Copy link
Member

@hkmatsumoto hkmatsumoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@hkmatsumoto hkmatsumoto merged commit 9b4627d into roogle-rs:main Aug 5, 2024
4 checks passed
@asukaminato0721 asukaminato0721 deleted the support-fn(type)-->-type branch August 5, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

missing brackets leads to interesting results
2 participants