Methods which implicitly propagate the context in which they were called: either in a pattern context or not.
Methods which implicitly propagate whether the initial call took place in a context where sequences are allowed.
Modes for infix types.
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.
semi = nl {nl} | `;`
nl = `\n' // where allowed
AccessModifier ::= (private | protected) [AccessQualifier]
AccessQualifier ::= `[' (Id | this) `]'
Annotations ::= {`@' SimpleType {ArgumentExprs}} ConsrAnnotations ::= {`@' SimpleType ArgumentExprs}
ArgumentExprs ::= `(' [Exprs] `)' | [nl] BlockExpr
Block ::= BlockStatSeq
Return tree does not carry position.
BlockExpr ::= `{' (CaseClauses | Block) `}'
BlockStatSeq ::= { BlockStat semi } [ResultExpr] BlockStat ::= Import | Annotations [implicit] [lazy] Def | Annotations LocalModifiers TmplDef | Expr1 |
CaseClauses ::= CaseClause {CaseClause} CaseClause ::= case Pattern [Guard] `=>' Block
Check that tree is a legal clause of a forSome.
Check that tree is a legal clause of a forSome.
Check that type parameter is not by name or repeated.
Check that type parameter is not by name or repeated.
ClassDef ::= Id [TypeParamClause] {Annotation} [AccessModifier] ClassParamClauses RequiresTypeOpt ClassTemplateOpt TraitDef ::= Id [TypeParamClause] RequiresTypeOpt TraitTemplateOpt
CompilationUnit ::= {package QualId semi} TopStatSeq
ConstrBlock ::= `{' SelfInvocation {semi BlockStat} `}'
ConstrExpr ::= SelfInvocation | ConstrBlock
Convert tree to formal parameter.
Convert tree to formal parameter.
Convert tree to formal parameter list.
Convert tree to formal parameter list.
Convert (qual)ident to type identifier.
Convert (qual)ident to type identifier.
Def ::= val PatDef | var PatDef | def FunDef | type [nl] TypeDef | TmplDef Dcl ::= val PatDcl | var PatDcl | def FunDcl | type [nl] TypeDcl
Enumerators ::= Generator {semi Enumerator} Enumerator ::= Generator | Guard | val Pattern1 `=' Expr
EqualsExpr ::= `=' Expr
Expr ::= (Bindings | [`implicit'] Id | `_') `=>' Expr | Expr1 ResultExpr ::= (Bindings | Id `:' CompoundType) `=>' Block | Expr1 Expr1 ::= if `(' Expr `)' {nl} Expr [[semi] else Expr] | try (`{' Block `}' | Expr) [catch `{' CaseClauses `}'] [finally Expr] | while `(' Expr `)' {nl} Expr | do Expr [semi] while `(' Expr `)' | for (`(' Enumerators `)' | `{' Enumerators `}') {nl} [yield] Expr | throw Expr | return [Expr] | [SimpleExpr `.'] Id `=' Expr | SimpleExpr1 ArgumentExprs `=' Expr | PostfixExpr Ascription | PostfixExpr match `{' CaseClauses `}' Bindings ::= `(' [Binding {`,' Binding}] `)' Binding ::= (Id | `_') [`:' Type] Ascription ::= `:' CompoundType | `:' Annotation {Annotation} | `:' `_' `*'
FunDef ::= FunSig [`:' Type] `=' [`macro'] Expr
| FunSig [nl] `{' Block `}'
| `this' ParamClause ParamClauses
(`=' ConstrExpr | [nl] ConstrBlock)
FunDcl ::= FunSig [`:' Type]
FunSig ::= id [FunTypeParamClause] ParamClauses
Generator ::= Pattern1 (`<-' | `=') Expr [Guard]
Guard ::= if PostfixExpr
Assumed (provisionally) to be TermNames.
Assumed (provisionally) to be TermNames.
For when it's known already to be a type name.
For when it's known already to be a type name.
Expr ::= implicit Id => Expr
Import ::= import ImportExpr {`,' ImportExpr}
ImportExpr ::= StableId `.' (Id | `_' | ImportSelectors)
ImportSelector ::= Id [`=>' Id | `=>' `_']
ImportSelectors ::= `{' {ImportSelector `,'} (ImportSelector | `_') `}'
Methods inParensOrError and similar take a second argument which, should the next token not be the expected opener (e.
Methods inParensOrError and similar take a second argument which, should the next token not be the expected opener (e.g. LPAREN) will be returned instead of the contents of the groupers. However in all cases accept(LPAREN) will be called, so a parse error will still result. If the grouping is optional, in.token should be tested before calling these methods.
Join the comment associated with a definition.
Join the comment associated with a definition.
SimpleExpr ::= literal
| symbol
| null
The returned tree does not yet have a position
overridable IDE hook for local definitions of blockStatSeq Here's an idea how to fill in start and end positions.
overridable IDE hook for local definitions of blockStatSeq Here's an idea how to fill in start and end positions. def localDef : List[Tree] = { atEndPos { atStartPos(in.offset) { val annots = annotations(skipNewLines = true) val mods = localModifiers() withAnnotations annots if (!(mods hasFlag ~(Flags.IMPLICIT | Flags.LAZY))) defOrDcl(mods) else List(tmplDef(mods)) } } (in.offset) }
LocalModifiers ::= {LocalModifier} LocalModifier ::= abstract | final | sealed | implicit | lazy
Create a tree representing a package object, converting
Create a tree representing a package object, converting
package object foo { ... }
to
package foo { object `package` { ... } }
Create a tree representing a packaging.
Create a tree representing a packaging.
Creates an actual Parens node (only used during parsing.
Creates an actual Parens node (only used during parsing.)
MixinQualifier ::= `[' Id `]'
Modifiers ::= {Modifier}
Modifier ::= LocalModifier
| AccessModifier
| override
A succession of argument lists.
A succession of argument lists.
The implementation for parsing inside of patterns at points where sequences are disallowed.
ObjectDef ::= Id ClassTemplateOpt
The implementation of the context sensitive methods for parsing outside of patterns.
Packaging ::= package QualId [nl] `{' TopStatSeq `}'
ParamClauses ::= {ParamClause} [[nl] `(' implicit Params `)'] ParamClause ::= [nl] `(' [Params] `)' Params ::= Param {`,' Param} Param ::= {Annotation} Id [`:' ParamType] [`=' Expr] ClassParamClauses ::= {ClassParamClause} [[nl] `(' implicit ClassParams `)'] ClassParamClause ::= [nl] `(' [ClassParams] `)' ClassParams ::= ClassParam {`,' ClassParam} ClassParam ::= {Annotation} [{Modifier} (`val' | `var')] Id [`:' ParamType] [`=' Expr]
ParamType ::= Type | `=>' Type | Type `*'
This is the general parse entry point.
This is the general parse entry point.
The parse starting point depends on whether the source file is self-contained: if not, the AST will be supplemented.
The parse starting point depends on whether the source file is self-contained: if not, the AST will be supplemented.
PatDef ::= Pattern2 {`,' Pattern2} [`:' Type] `=' Expr
ValDcl ::= Id {`,' Id} `:' Type
VarDef ::= PatDef | Id {`,' Id} `:' Type `=' `_'
Path ::= StableId | [Ident `.'] this AnnotType ::= Path [`.' type]
Default entry points into some pattern contexts.
Default entry points into some pattern contexts.
The implicit parameters introduced by _
in the current expression.
The implicit parameters introduced by _
in the current expression.
Parameters appear in reverse order.
The placeholderTypes introduced by _
in the current type.
The placeholderTypes introduced by _
in the current type.
Parameters appear in reverse order.
PostfixExpr ::= InfixExpr [Id [nl]] InfixExpr ::= PrefixExpr | InfixExpr Id [nl] InfixExpr
PrefixExpr ::= [`-' | `+' | `~' | `!' | `&'] SimpleExpr
QualId ::= Id {`.' Id}
RefineStatSeq ::= RefineStat {semi RefineStat}
RefineStat ::= Dcl
| type TypeDef
|
Refinement ::= [nl] `{' RefineStat {semi RefineStat} `}'
This is the parse entry point for code which is not self-contained, e.
This is the parse entry point for code which is not self-contained, e.g. a script which is a series of template statements. They will be swaddled in Trees until the AST is equivalent to the one returned by compilationUnit().
SelfInvocation ::= this ArgumentExprs {ArgumentExprs}
The implementation for parsing inside of patterns at points where sequences are allowed.
SimpleExpr ::= new (ClassTemplate | TemplateBody)
| BlockExpr
| SimpleExpr1 [`_']
SimpleExpr1 ::= literal
| xLiteral
| Path
| `(' [Exprs] `)'
| SimpleExpr `.' Id
| SimpleExpr TypeArgs
| SimpleExpr1 ArgumentExprs
StableId ::= Id | Path `.' Id | [id `.'] super [`[' id `]']`.' id
ClassTemplate ::= [EarlyDefs with] ClassParents [TemplateBody] TraitTemplate ::= [EarlyDefs with] TraitParents [TemplateBody] EarlyDefs ::= `{' [EarlyDef {semi EarlyDef}] `}' EarlyDef ::= Annotations Modifiers PatDef
TemplateBody ::= [nl] `{' TemplateStatSeq `}'
specifies whether in early initializer (true) or not (false)
ClassTemplateOpt ::= `extends' ClassTemplate | [[`extends'] TemplateBody] TraitTemplateOpt ::= TraitExtends TraitTemplate | [[`extends'] TemplateBody] | `<:' TemplateBody TraitExtends ::= `extends' | `<:'
ClassParents ::= AnnotType {`(' [Exprs] `)'} {with AnnotType} TraitParents ::= AnnotType {with AnnotType}
TemplateStatSeq ::= [id [`:' Type] `=>'] TemplateStat {semi TemplateStat} TemplateStat ::= Import | Annotations Modifiers Def | Annotations Modifiers Dcl | Expr1 | super ArgumentExprs {ArgumentExprs} |
specifies whether in early initializer (true) or not (false)
Informal - for the repl and other direct parser accessors.
Informal - for the repl and other direct parser accessors.
TmplDef ::= [case] class ClassDef | [case] object ObjectDef | [override] trait TraitDef
,or if sepFirst is true,
part { `sep` part }
,or if sepFirst is true,
{ `sep` part }
.
{ sep
part }
}}}
part { sep
part }
}}}
Hook for IDE, for top-level classes/objects.
Hook for IDE, for top-level classes/objects.
TopStatSeq ::= TopStat {semi TopStat} TopStat ::= Annotations Modifiers TmplDef | Packaging | package object objectDef | Import |
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.
TypeBounds ::= [`>:' Type] [`<:' Type]
TypeDef ::= type Id [TypeParamClause] `=' Type | FunSig `=' Expr TypeDcl ::= type Id [TypeParamClause] TypeBounds
TypeParamClauseOpt ::= [TypeParamClause] TypeParamClause ::= `[' VariantTypeParam {`,' VariantTypeParam} `]'] VariantTypeParam ::= {Annotation} [`+' | `-'] TypeParam FunTypeParamClauseOpt ::= [FunTypeParamClause] FunTypeParamClause ::= `[' TypeParam {`,' TypeParam} `]'] TypeParam ::= Id TypeParamClauseOpt TypeBounds {<% Type} {":" Type}
TypedOpt ::= [`:' Type]
WildcardType ::= `_' TypeBounds
For use from xml pattern, where sequence is allowed and encouraged.
the markup parser
the markup parser
(outlineParser: StringAdd).self
(outlineParser: StringFormat).self
(outlineParser: ArrowAssoc[OutlineParser]).x
(Since version 2.10.0) Use leftOfArrow
instead
(outlineParser: Ensuring[OutlineParser]).x
(Since version 2.10.0) Use resultOfEnsuring
instead