This repository has been archived by the owner. It is now read-only.

Merge grammar.js and typegrammar.js? #130

Open
alsonkemp opened this Issue Apr 24, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@alsonkemp
Collaborator

alsonkemp commented Apr 24, 2012

I was looking at fixing "Ambiguous syntax for functions, constructors" (pufuwozu#129) and have been reviewing grammar.js. I see that some of the grammar is broken out into typegrammar.js. Why? Would it be okay to merge them? I don't see typegrammar.js being used anywhere but in grammar.js.

It's a bit confusing to have to jump back and forth when reviewing the type system, so it'd be lovely to unify the two files.

@alsonkemp

This comment has been minimized.

Show comment Hide comment
@alsonkemp

alsonkemp Apr 25, 2012

Collaborator

... so ...

I'm merging the two over in my fork. Assuming that it doesn't go pear-shaped, I'll let you know when something interesting happens.

I'm also significantly restructuring grammar.js so that it's easier to understand.

Collaborator

alsonkemp commented Apr 25, 2012

... so ...

I'm merging the two over in my fork. Assuming that it doesn't go pear-shaped, I'll let you know when something interesting happens.

I'm also significantly restructuring grammar.js so that it's easier to understand.

@puffnfresh

This comment has been minimized.

Show comment Hide comment
@puffnfresh

puffnfresh Apr 30, 2012

Owner

Awesome.

The reason I split the two is because I need to generate a separate parser module for parsing module descripters (the .roym files).

No need for the grammar to live in separate files but sadly it seems like we need two parsers.

Owner

puffnfresh commented Apr 30, 2012

Awesome.

The reason I split the two is because I need to generate a separate parser module for parsing module descripters (the .roym files).

No need for the grammar to live in separate files but sadly it seems like we need two parsers.

@alsonkemp

This comment has been minimized.

Show comment Hide comment
@alsonkemp

alsonkemp May 1, 2012

Collaborator

Smashing. I'll try to get my updated lexer/grammar working in the next few days and will commit it for your review.

Note: I'm re-structuring/rearranging both. In particular, I'm going to move lexing towards being grammar unaware since the lexer is fairly tightly coupled (e.g. identifierToken). I like Haskell's definitions for both lexing and for grammar (http://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-160002.2), so am pushing in that direction.

Collaborator

alsonkemp commented May 1, 2012

Smashing. I'll try to get my updated lexer/grammar working in the next few days and will commit it for your review.

Note: I'm re-structuring/rearranging both. In particular, I'm going to move lexing towards being grammar unaware since the lexer is fairly tightly coupled (e.g. identifierToken). I like Haskell's definitions for both lexing and for grammar (http://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-160002.2), so am pushing in that direction.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.