-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #170 from rise-lang/sequence-syntax
- Loading branch information
Showing
250 changed files
with
3,262 additions
and
713 deletions.
There are no files selected for viewing
420 changes: 247 additions & 173 deletions
420
meta/src/main/scala/meta/generator/DPIAPrimitives.scala
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
package meta.parser.DPIA | ||
|
||
import fastparse.ScalaWhitespace._ | ||
import fastparse._ | ||
import meta.parser.rise | ||
import meta.parser.shared.Identifier | ||
|
||
object Kind { | ||
sealed trait AST | ||
object AST { | ||
case class RiseKind(riseKind: rise.Kind.AST) extends AST | ||
case object Access extends AST | ||
case class VariadicKind(n: String, kind: AST) extends AST | ||
} | ||
|
||
def Kind[_: P]: P[AST] = P( | ||
rise.Kind.Kind.map(AST.RiseKind) | | ||
"access".!.map(_ => AST.Access) | ||
) | ||
def Kind[_: P]: P[AST] = { | ||
def OnlyKind: P[AST] = P(rise.Kind.Kind.map(AST.RiseKind) | "access".!.map(_ => AST.Access)) | ||
|
||
OnlyKind | (Identifier ~ "*" ~ OnlyKind).map(AST.VariadicKind.tupled) | ||
} | ||
} |
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
Oops, something went wrong.