Hi, Phil Back has kindly fixed the PetitYAML so it mostly works now. The only problem I've encountered was some weird misparsing of strings containing slashes, e.g. "5/". In any case: Install PetitParser (from Catalog or somewhere), load PetitYAML package (this is already loaded when loading PP from catalog). And then parse your string ``` PPYAMLGrammar parse: ' language: c sudo: false cache: directories: - opensmalltalk-vm/.thirdparty-cache git: depth: "5"'. ``` "Dictionary( 'cache'->a Dictionary( 'directories'->#('opensmalltalk-vm/.thirdparty-cache') ) 'git'->a Dictionary( 'depth'->'5' ) 'language'->'c' 'sudo'->'false' )" Take a look at PPYAMLGrammarTest>>testTravisYml too. Peter On Fri, Aug 18, 2017 at 09:45:00AM +0200, H. Hirzel wrote:
I am not looking for a complete implementation which is quite an effort
but rather for a subset which does simple things such as parsing - a list of hashes (dictionaries), - a dictionary of dictionaries (nested to arbitrary depths), - multi-line comments
--Hannes
On 8/16/17, H. Hirzel <hannes.hirzel@gmail.com> wrote:
Are there any news about a YAML parser for Pharo 5 / 6.1?
--Hannes
On 5/29/17, Peter Uhnak <i.uhnak@gmail.com> wrote:
Hi,
do we have a working parser for YAML?
There's PPYAMLGrammar (in PetitParser), however it doesn't seem to work in Pharo 6 at all (not even tests pass). In Pharo 5 the tests are green, but using it on YAML content still fails... with small fix I managed it to "pass", however the output seems to be a very fine-grained AST decomposition and not the expected output (dictionaries/arrays).
So do we have some else/working?
YAML specs have BNF descriptions, so maybe SmaCC can generate it? (I don't know SmaCC, so maybe this is not how it works.)
Thanks, Peter