-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Language agnostic test suite and grammar #73
Comments
I think we should pull the test data and assertions out of the existing tests into example files, and then use them in data-driven testing. I don't think another repo is needed. There is a PEG-based parser in here, which kinda-mostly defines the grammar. However its pretty cluttered, and the grammar is probably not the cleanest either. https://github.com/flowbased/fbp/blob/master/grammar/fbp.peg |
I like putting the valid cases into separate files under Pull requests very welcomed! |
There is also a parser for FBP DSL written in JavaScript -
https://github.com/jpaulm/parsefbp .
Personally I have never found PEG-based parsers that easy to work with.
ParseFBP has a simple structure, and is designed to be easy to invoke and
modify.
ParseFBP uses a technology called "BabelParser", which I have been using
for parsing jobs for decades - see
https://www.npmjs.com/package/babelparser - and can in fact be used for
other parsing jobs.
|
That makes a lot of sense to me, it would be great to have a way to cross-check multiple representations of the same graph.
Could you point me to some test data I can scrape for examples please? I would like to try to submit a PR.
Thanks for the note, it looks good but I was thinking about something more standard, language agnostic and possibly widespread, maybe a pure grammar, something similar to a BNF. Anyway, I agree with you about PEG, mixing lexer and grammar in the same place doesn't sound neat at all (pretty convenient though). |
p.s: @jonnor I don't know whether this is a GitHub glitch or something, but I see that you replied in place of my comment modifying it actually :) |
I think we should start with the existing tests. Each There is a decent amount of .FBP files out there, but we don't know beforehand if these are valid or not. |
@nazavode my apologies! The glitch was in my brain I fear... I wanted to have the quote so I clicked edit, then must have forgotten to copy-paste into a new comment. |
@jonnor cheers :) Thanks for the pointers, I'm going to look into these trying to come up with something useful (beginning from your own coffee unit tests I think). |
I'm currently developing a Python FBP runtime focused on brevity meant to be a building block for more complex architectures. I wrote a PEG based parser for FBP DSL and I'm looking for as many examples as I could find to incorporate them into my test suite. What do you think about a language agnostic repo for test data just like some folks did for TOML:
In that repo you can find lots of valid and invalid test cases, extremely time saving for someone who's writing an encoder/decoder.
The same thing goes for the language specification: snooping around in your projects here on GitHub, I guessed that some language features are obscure to say at least, and a proper language specification is missing. This FBP language repo could become a place where to find a proper grammar (EBNF?), links to known parsers, etc.
The text was updated successfully, but these errors were encountered: