-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement quotation macro from scratch
- Extend custom `MetaParser` to allow syntax-changes in the quasiquote - Add helper class for detecting dotted arguments e.g. `[..$xs]` - Add support for splicing multiple `LambdaTerms` into lists Todo: - Other possible ways to splice terms into other terms - Unlifting and unsplicing `LambdaTerms`
- Loading branch information
Showing
4 changed files
with
204 additions
and
99 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
macros/src/main/scala/me/rexim/morganey/meta/DottedHole.scala
This file contains 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,9 @@ | ||
package me.rexim.morganey.meta | ||
|
||
private[meta] object DottedHole { | ||
|
||
def unapply(arg: String): Option[Int] = | ||
if (arg startsWith "..") Hole.unapply(arg stripPrefix "..") | ||
else None | ||
|
||
} |
This file contains 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
This file contains 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
This file contains 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