janestreet / sexplib

Automated S-expression conversion
MIT License
147 stars 27 forks source link

support for csexpr ? #33

Closed abate closed 4 years ago

abate commented 6 years ago

I want to parse a string of the form : "(10:public-key(3:rsa(1:n513:\000\195#n\248\227o0\183\252 ZN\1 ... " that is encoded as a csexpr . It this possible with sexplib ? Would it be possible to add support for this kind of sexpr encoding ?

thanks !

trefis commented 6 years ago

Ping @xclerc .

xclerc commented 6 years ago

Sexplib seems to successfully parse the following OCaml string literal: "(10:public-key(3:rsa(1:n513:\000\195#n\248\227o0\183\252 ZN\001 ... )))"

Is the string you posted an OCaml literal?

xclerc commented 6 years ago

Looks like I misunderstood the question... I will have a look to determine whether we could support canonical s-expressions.

aalekseyev commented 4 years ago

It looks like today you can use the csexp library to parse strings into Sexp.t. I'm closing this issue because I think there is no need for a tighter integration here.