-
Notifications
You must be signed in to change notification settings - Fork 1.1k
A symmetric meta programming framework #3634
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
85fa627
Fix #3597 - Don't check inline for params after pickling
odersky 63d02a6
Fix condition in expandPrivate
odersky f93368d
Fix #3596: Handle supercall arguments in unpickler
odersky 36ede6f
When unpickling, enter only class members into enclosing scope.
odersky bebefec
Clean up treatment of local contexts in unpickler
odersky 227f8be
Drop localDummies again
odersky 02eebc2
Add prefix types
odersky 7303898
Cleanup of ElimJavaPackages
odersky 141acaa
Rename ElimJavaPackages -> ElimPackagePrefixes
odersky 6a9c027
Initial meta framework classes and modules
odersky e52fe74
Utility method: reporting
odersky a5134ca
Add quote syntax
odersky f3ff4e9
Add quote typechecking
odersky b21e638
Add quote reification framework
odersky 7418cef
Support printing of Quote trees
odersky 67a808a
Fix isType/isTerm predicates for splices
odersky a53c2ff
Fix missing core libs test
odersky 1a7803c
Change reify for types
odersky 72c32c5
Rename reify -> unpickle
odersky b35ff5f
Make ReifyQuotes a macro phase
odersky 0e0f31d
Don't force quote methods
odersky 1bdf8a0
Remove outdated comment
odersky 87ee12f
Make '( and '{ tokens that can start an expression
odersky 4fb2eb0
Revamp of ReifyQuotes
odersky 1134507
Rename meta -> quoted
odersky d87db6c
Suppress some staging level errors
odersky dedf671
Remove printing inefficiencies
odersky bc6c690
Pull inlined bindings under a splice
odersky f2c09d4
Inline by-name parameters directly
odersky db7e42a
Add test case
odersky a9c3b5f
Fix layout of implicit error messages
odersky 90acfed
Polishings to TreePickler
odersky 205b4cd
Add MacroTransform that allows implicit search
odersky b466e0a
Allow cross-stage persistence for types
odersky 22d7429
Add Quotable type class
odersky dbb7c81
Add Let to staged interpreter test
odersky 300c37e
Don't require implicits to make type refs persist stages
odersky 646453a
Add infrastructure for pickling/unpickling with holes and splices
odersky 376d325
Print TypeDefs from trees
odersky a1bff5f
Make TreeTypeMap non-final
odersky 6a252e0
Move Unpickler to runtime.quoted
odersky bc6dde8
Export more printing methods from Printer
odersky d8dd739
Add Lambda method to tpd
odersky 1d52ab7
ReifyQuotes v2
odersky a8b9ba7
Mark inline methods containing splices as macros
odersky 4023502
Eliminate macros in RefChecks
odersky d1abf40
Typecheck macros as if they were in a quoted context
odersky 04d3a58
Refine handling of inline parameters of macros
odersky 94e7c83
Force definitions of quote methods when initializing Definitions
odersky 2e3c56b
Syntax polishing
odersky 0c6cbc3
Rename Quotable -> Liftable
odersky b90ed13
Add reference documentation
odersky 21ad0db
Fix test
odersky b0437ce
Fix syntax highlighting in docs
odersky 5fe6d15
Doecumentation fixes
odersky 07bbb2b
More doc fixes
odersky 8656be3
Add section "Limitations to Splicing"
odersky 833775f
Address review comments on reference section
odersky 33a93a6
Use different names for quote and type quote methods
odersky 39ea6fb
Set Macro flag and containsQuotesOrSplices in PostTyper
odersky aa252fc
Reorder printers alphabetically
odersky 8f048a7
Add test to pending
odersky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import scala.quoted._ | ||
object Macros { | ||
inline def assert(expr: => Boolean): Unit = ~ assertImpl('(expr)) | ||
def assertImpl(expr: Expr[Boolean]) = '{ () } | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Test { | ||
import Macros._ | ||
val x = 1 | ||
assert(x != 0) | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, this one works fine as a run test in #3662