Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various bugfixes and improvements for the quasiquotes #2910

Merged
merged 22 commits into from
Sep 11, 2013

Conversation

densh
Copy link
Contributor

@densh densh commented Sep 5, 2013

Fixes the following bugs:

Improves handling of the following language constructs:

  • new expressions
  • special handling of early definitions for classes, traits and objects
  • automatic setting of the flags appropriate for function and class parameters
  • better handling of class/case class/trait parents
  • valdefs and vardefs
  • type refinement
  • better support for handling of annotations
  • function types and literals
  • changes semantics of blocks, applied and typeapplied splicing and extraction

And lastly:

  • makes the annoying postfixOps warning go away

Review by @retronym

Some discussion on the previous version of the pr.

This is needed for quasiquotes to implement SyntacticNew combinator.
1. Make superPos parameter optional with default value NoPosition
2. use Option instead of List for local optional constructor variable
1. blocks now match single term-level expressions to account for
   automatic block elimination. E.g.

   val q"{ ..$stats }" = q"foo"

   will match into stats = List(q"foo"). This is useful to uniformly
   deal with blocks on term level.

2. blocks in quasiquotes collapse into single expressions

3. Applied and TypeApplied now have constructors too which helps
   to unify matching and extraction in quasiquote reifier

4. TypeApplied now matches AppliedTypeTree too

5. Add Syntactic prefix to Applied and TypeApplied
Syntax spec mislead me to believe that annotation can't have type
parameters or multiple argument lists... I guess the lesson here is
don't trust the spec.
@retronym
Copy link
Member

retronym commented Sep 6, 2013

Sorry I didn't have time yet for a full review, I'll do that on Monday at the latest. What I've seen so far is really well structured, great work!

@ghost ghost assigned retronym Sep 6, 2013
@retronym
Copy link
Member

retronym commented Sep 9, 2013

I think this is just about ready to go, I'd just like #2910 (comment) addressed before merging.

@xeno-by
Copy link
Contributor

xeno-by commented Sep 9, 2013

@retronym Yep, very much agree. Great work!

@retronym
Copy link
Member

After some discussion, we've decided to defer the refactoring of TupleClass and FunctionClass, because there are a few nuances in that design that we want to think about.

@retronym
Copy link
Member

LGTM

retronym added a commit that referenced this pull request Sep 11, 2013
Various bugfixes and improvements for the quasiquotes
@retronym retronym merged commit 6c78a28 into scala:master Sep 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants