Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Merge grammar.js and typegrammar.js? #130

Open
alsonkemp opened this Issue · 3 comments

2 participants

@alsonkemp
Collaborator

I was looking at fixing "Ambiguous syntax for functions, constructors" (#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
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.

@puffnfresh
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.

@alsonkemp
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.