PEG for Python style indentation
Pure PEG cannot parse indentation. But peg.js can. I did a quick-and-dirty experiment (being inspired by Ira Baxter’s comment about cheating) and wrote a simple tokenizer. For a more complete solution (a complete parser) please see this question: Parse indentation level with PEG.js /* Initializations */ { function start(first, tail) { var done = [first[1]]; … Read more