nyousefi / Fountain

An open source implementation of the Fountain screenplay formatting language.
http://fountain.io
MIT License
557 stars 55 forks source link

Replacing regexes with a formal Parsing Expression Grammar (PEG)? #53

Open bjmc opened 8 months ago

bjmc commented 8 months ago

Hello, I think Fountain is a really interesting project! As an exercise to learn about Parsing Expression Grammar, I've been trying to write up a formal PEG specification for the Fountain format.

This is very much still a work in progress, but I have a PEST grammar for Fountain defined here that I believe satisfies all the test cases in this repo.

I realize this is kind of presumptuous, but how would you feel about adopting/collaborating on an "official" PEG specification for the Fountain format? I think having one formal definition as an implementation-agnostic specification would be cleaner than a series of regular expressions in Objective C code.