ScalametaParser

scala.meta.internal.parsers.ScalametaParser
See theScalametaParser companion object
class ScalametaParser(input: Input)(implicit dialect: Dialect)

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

case object AutoPos extends Pos

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Pos
trait EndPos
trait StartPos
class Object
trait Matchable
class Any
Show all
Self type
AutoPos.type
sealed abstract class InfixContext

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object OwnedByClass extends TemplateOwner

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object OwnedByEnum extends TemplateOwner

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object OwnedByGiven extends TemplateOwner

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object OwnedByObject extends TemplateOwner

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object OwnedByTrait extends TemplateOwner

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Methods which implicitly propagate the context in which they were called: either in a pattern context or not. Formerly, this was threaded through numerous methods as boolean isPattern.

Methods which implicitly propagate the context in which they were called: either in a pattern context or not. Formerly, this was threaded through numerous methods as boolean isPattern.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object noSeq
object seqOK
object outPattern
Show all

Methods which implicitly propagate whether the initial call took place in a context where sequences are allowed. Formerly, this was threaded through methods as boolean seqOK.

Methods which implicitly propagate whether the initial call took place in a context where sequences are allowed. Formerly, this was threaded through methods as boolean seqOK.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object noSeq
object seqOK
sealed trait TemplateOwner

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object OwnedByClass
object OwnedByEnum
object OwnedByGiven
object OwnedByObject
object OwnedByTrait
Show all
implicit class XtensionToken(tok: Token)

Attributes

Supertypes
class Object
trait Matchable
class Any
object noSeq extends SeqContextSensitive

The implementation for parsing inside of patterns at points where sequences are disallowed.

The implementation for parsing inside of patterns at points where sequences are disallowed.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
noSeq.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

The implementation of the context sensitive methods for parsing outside of patterns.

The implementation of the context sensitive methods for parsing outside of patterns.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
outPattern.type
object patInfixContext extends InfixContext

Attributes

Supertypes
class InfixContext
class Object
trait Matchable
class Any
Self type
object seqOK extends SeqContextSensitive

The implementation for parsing inside of patterns at points where sequences are allowed.

The implementation for parsing inside of patterns at points where sequences are allowed.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
seqOK.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class InfixContext
class Object
trait Matchable
class Any
Self type

Value members

Concrete methods

def accept[T <: Token : ClassTag]: Unit

Consume one token of the specified type, or signal an error if it is not there.

Consume one token of the specified type, or signal an error if it is not there.

Attributes

def acceptIfStatSep(): Boolean
def acceptStatSep(): Boolean
def acceptStatSepOpt(): Boolean
final def ahead[T](body: => T): T

Scoping operator used to temporarily look into the future. Backs up token iterator before evaluating a block and restores it after.

Scoping operator used to temporarily look into the future. Backs up token iterator before evaluating a block and restores it after.

Attributes

def annots(skipNewLines: Boolean, allowArgss: Boolean): List[Annot]
def annotsBuf[T >: Annot](annots: ListBuffer[T], skipNewLines: Boolean, insidePrimaryCtorAnnot: Boolean, allowArgss: Boolean): Unit
def argumentPattern(): Pat
def argumentPatterns(): List[Pat]
def atCurPos[T <: Tree](body: => T): T
def atCurPosEmpty[T <: Tree](body: => T): T
def atCurPosEmptyNext[T <: Tree](body: => T): T
def atCurPosNext[T <: Tree](body: => T): T
def atOrPeekAfterEOL(body: Token => Boolean): Boolean
def atPos[T <: Tree](start: StartPos, end: EndPos)(body: => T): T
def atPos[T <: Tree](start: Int, end: EndPos)(body: T): T
def atPos[T <: Tree](pos: Int)(body: => T): T
def atPosEmpty[T <: Tree](pos: Int)(body: => T): T
def atPosEmpty[T <: Tree](pos: StartPos)(body: => T): T
def atPosIf[T <: Tree](start: StartPos, end: EndPos)(body: => Option[T]): Option[T]
def atPosIf[T <: Tree](start: Int, end: EndPos)(body: Option[T]): Option[T]
def atPosOpt[T <: Tree](start: StartPos, end: EndPos)(body: => T): T
def atPosOpt[T <: Tree](start: Int, end: EndPos)(body: T): T
def atPosTry[T <: Tree](start: StartPos, end: EndPos)(body: => Try[T]): Try[T]
def atPosTryOpt[T <: Tree](start: StartPos, end: EndPos)(body: => Try[T]): Try[T]
def atPosWithBody[T <: Tree](startPos: Int, body: T, endPos: Int): T
def autoEndPos[T <: Tree](start: Int)(body: => T): T
def autoEndPos[T <: Tree](start: StartPos)(body: => T): T
def autoEndPosOpt[T <: Tree](start: Int)(body: => T): T
def autoEndPosOpt[T <: Tree](start: StartPos)(body: => T): T
def autoPos[T <: Tree](body: => T): T
def autoPosIf[T <: Tree](body: => Option[T]): Option[T]
def autoPosOpt[T <: Tree](body: => T): T
def autoPosTry[T <: Tree](body: => Try[T]): Try[T]
def autoPrevPos[T <: Tree](body: => T): T
def blockStatSeq(allowRepeated: Boolean): List[Stat]
def bound[T : ClassTag]: Option[Type]
def caseClause(forceSingleExpr: Boolean): Case
def caseClauses(): List[Case]
def caseClausesIfAny(): Option[List[Case]]
def casesBlock(): CasesBlock
def casesBlockIfAny(): Option[CasesBlock]
def checkAssoc(op: Name, leftAssoc: Boolean): Unit
def classDef(mods: List[Mod]): Class
final def commaSeparated[T <: Tree : ClassTag](part: => T): List[T]
final def commaSeparatedWithIndex[T <: Tree : ClassTag](part: Int => T): List[T]
def condExpr(): Term
def constrInternal(): Block
def contextBoundOrAlias(allowAlias: Boolean): Type
def currIndex: Int
def currToken: Token
def defOrDclOrSecondaryCtor(mods: List[Mod], enumCaseAllowed: Boolean, secondaryConstructorAllowed: Boolean): Stat
def derivesClasses(): List[Type]
final def dropAnyBraces[T](body: => T): T
def ellipsis[T <: Tree : ClassTag](ell: Ellipsis, rank: Int, extraSkip: => Unit): T
def ellipsis[T <: Tree : ClassTag](ell: Ellipsis): T & Quasi
def ellipsis[T <: Tree : ClassTag](ell: Ellipsis, extraSkip: => Unit): T & Quasi
def endMarker(): Stat
def entryPointAmmonite(): MultiSource
def entrypointCase(): Case
def entrypointCtor(): Ctor
def entrypointEnumerator(): Enumerator
def entrypointExpr(): Term
def entrypointImportee(): Importee
def entrypointImporter(): Importer
def entrypointInit(): Init
def entrypointModifier(): Mod
def entrypointPattern(): Pat
def entrypointSelf(): Self
def entrypointSource(): Source
def entrypointStat(): Stat
def entrypointTemplate(): Template
def entrypointTermParam(): Param
def entrypointType(): Type
def entrypointTypeParam(): Param
def enumCaseDef(mods: List[Mod]): Stat
def enumRepeatedCaseDef(mods: List[Mod]): RepeatedEnumCase
def enumSingleCaseDef(mods: List[Mod]): EnumCase
def enumerators(): List[Enumerator]
def exportStmt(): Stat
def expr(): Term
def expr(location: Location, allowRepeated: Boolean): Term
def exprSimpleType(): Type
def exprTypeArgs(): ArgClause
def extensionGroupDecl(mods: List[Mod]): ExtensionGroup
def funDefOrDclOrExtensionOrSecondaryCtor(mods: List[Mod]): Stat
def funDefRest(mods: List[Mod]): Stat
def getAfterOptNewLine[A](body: => Option[A]): Option[A]
def ifClause(mods: List[Mod]): If
def importStmt(): Import
def importWildcardOrName(): Importee
def importee(): Importee
def importeeRename(from: Name): Importee
def importees(): List[Importee]
def importer(): Importer
final def inBraces[T](body: => T): T
final def inBracesOr[T](body: => T)(ifEmpty: => T): T
final def inBracesOrNil[T](body: => List[T]): List[T]
final def inBrackets[T](body: => T): T
final def inParens[T](body: => T): T
final def inParensOr[T](body: => T)(ifEmpty: => T): T
final def indented[T](body: => T): T
def init(): Init
def initInsideConstructor(): Init
def initInsideTemplate(): Init
def initRest(typeParser: => Type, allowArgss: Boolean, insidePrimaryCtorAnnot: Boolean, allowBraces: Boolean, allowTypeSingleton: Boolean): Init
def initRestAt(startPos: StartPos, tpe: Type)(allowArgss: Boolean, insidePrimaryCtorAnnot: Boolean, allowBraces: Boolean, allowSingleton: Boolean): Init
def inlineMatchClause(inlineMods: List[Mod]): Match

Deals with Scala 3 concept of

Deals with Scala 3 concept of

inline x match { ...

. Since matches can also be chained in Scala 3 we need to create the Match first and only then add the the inline modifier.

Attributes

def interpolatePat(): Interpolate
def interpolateTerm(): Interpolate
def isAfterOpt[A : ClassTag, B : ClassTag]: Boolean
def isAfterOptNewLine[T : ClassTag]: Boolean
def isAtEndMarker(): Boolean
def isImplicitStatSep(): Boolean
def isIndentingOrEOL(nonOptBracesOK: Boolean): Boolean
def isStar: Boolean
def isStar(tok: Token): Boolean
def literal(): Lit
def localDef(implicitMod: Option[Implicit]): Stat
def memberParamClauseGroup(isFirst: Boolean, ownerIsType: Boolean, ownerIsCase: Boolean, allowUnderscore: Boolean): Option[ParamClauseGroup]
def memberParamClauseGroups(ownerIsType: Boolean): List[ParamClauseGroup]
def mixinQualifier(): Name
def modifiersBuf(buf: ListBuffer[Mod], isLocal: Boolean, isParams: Boolean): Unit
def newLineOpt(): Unit
def newLineOptWhenFollowedBy(pred: Token => Boolean): Boolean
def newLineOptWhenFollowedBy[T : ClassTag]: Boolean
def newLinesOpt(): Unit
def next(): Unit
def nextIfPair[A : ClassTag, B : ClassTag]: Boolean
def nextIfPair[A : ClassTag](pred: Token => Boolean): Boolean
def nextTwice(): Unit
def nonLocalDefOrDcl(enumCaseAllowed: Boolean, secondaryConstructorAllowed: Boolean): Stat
def objectDef(mods: List[Mod]): Object
def paramType(): Type
def parseAmmonite(): MultiSource
def parseCase(): Case
def parseCtor(): Ctor
def parseEnumerator(): Enumerator
def parseImportee(): Importee
def parseImporter(): Importer
def parseInit(): Init
def parseMod(): Mod
def parsePat(): Pat
def parseRule[T <: Tree](rule: ScalametaParser => T): T
def parseRule[T <: Tree](rule: => T): T
def parseSelf(): Self
def parseSource(): Source
def parseStat(): Stat
def parseTemplate(): Template
def parseTerm(): Term
def parseTermParam(): Param
def parseType(): Type
def parseTypeParam(): Param
def parseUnquotePat(): Pat
def parseUnquoteTerm(): Term
def patDefOrDcl(mods: List[Mod]): Stat
def path(thisOK: Boolean): Ref
def pattern(): Pat

Default entry points into some pattern contexts.

Default entry points into some pattern contexts.

Attributes

def patternTyp(): Type
def patternTypeArgs(): ArgClause
def peekIndex: Int
def peekToken: Token
def polyFunction(): PolyFunction
def postfixExpr(allowRepeated: Boolean): Term
def prefixExpr(allowRepeated: Boolean): Term
def prevIndex: Int
def prevToken: Token
def primaryCtor(owner: TemplateOwner): Primary
def qualId(): Ref
def quasiquoteCase(): Case
def quasiquoteCtor(): Ctor
def quasiquoteEnumerator(): Enumerator
def quasiquoteExpr(): Term
def quasiquoteImportee(): Importee
def quasiquoteImporter(): Importer
def quasiquoteInit(): Init
def quasiquoteModifier(): Mod
def quasiquotePattern(): Pat
def quasiquoteSelf(): Self
def quasiquoteSource(): Source
def quasiquoteStat(): Stat
def quasiquoteTemplate(): Template
def quasiquoteTermParam(): Param
def quasiquoteType(): Type
def quasiquoteTypeParam(): Param
def secondaryCtor(mods: List[Mod]): Secondary
def secondaryCtorRest(mods: List[Mod], name: This, paramss: Seq[ParamClause]): Secondary
def selector(t: Term, startPos: Int): Select
def seqPatterns(): List[Pat]
def simpleExpr(allowRepeated: Boolean): Term
def skipAllStatSep(): Boolean
def source(): Source
def stableId(): Ref
def startInfixType(inGivenSig: Boolean): Type
def startModType(): Type
def stat(body: => Stat): Stat
def statSeq[T <: Tree](statpf: PartialFunction[Token, T], errorMsg: String): List[T]
def statSeqBuf[T <: Tree](stats: ListBuffer[T], statpf: PartialFunction[Token, T], errorMsg: String): Boolean
def template(owner: TemplateOwner, afterExtend: Boolean): Template
def templateBodyOpt(owner: TemplateOwner): Body
def templateOpt(owner: TemplateOwner): Template
def templateParents(afterExtend: Boolean): List[Init]
def templateParentsWithFirst(allowComma: Boolean, allowWithBody: Boolean)(first: Init): List[Init]
def templateStat(enumCaseAllowed: Boolean, secondaryConstructorAllowed: Boolean): PartialFunction[Token, Stat]
def termName(): Name
def termParam(ownerIsCase: Boolean, ownerIsType: Boolean, mod: Option[ParamsType], allowAnonName: Boolean)(paramIdx: Int): Param
def termParamClauses(ownerIsType: Boolean, ownerIsCase: Boolean): List[ParamClause]
def toCasesBlock(cases: List[Case]): CasesBlock
final def tokenSeparated[Sep : ClassTag, T <: Tree : ClassTag](sepFirst: Boolean, part: Int => T): List[T]
def topLevelTmplDef: Stat

Hook for IDE, for top-level classes/objects.

Hook for IDE, for top-level classes/objects.

Attributes

def typ(): Type

These are default entry points into the pattern context sensitive methods: they are all initiated from non-pattern context.

These are default entry points into the pattern context sensitive methods: they are all initiated from non-pattern context.

Attributes

def typeBounds(): Bounds
def typeDefOrDcl(mods: List[Mod]): TypeDef
def typeIndentedOpt(): Type
def typeName(): Name
def typeParam(ownerIsType: Boolean, allowUnderscore: Boolean): Param
def typedOpt(): Option[Type]
def unquote[T <: Tree : AstInfo]: T & Quasi
def unquoteExpr(): Term
def unquoteOpt[T <: Tree : AstInfo]: Option[T & Quasi]
def unquoteOpt[T <: Tree : AstInfo](pred: => Boolean): Option[T & Quasi]
def unquotePattern(): Pat
def unquoteSeqPattern(): Pat
def xmlLiteralPattern(): Pat
def xmlPat(): Xml
def xmlTerm(): Xml

Concrete fields

final lazy val reporter: Reporter
val topStat: PartialFunction[Token, Stat]

Implicits

Implicits

final implicit def XtensionToken(tok: Token): XtensionToken
implicit def intToIndexPos(index: Int): Pos
implicit def modsToPos(mods: List[Mod]): Pos
implicit def optionTreeToPos(tree: Option[Tree]): Pos
implicit def treeToTreePos(tree: Tree): Pos