cxxxr / cl-toml Goto Github PK
View Code? Open in Web Editor NEWTOML v0.4.0 parser and encoder
License: MIT License
TOML v0.4.0 parser and encoder
License: MIT License
This is probably human error on my part, as I'm a CL newbie, but I am having issues with string values read from a TOML file being unacceptable to various functions in widely used libraries. For example, I load a hostname for a server to bind to and pass it to usocket:socket-server, and get a type-case error saying something like "127.0.0.1" is not a SIMPLE-STRING. Similar results if I read a path to a cert and try to pass it to cl+ssl:make-ssl-server-stream.
Everything I try in the repl says that they are strings, and that they are EQUAL to working strings I have entered by hand. They work properly if I encode and decode them through babel: (babel:octets-to-string (babel:string-to-octets bad-string)).
I'm sure I'm doing something wrong here, but I can't see what.
Hello! In using this library I ran across a small issue with a TOML file I was parsing.
Data that doesn't end in a comment works:
(defparameter *toml-data* "outcome = \"This works\"")
(cl-toml:parse *toml-data*)
#<HASH-TABLE :TEST EQUAL :COUNT 1 {10065DCB63}>
But when the data ends in a comment, like this:
(defparameter *toml-data* "outcome = \"This doesn't\"
# Add more here...")
(cl-toml:parse *toml-data*)
I get this error:
At
outcome = "This doesn't"
# Add more here...
^ (Line 2, Column 0, Position 25)
In context TOPLEVEL:
While parsing TOPLEVEL. Expected:
the character #1=Newline
or the character Space
or the character " (QUOTATION_MARK)
or the character # (NUMBER_SIGN)
or the character [ (LEFT_SQUARE_BRACKET)
or any character satisfying BARE-KEY-CHARACTER-P
or <end of input>
or anything but the character #1#
[Condition of type ESRAP:ESRAP-PARSE-ERROR]
Which is odd because the character it's complaining about is certainly a "# (NUMBER_SIGN)" like it's expecting. Again, this only happens when the last line of the TOML is a comment.
Please let me know if you need any more information or help debugging the issue.
Thanks,
Brooks J Rady
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.