Repository navigation
v0.2.0
Includes, errors with a place, environment variables and HOCON out.
Added
- Includes: files,
file(),required()and http(s) URLs, as.conf,.jsonor.properties, read throughhocon.parseFromFileandparseFromFileLeaky. A slow server iserror.IncludeTimeoutafterParseOptions.http_timeout(30 s). - Errors with a place:
ParseOptions.diagnosticsgets the file, line, column and the line itself, andrenderprints it with a caret, as the zig compiler does. A value of the wrong type names its path, what the type wanted and where the value is written. - A key written again over a substitution of itself (
path = ${path} ":/opt"), and+=. - Environment variables: a
${…}the document does not answer reads the variable of the same name,${X[]}a list fromX_0,X_1, … (ParseOptions.env)..keepleaves them for later. hocon.stringifyandstringifyAllocwrite any value as HOCON, an unresolved one too, which is the one file to deploy.hocon.parsePathturns a path given as text into keys.--env=process|none|keepon the command line.
Changed
parseFromSliceandparseFromSliceLeakytakeParseOptionsas their last argument;.{}does what they did before.hocon <file>prints HOCON;--jsongives the JSON it printed before.- A value that starts like a number has to be a JSON number:
01and-alone are errors, as in JSON. - Input over 64 MiB is
error.StreamTooLong, a file that is not UTF-8error.InvalidUtf8at the first bad byte.
Fixed
437 of the 445 tests in the conformance suite pass, up from 307.
- Every whitespace character the spec lists separates, a lone
\rincluded;//right after unquoted text starts a comment. - A comma separates once; array elements on one line concatenate; a document that starts with
[is a list. - Unquoted text may start with
_,%or a letter outside ASCII;1e+5is a number; an escaped backslash before the closing quote ends the string. ${.a}is an error, as the key.ais.
How much of the code in src/ is written by hand, the rest with AI, counted with git blame over the lines that are not empty, by who wrote the commit each line comes from; moved code stays its author's. The tests are left out: most of them are written with AI.
| share | |
|---|---|
| Tokenizer | 74 % |
| AST | 58 % |
| Value | 19 % |
| Config | 54 % |
| API and CLI | 5 % |
all of src/ |
33 % of 5342 lines |
| conformance to the spec | 98 % (437 of 445 tests) |