Right now it appears the Rust API exposes 3 ways to parse a Spec:
- parse from a file with
parse_file
- parse from a script file with
parse_script
- parse from in-memory string (deprecated) with
parse
I am attempting to write a program that will embed scripts into a binary (for running scripts with a self-contained interpreter), and this interpreter supports #USAGE comments natively. For this embedded script scenario, I see two solutions:
- Parse the USAGE comments out of the script embedded as a string in the binary.
- Parse the USAGE comments at compile-time and serialize them into the binary (currently blocked by
Spec implementing Serialize but not Deserialize).
Either solution would solve my problem; parsing the in-memory #USAGE comments seems simpler to me.
Right now it appears the Rust API exposes 3 ways to parse a
Spec:parse_fileparse_scriptparseI am attempting to write a program that will embed scripts into a binary (for running scripts with a self-contained interpreter), and this interpreter supports
#USAGEcomments natively. For this embedded script scenario, I see two solutions:SpecimplementingSerializebut notDeserialize).Either solution would solve my problem; parsing the in-memory
#USAGEcomments seems simpler to me.