Skip to content
This repository was archived by the owner on Jun 10, 2025. It is now read-only.

[WIP] S-expression parsing of text modules #104

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

pipermerriam
Copy link
Member

What was wrong?

Issue #

How was it fixed?

Summary of approach.

Cute Animal Picture

put a cute animal picture link inside the parentheses

<typedef>* <func>* <import>* <export>* <table>? <memory>? <global>* <elem>* <data>* <start>? ;; =
( module <typedef>* <func>* <import>* <export>* <table>? <memory>? <global>* <elem>* <data>* <start>? )
"""
from pyparsing import (

This comment was marked as resolved.

This comment was marked as resolved.

@pipermerriam pipermerriam force-pushed the piper/s-expression-parsing-of-text-modules branch from eadbb0c to 30ef02a Compare March 5, 2019 16:06
@davesque
Copy link
Contributor

davesque commented Mar 8, 2019

Was just taking a look at this. It looks like you've written a grammar which is pretty explicit. Is there a reason you didn't go with a more generic s-expression grammar and then verify s-expression content as a kind of post-processing step? I'm wondering if that wouldn't be simpler and allow you to forgo any possible headaches relating to writing a lengthy grammar.

@davesque
Copy link
Contributor

davesque commented Mar 8, 2019

Actually, reviewing the WASM spec now, it looks like the text grammar is pretty well-defined. So I guess that's probably one reason you did it that way.

@pipermerriam
Copy link
Member Author

Actually, reviewing the WASM spec now, it looks like the text grammar is pretty well-defined. So I guess that's probably one reason you did it that way.

Yeah, I took their provided grammar and am converting it bit-by-bit to parsimonious.

I had that thought yesterday (use a generic s-expression grammar), but I think I like the up-front validation that this explicit grammar provides.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants