ScriptParser
Attributes
- Graph
- Supertypes
Members list
Type members
Inherited classlikes
Attributes
- Inherited from:
- Parser
- Graph
- Supertypes
Inherited types
Attributes
- Inherited from:
- Parser
Value members
Concrete methods
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().
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().
Attributes
- Definition Classes
Inherited methods
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
- Returns:
The offset at the start of the token to accept
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
semi = nl {nl} | ;' nl =
\n' // where allowed
AccessQualifier ::= "[" (id | this) "]"
Always add the syntactic mod
, but check and conditionally add semantic mod.flags
Always add the syntactic mod
, but check and conditionally add semantic mod.flags
Attributes
- Inherited from:
- Parser
Adjust start of annotation or constructor to offset of preceding @ or new
Adjust start of annotation or constructor to offset of preceding @ or new
Attributes
- Inherited from:
- Parser
Annotation ::= `@' SimpleType1 {ParArgumentExprs}
AnnotType ::= SimpleType {Annotation}
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
ArgTypes ::= Type {,' Type} | NamedTypeArg {
,' NamedTypeArg}
NamedTypeArg ::= id `=' Type
ArgTypes ::= Type {,' Type} | NamedTypeArg {
,' NamedTypeArg}
NamedTypeArg ::= id `=' Type
Attributes
- Inherited from:
- Parser
ArgumentExprs ::= ParArgumentExprs | [nl] BlockExpr
ArgumentExprss ::= {ArgumentExprs}
ArgumentPatterns ::= ‘(’ [Patterns] ‘)’ | ‘(’ [Patterns ‘,’] PatVar ‘*’ ‘)’
ArgumentPatterns ::= ‘(’ [Patterns] ‘)’ | ‘(’ [Patterns ‘,’] PatVar ‘*’ ‘)’
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- ParserCommon
If the last read offset is strictly greater than start
, assign tree
the span from start
to last read offset, with given point.
If the last offset is less than or equal to start, the tree t
did not
consume any source for its construction. In this case, don't assign a span yet,
but wait for its span to be determined by setChildSpans
when the
parent node is positioned.
If the last read offset is strictly greater than start
, assign tree
the span from start
to last read offset, with given point.
If the last offset is less than or equal to start, the tree t
did not
consume any source for its construction. In this case, don't assign a span yet,
but wait for its span to be determined by setChildSpans
when the
parent node is positioned.
Attributes
- Inherited from:
- ParserCommon
Attributes
- Inherited from:
- ParserCommon
Positions tree.
If t
does not have a span yet, set its span to the given one.
Positions tree.
If t
does not have a span yet, set its span to the given one.
Attributes
- Inherited from:
- ParserCommon
Binding ::= (id | _') [
:' Type]
Attributes
- Inherited from:
- Parser
Block ::= BlockStatSeq
Block ::= BlockStatSeq
Attributes
- Note:
Return tree does not have a defined span.
- Inherited from:
- Parser
BlockExpr ::= <<< (CaseClauses | Block) >>>
BlockStatSeq ::= { BlockStat semi } [Expr] BlockStat ::= Import | Annotations [implicit] [lazy] Def | Annotations LocalModifiers TmplDef | Extension | Expr1 |
BlockStatSeq ::= { BlockStat semi } [Expr] BlockStat ::= Import | Annotations [implicit] [lazy] Def | Annotations LocalModifiers TmplDef | Extension | Expr1 |
Attributes
- Inherited from:
- Parser
Parse brace-enclosed body
and rewrite it to be an indentation region instead, if possible.
If possible means:
Parse brace-enclosed body
and rewrite it to be an indentation region instead, if possible.
If possible means:
- not inside (...), [...], case ... =>
- opening brace
{
is at end of line - closing brace
}
is at start of line - there is at least one token between the braces
- the closing brace is also at the end of the line, or it is followed by one of
then
,else
,do
,catch
,finally
,yield
, ormatch
. - the opening brace does not follow a
=>
. The reason for this condition is that rewriting back to braces does not work after=>
(since in most cases braces are omitted after a=>
it would be annoying if braces were inserted).
Attributes
- Inherited from:
- Parser
CaptureRef ::= ident | this
CaptureSet ::= {
CaptureRef {,
CaptureRef} }
-- under captureChecking
CaptureSet ::= {
CaptureRef {,
CaptureRef} }
-- under captureChecking
Attributes
- Inherited from:
- Parser
CaseClause ::= ‘case’ Pattern [Guard] `=>' Block ExprCaseClause ::= ‘case’ Pattern [Guard] ‘=>’ Expr
CaseClause ::= ‘case’ Pattern [Guard] `=>' Block ExprCaseClause ::= ‘case’ Pattern [Guard] ‘=>’ Expr
Attributes
- Inherited from:
- Parser
CaseClauses ::= CaseClause {CaseClause} TypeCaseClauses ::= TypeCaseClause {TypeCaseClause}
CaseClauses ::= CaseClause {CaseClause} TypeCaseClauses ::= TypeCaseClause {TypeCaseClause}
Attributes
- Inherited from:
- Parser
[`extends' ConstrApps]
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Check that this is not the start of a statement that's indented relative to the current region.
Check that this is not the start of a statement that's indented relative to the current region.
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
ClassConstr ::= [ClsTypeParamClause] [ConstrMods] ClsParamClauses
ClassDef ::= id ClassConstr TemplateOpt
Attributes
- Inherited from:
- Parser
The region to eliminate when replacing a closing )
or }
that starts a new line
The )
or }
precedes in.lastOffset.
The region to eliminate when replacing a closing )
or }
that starts a new line
The )
or }
precedes in.lastOffset.
Attributes
- Inherited from:
- Parser
Expr ::= [‘implicit’] FunParams =>' Expr BlockResult ::= implicit id [
:' InfixType] `=>' Block // Scala2 only
Expr ::= [‘implicit’] FunParams =>' Expr BlockResult ::= implicit id [
:' InfixType] `=>' Block // Scala2 only
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
,
{,
CompilationUnit ::= {package QualId semi} TopStatSeq
ConstrApps ::= ConstrApp ({‘,’ ConstrApp} | {‘with’ ConstrApp})
ConstrMods ::= {Annotation} [AccessModifier]
Attributes
- Inherited from:
- Parser
ContextTypes ::= FunArgType {‘,’ FunArgType}
Convert tree to formal parameter
Convert tree to formal parameter list
Convert (qual)ident to type identifier
Attributes
- Inherited from:
- Parser
DefDef ::= DefSig [‘:’ Type] ‘=’ Expr
| this ParamClause ParamClauses =' ConstrExpr DefDcl ::= DefSig
:' Type
DefSig ::= id [DefTypeParamClause] DefParamClauses
| ExtParamClause [nl] [‘.’] id DefParamClauses
DefDef ::= DefSig [‘:’ Type] ‘=’ Expr
| this ParamClause ParamClauses =' ConstrExpr DefDcl ::= DefSig
:' Type
DefSig ::= id [DefTypeParamClause] DefParamClauses
| ExtParamClause [nl] [‘.’] id DefParamClauses
Attributes
- Inherited from:
- Parser
Def ::= val PatDef
| var VarDef
| def DefDef
| type {nl} TypeDcl
| TmplDef
Dcl ::= val ValDcl
| var ValDcl
| def DefDcl
| type {nl} TypeDcl
EnumCase ::= case' (id ClassConstr [
extends' ConstrApps]] | ids)
Def ::= val PatDef
| var VarDef
| def DefDef
| type {nl} TypeDcl
| TmplDef
Dcl ::= val ValDcl
| var ValDcl
| def DefDcl
| type {nl} TypeDcl
EnumCase ::= case' (id ClassConstr [
extends' ConstrApps]] | ids)
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
DotSelectors ::= { `.' id }
Drop (...) or { ... }, replacing the closing element with endStr
Drop current token, if it is a then
or do
.
Attributes
- Inherited from:
- ParserCommon
EnumCase = case' (id ClassConstr [
extends' ConstrApps] | ids)
EnumDef ::= id ClassConstr InheritClauses EnumBody
Enumerator ::= Generator | Guard {Guard} | Pattern1 `=' Expr
Enumerators ::= Generator {semi Enumerator | Guard}
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
in.offset, except if this is at a new line, in which case lastOffset
is preferred.
in.offset, except if this is at a new line, in which case lastOffset
is preferred.
Attributes
- Inherited from:
- ParserCommon
Attributes
- Inherited from:
- Parser
ExprsInParens ::= ExprInParens {,' ExprInParens} Bindings ::= Binding {
,' Binding}
ExprsInParens ::= ExprInParens {,' ExprInParens} Bindings ::= Binding {
,' Binding}
Attributes
- Inherited from:
- Parser
ExtMethod ::= {Annotation [nl]} {Modifier} ‘def’ DefDef | Export
ExtMethods ::= ExtMethod | [nl] ‘{’ ExtMethod {semi ExtMethod ‘}’
Extension ::= ‘extension’ [DefTypeParamClause] {UsingParamClause} ‘(’ DefParam ‘)’ {UsingParamClause} ExtMethods
Extension ::= ‘extension’ [DefTypeParamClause] {UsingParamClause} ‘(’ DefParam ‘)’ {UsingParamClause} ExtMethods
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
The position of the first XML literal encountered while parsing, NoSourcePosition if there were no XML literals.
The position of the first XML literal encountered while parsing, NoSourcePosition if there were no XML literals.
Attributes
- Inherited from:
- Parser
In the tokens following the current one, does query
precede any of the tokens that
In the tokens following the current one, does query
precede any of the tokens that
- must start a statement, or
- separate two statements, or
- continue a statement (e.g.
else
, catch`), or - terminate the current scope?
Attributes
- Inherited from:
- Parser
Under captureChecking language import: is the following token sequence a
capture set {ref1, ..., refN}
followed by a token that can start a type?
Under captureChecking language import: is the following token sequence a
capture set {ref1, ..., refN}
followed by a token that can start a type?
Attributes
- Inherited from:
- Parser
Is the following sequence the generators of a for-expression enclosed in (...)?
Is the following sequence the generators of a for-expression enclosed in (...)?
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Are the next token the "GivenSig" part of a given definition,
i.e. an identifier followed by type and value parameters, followed by :
?
Are the next token the "GivenSig" part of a given definition,
i.e. an identifier followed by type and value parameters, followed by :
?
Attributes
- Inherited from:
- Parser
Is the token sequence following the current :
token classified as a lambda?
This is the case if the input starts with an identifier, a wildcard, or
something enclosed in (...) or [...], and this is followed by a =>
or ?=>
and an INDENT.
Is the token sequence following the current :
token classified as a lambda?
This is the case if the input starts with an identifier, a wildcard, or
something enclosed in (...) or [...], and this is followed by a =>
or ?=>
and an INDENT.
Attributes
- Inherited from:
- Parser
When encountering a :
, is that in the binding of a lambda?
Attributes
- Inherited from:
- Parser
Is current ident a *
, and is it followed by a )
, , )
, ,EOF
? The latter two are not
syntactically valid, but we need to include them here for error recovery.
Is current ident a *
, and is it followed by a )
, , )
, ,EOF
? The latter two are not
syntactically valid, but we need to include them here for error recovery.
Attributes
- Inherited from:
- Parser
ForExpr ::= ‘for’ ‘(’ Enumerators ‘)’ {nl} [‘do‘ | ‘yield’] Expr | ‘for’ ‘{’ Enumerators ‘}’ {nl} [‘do‘ | ‘yield’] Expr | ‘for’ Enumerators (‘do‘ | ‘yield’) Expr
ForExpr ::= ‘for’ ‘(’ Enumerators ‘)’ {nl} [‘do‘ | ‘yield’] Expr | ‘for’ ‘{’ Enumerators ‘}’ {nl} [‘do‘ | ‘yield’] Expr | ‘for’ Enumerators (‘do‘ | ‘yield’) Expr
Attributes
- Inherited from:
- Parser
FunParamClause ::= ‘(’ TypedFunParam {‘,’ TypedFunParam } ‘)’
Attributes
- Inherited from:
- Parser
FunParams ::= Bindings
| id
| _' Bindings ::=
(' [[‘erased’] Binding {,' Binding}]
)'
FunParams ::= Bindings
| id
| _' Bindings ::=
(' [[‘erased’] Binding {,' Binding}]
)'
Attributes
- Inherited from:
- Parser
Generator ::= [‘case’] Pattern `<-' Expr
Attributes
- Inherited from:
- Parser
GivenDef ::= [GivenSig] (AnnotType [‘=’ Expr] | StructuralInstance) GivenSig ::= [id] [DefTypeParamClause] {UsingParamClauses} ‘:’
GivenDef ::= [GivenSig] (AnnotType [‘=’ Expr] | StructuralInstance) GivenSig ::= [id] [DefTypeParamClause] {UsingParamClauses} ‘:’
Attributes
- Inherited from:
- Parser
Accept identifier and return its name as a term name.
if'
(' Expr )' {nl} Expr [[semi] else Expr]
if' Expr `then' Expr [[semi] else Expr]
if'
(' Expr )' {nl} Expr [[semi] else Expr]
if' Expr `then' Expr [[semi] else Expr]
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
ImportExpr ::= SimpleRef {‘.’ id} ‘.’ ImportSpec | SimpleRef ‘as’ id ImportSpec ::= NamedSelector | WildcardSelector | ‘{’ ImportSelectors ‘}’ ImportSelectors ::= NamedSelector [‘,’ ImportSelectors] | WildCardSelector {‘,’ WildCardSelector} NamedSelector ::= id [‘as’ (id | ‘_’)] WildCardSelector ::= ‘*' | ‘given’ [InfixType]
ImportExpr ::= SimpleRef {‘.’ id} ‘.’ ImportSpec | SimpleRef ‘as’ id ImportSpec ::= NamedSelector | WildcardSelector | ‘{’ ImportSelectors ‘}’ ImportSelectors ::= NamedSelector [‘,’ ImportSelectors] | WildCardSelector {‘,’ WildCardSelector} NamedSelector ::= id [‘as’ (id | ‘_’)] WildCardSelector ::= ‘*' | ‘given’ [InfixType]
Attributes
- Inherited from:
- Parser
Import ::= import' ImportExpr {‘,’ ImportExpr} Export ::=
export' ImportExpr {‘,’ ImportExpr}
Import ::= import' ImportExpr {‘,’ ImportExpr} Export ::=
export' ImportExpr {‘,’ ImportExpr}
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Issue an error at current offset that input is incomplete
Parse indentation region body
and rewrite it to be in braces instead
Parse indentation region body
and rewrite it to be in braces instead
Attributes
- Inherited from:
- Parser
operand { infixop operand | MatchClause } [postfixop],
operand { infixop operand | MatchClause } [postfixop],
respecting rules of associativity and precedence.
Attributes
- isOperator
the current token counts as an operator.
- maybePostfix
postfix operators are allowed.
- Inherited from:
- Parser
InfixPattern ::= SimplePattern {id [nl] SimplePattern}
InfixType ::= RefinedType {id [nl] RefinedType}
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
True if we are seeing a lambda argument after a colon of the form: : (params) => body
True if we are seeing a lambda argument after a colon of the form: : (params) => body
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Is offset1 less or equally indented than offset2? This is the case if the characters between the preceding end-of-line and offset1 are a prefix of the characters between the preceding end-of-line and offset2.
Is offset1 less or equally indented than offset2? This is the case if the characters between the preceding end-of-line and offset1 are a prefix of the characters between the preceding end-of-line and offset2.
Attributes
- Inherited from:
- Parser
Is current token a hard or soft modifier (in modifier position or not)?
Is current token a hard or soft modifier (in modifier position or not)?
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
A '$' identifier is treated as a splice if followed by a {
.
A longer identifier starting with $
is treated as a splice/id combination
in a quoted block '{...'
A '$' identifier is treated as a splice if followed by a {
.
A longer identifier starting with $
is treated as a splice/id combination
in a quoted block '{...'
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Literal ::= SimpleLiteral | processedStringLiteral | symbolLiteral | ‘null’
Literal ::= SimpleLiteral | processedStringLiteral | symbolLiteral | ‘null’
Attributes
- negOffset
The offset of a preceding `-' sign, if any. If the literal is not negated, negOffset == in.offset.
- Inherited from:
- Parser
Create a tree representing a packaging
MatchClause ::= match'
{' CaseClauses `}'
match'
{' TypeCaseClauses `}'
MixinQualifier ::= [' id
]'
Create an import node and handle source version imports
{Annotation} {Modifier} Modifiers ::= {Modifier} LocalModifiers ::= {LocalModifier} AccessModifier ::= (private | protected) [AccessQualifier] Modifier ::= LocalModifier | AccessModifier | override | opaque LocalModifier ::= abstract | final | sealed | open | implicit | lazy | erased | inline | transparent
{Annotation} {Modifier} Modifiers ::= {Modifier} LocalModifiers ::= {LocalModifier} AccessModifier ::= (private | protected) [AccessQualifier] Modifier ::= LocalModifier | AccessModifier | override | opaque LocalModifier ::= abstract | final | sealed | open | implicit | lazy | erased | inline | transparent
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- ParserCommon
SimpleExpr ::= ‘new’ ConstrApp {with
ConstrApp} [TemplateBody]
| ‘new’ TemplateBody
SimpleExpr ::= ‘new’ ConstrApp {with
ConstrApp} [TemplateBody]
| ‘new’ TemplateBody
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
ObjectDef ::= id TemplateOpt
Packaging ::= package QualId [nl] {' TopStatSeq
}'
ParArgumentExprs ::= (' [‘using’] [ExprsInParens]
)'
| (' [ExprsInParens
,'] PostfixExpr `*' ')'
ParArgumentExprs ::= (' [‘using’] [ExprsInParens]
)'
| (' [ExprsInParens
,'] PostfixExpr `*' ')'
Attributes
- Inherited from:
- Parser
ParArgumentExprss ::= {ParArgumentExprs}
ParArgumentExprss ::= {ParArgumentExprs}
Special treatment for arguments to primary constructor annotations.
(...) is considered an argument only if it does not look like a formal
parameter list, i.e. does not start with ( <annot>* <mod>* ident :
Furthermore, ()
is considered a annotation argument only if it comes first.
Attributes
- Inherited from:
- Parser
ClsParamClause ::= ‘(’ [‘erased’] ClsParams ‘)’ | UsingClsParamClause UsingClsParamClause::= ‘(’ ‘using’ [‘erased’] (ClsParams | ContextTypes) ‘)’ ClsParams ::= ClsParam {‘,’ ClsParam} ClsParam ::= {Annotation}
ClsParamClause ::= ‘(’ [‘erased’] ClsParams ‘)’ | UsingClsParamClause UsingClsParamClause::= ‘(’ ‘using’ [‘erased’] (ClsParams | ContextTypes) ‘)’ ClsParams ::= ClsParam {‘,’ ClsParam} ClsParam ::= {Annotation}
DefParamClause ::= ‘(’ [‘erased’] DefParams ‘)’ | UsingParamClause UsingParamClause ::= ‘(’ ‘using’ [‘erased’] (DefParams | ContextTypes) ‘)’ DefParams ::= DefParam {‘,’ DefParam} DefParam ::= {Annotation} [‘inline’] Param
Param ::= id :' ParamType [
=' Expr]
Attributes
- Returns:
the list of parameter definitions
- Inherited from:
- Parser
ClsParamClauses ::= {ClsParamClause} [[nl] ‘(’ [‘implicit’] ClsParams ‘)’] DefParamClauses ::= {DefParamClause} [[nl] ‘(’ [‘implicit’] DefParams ‘)’]
ClsParamClauses ::= {ClsParamClause} [[nl] ‘(’ [‘implicit’] ClsParams ‘)’] DefParamClauses ::= {DefParamClause} [[nl] ‘(’ [‘implicit’] DefParams ‘)’]
Attributes
- Returns:
The parameter definitions
- Inherited from:
- Parser
ParamType ::= ParamValueType
| =>' ParamValueType | [CaptureSet]
->' ParamValueType
ParamType ::= ParamValueType
| =>' ParamValueType | [CaptureSet]
->' ParamValueType
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
ParamValueType ::= Type [`*']
PatDef ::= ids [‘:’ Type] ‘=’ Expr
| Pattern2 [‘:’ Type] ‘=’ Expr
VarDef ::= PatDef
| id {,' id}
:' Type ='
_' (deprecated in 3.x)
ValDcl ::= id {,' id}
:' Type
VarDcl ::= id {,' id}
:' Type
PatDef ::= ids [‘:’ Type] ‘=’ Expr
| Pattern2 [‘:’ Type] ‘=’ Expr
VarDef ::= PatDef
| id {,' id}
:' Type ='
_' (deprecated in 3.x)
ValDcl ::= id {,' id}
:' Type
VarDcl ::= id {,' id}
:' Type
Attributes
- Inherited from:
- Parser
Pattern ::= Pattern1 { `|' Pattern1 }
Pattern1 ::= Pattern2 [Ascription]
Pattern3 ::= InfixPattern | PatVar ‘*’
Attributes
- Inherited from:
- Parser
Patterns ::= Pattern [`,' Pattern]
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- ParserCommon
Attributes
- Inherited from:
- Parser
PostfixExpr ::= InfixExpr [id [nl]]
InfixExpr ::= PrefixExpr
| InfixExpr id [nl] InfixExpr
| InfixExpr id :
IndentedExpr
| InfixExpr MatchClause
PostfixExpr ::= InfixExpr [id [nl]]
InfixExpr ::= PrefixExpr
| InfixExpr id [nl] InfixExpr
| InfixExpr id :
IndentedExpr
| InfixExpr MatchClause
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
RefineStatSeq ::= RefineStat {semi RefineStat}
RefineStat ::= ‘val’ VarDcl
| ‘def’ DefDcl
| ‘type’ {nl} TypeDcl
(in reality we admit Defs and vars and filter them out afterwards in checkLegal
)
RefineStatSeq ::= RefineStat {semi RefineStat}
RefineStat ::= ‘val’ VarDcl
| ‘def’ DefDcl
| ‘type’ {nl} TypeDcl
(in reality we admit Defs and vars and filter them out afterwards in checkLegal
)
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Refinement ::= {' RefineStatSeq
}'
Attributes
- Inherited from:
- Parser
rewrite code with (...) around the source code of t
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Accept identifier or match clause acting as a selector on given tree t
Accept identifier or match clause acting as a selector on given tree t
Attributes
- Inherited from:
- Parser
SelfInvocation ::= this ArgumentExprs {ArgumentExprs}
SelfType ::= id [‘:’ [CaptureSet] InfixType] ‘=>’ | ‘this’ ‘:’ [CaptureSet] InfixType ‘=>’
SelfType ::= id [‘:’ [CaptureSet] InfixType] ‘=>’ | ‘this’ ‘:’ [CaptureSet] InfixType ‘=>’
Attributes
- Inherited from:
- Parser
SimpleExpr ::= ‘new’ ConstrApp {with
ConstrApp} [TemplateBody]
| ‘new’ TemplateBody
| BlockExpr
| ExprSplice
| Quoted
| quoteId
| SimpleExpr1 [_
]
SimpleExpr1 ::= literal
| xmlLiteral
| SimpleRef
| (
[ExprsInParens] )
| SimpleExpr .
id
| SimpleExpr .
MatchClause
| SimpleExpr (TypeArgs | NamedTypeArgs)
| SimpleExpr1 ArgumentExprs
| SimpleExpr1 :
ColonArgument -- under language.experimental.fewerBraces
ColonArgument ::= indent (CaseClauses | Block) outdent
| FunParams (‘=>’ | ‘?=>’) ColonArgBody
| HkTypeParamClause ‘=>’ ColonArgBody
ColonArgBody ::= indent (CaseClauses | Block) outdent
Quoted ::= ‘'’ ‘{’ Block ‘}’
| ‘'’ ‘[’ Type ‘]’
SimpleExpr ::= ‘new’ ConstrApp {with
ConstrApp} [TemplateBody]
| ‘new’ TemplateBody
| BlockExpr
| ExprSplice
| Quoted
| quoteId
| SimpleExpr1 [_
]
SimpleExpr1 ::= literal
| xmlLiteral
| SimpleRef
| (
[ExprsInParens] )
| SimpleExpr .
id
| SimpleExpr .
MatchClause
| SimpleExpr (TypeArgs | NamedTypeArgs)
| SimpleExpr1 ArgumentExprs
| SimpleExpr1 :
ColonArgument -- under language.experimental.fewerBraces
ColonArgument ::= indent (CaseClauses | Block) outdent
| FunParams (‘=>’ | ‘?=>’) ColonArgBody
| HkTypeParamClause ‘=>’ ColonArgBody
ColonArgBody ::= indent (CaseClauses | Block) outdent
Quoted ::= ‘'’ ‘{’ Block ‘}’
| ‘'’ ‘[’ Type ‘]’
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
SimpleLiteral ::= [‘-’] integerLiteral | [‘-’] floatingPointLiteral | booleanLiteral | characterLiteral | stringLiteral
SimpleLiteral ::= [‘-’] integerLiteral | [‘-’] floatingPointLiteral | booleanLiteral | characterLiteral | stringLiteral
Attributes
- Inherited from:
- Parser
SimplePattern ::= PatVar
| Literal
| Quoted
| XmlPattern
| (' [Patterns]
)'
| SimplePattern1 [TypeArgs] [ArgumentPatterns]
SimplePattern1 ::= SimpleRef
| SimplePattern1 .' id PatVar ::= id |
_'
SimplePattern ::= PatVar
| Literal
| Quoted
| XmlPattern
| (' [Patterns]
)'
| SimplePattern1 [TypeArgs] [ArgumentPatterns]
SimplePattern1 ::= SimpleRef
| SimplePattern1 .' id PatVar ::= id |
_'
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
SimpleRef ::= id | [id ‘.’] ‘this’ | [id ‘.’] ‘super’ [ClassQualifier] ‘.’ id
SimpleRef ::= id | [id ‘.’] ‘this’ | [id ‘.’] ‘super’ [ClassQualifier] ‘.’ id
Attributes
- Inherited from:
- Parser
SimpleType ::= SimpleLiteral | ‘?’ SubtypeBounds | SimpleType1 | SimpleType ‘(’ Singletons ‘)’ -- under language.experimental.dependent, checked in Typer Singletons ::= Singleton {‘,’ Singleton}
SimpleType ::= SimpleLiteral | ‘?’ SubtypeBounds | SimpleType1 | SimpleType ‘(’ Singletons ‘)’ -- under language.experimental.dependent, checked in Typer Singletons ::= Singleton {‘,’ Singleton}
Attributes
- Inherited from:
- Parser
SimpleType1 ::= id
| Singleton .' id | Singleton
.' type
| ‘(’ ArgTypes ‘)’
| Refinement
| TypeSplice -- deprecated syntax (since 3.0.0)
| SimpleType1 TypeArgs
| SimpleType1 `#' id
SimpleType1 ::= id
| Singleton .' id | Singleton
.' type
| ‘(’ ArgTypes ‘)’
| Refinement
| TypeSplice -- deprecated syntax (since 3.0.0)
| SimpleType1 TypeArgs
| SimpleType1 `#' id
Attributes
- Inherited from:
- Parser
Singleton ::= SimpleRef | SimpleLiteral | Singleton ‘.’ id -- not yet | Singleton ‘(’ Singletons ‘)’ -- not yet | Singleton ‘[’ Types ‘]’
Singleton ::= SimpleRef | SimpleLiteral | Singleton ‘.’ id -- not yet | Singleton ‘(’ Singletons ‘)’ -- not yet | Singleton ‘[’ Types ‘]’
Attributes
- Inherited from:
- Parser
Skip on error to next safe point.
Attributes
- Inherited from:
- Parser
ExprSplice ::= ‘$’ spliceId -- if inside quoted block | ‘$’ ‘{’ Block ‘}’ -- unless inside quoted pattern | ‘$’ ‘{’ Pattern ‘}’ -- when inside quoted pattern TypeSplice ::= ‘$’ spliceId -- if inside quoted type | ‘$’ ‘{’ Block ‘}’ -- unless inside quoted type pattern | ‘$’ ‘{’ Pattern ‘}’ -- when inside quoted type pattern
ExprSplice ::= ‘$’ spliceId -- if inside quoted block | ‘$’ ‘{’ Block ‘}’ -- unless inside quoted pattern | ‘$’ ‘{’ Pattern ‘}’ -- when inside quoted pattern TypeSplice ::= ‘$’ spliceId -- if inside quoted type | ‘$’ ‘{’ Block ‘}’ -- unless inside quoted type pattern | ‘$’ ‘{’ Pattern ‘}’ -- when inside quoted type pattern
Attributes
- Inherited from:
- Parser
The block in a quote or splice
Attributes
- Inherited from:
- ParserCommon
The region to eliminate when replacing an opening (
or {
that ends a line.
The (
or {
is at in.offset.
The region to eliminate when replacing an opening (
or {
that ends a line.
The (
or {
is at in.offset.
Attributes
- Inherited from:
- Parser
Parse statement separators and end markers. Ensure that there is at least one statement separator unless the next token terminates a statement´sequence.
Parse statement separators and end markers. Ensure that there is at least one statement separator unless the next token terminates a statement´sequence.
Attributes
- altEnd
a token that is also considered as a terminator of the statement sequence (the default
EOF
already assumes to terminate a statement sequence).- noPrevStat
true if there was no immediately preceding statement parsed
- stats
the statements parsed to far
- what
a string indicating what kind of statement is parsed
- Returns:
true if the statement sequence continues, false if it terminates.
- Inherited from:
- Parser
Parse body
while checking (under -no-indent) that a {
is not missing before it.
This is done as follows:
If the next token S is indented relative to the current region,
and the end of body
is followed by a new line and another statement,
check that that other statement is indented less than S
Parse body
while checking (under -no-indent) that a {
is not missing before it.
This is done as follows:
If the next token S is indented relative to the current region,
and the end of body
is followed by a new line and another statement,
check that that other statement is indented less than S
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- ParserCommon
Unconditionally issue an error at given span, without updating lastErrorOffset.
Unconditionally issue an error at given span, without updating lastErrorOffset.
Attributes
- Inherited from:
- ParserCommon
Attributes
- Inherited from:
- ParserCommon
Attributes
- Inherited from:
- ParserCommon
Issue an error at given offset if beyond last error offset and update lastErrorOffset.
Issue an error at given offset if beyond last error offset and update lastErrorOffset.
Attributes
- Inherited from:
- ParserCommon
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
If at end of file, issue an incompleteInputError. Otherwise issue a syntax error and skip to next safe point.
If at end of file, issue an incompleteInputError. Otherwise issue a syntax error and skip to next safe point.
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Template ::= InheritClauses [TemplateBody] InheritClauses ::= [‘extends’ ConstrApps] [‘derives’ QualId {‘,’ QualId}]
Template ::= InheritClauses [TemplateBody] InheritClauses ::= [‘extends’ ConstrApps] [‘derives’ QualId {‘,’ QualId}]
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
TemplateBody ::= [nl] {' TemplateStatSeq
}'
EnumBody ::= [nl] ‘{’ [SelfType] EnumStat {semi EnumStat} ‘}’
TemplateBody ::= [nl] {' TemplateStatSeq
}'
EnumBody ::= [nl] ‘{’ [SelfType] EnumStat {semi EnumStat} ‘}’
Attributes
- Inherited from:
- Parser
TemplateOpt = [Template]
TemplateStatSeq ::= [SelfType] TemplateStat {semi TemplateStat} TemplateStat ::= Import | Export | Annotations Modifiers Def | Annotations Modifiers Dcl | Extension | Expr1 | EnumStat ::= TemplateStat | Annotations Modifiers EnumCase
TemplateStatSeq ::= [SelfType] TemplateStat {semi TemplateStat} TemplateStat ::= Import | Export | Annotations Modifiers Def | Annotations Modifiers Dcl | Extension | Expr1 | EnumStat ::= TemplateStat | Annotations Modifiers EnumCase
Attributes
- Inherited from:
- Parser
Accept identifier and return Ident with its name as a term name.
TmplDef ::= ([‘case’] ‘class’ | ‘trait’) ClassDef | [‘case’] ‘object’ ObjectDef | ‘enum’ EnumDef | ‘given’ GivenDef
TmplDef ::= ([‘case’] ‘class’ | ‘trait’) ClassDef | [‘case’] ‘object’ ObjectDef | ‘enum’ EnumDef | ‘given’ GivenDef
Attributes
- Inherited from:
- Parser
Does the current conditional expression continue after the initially parsed (...) region?
Does the current conditional expression continue after the initially parsed (...) region?
Attributes
- Inherited from:
- Parser
TopStatSeq ::= TopStat {semi TopStat} TopStat ::= Import | Export | Annotations Modifiers Def | Packaging | package object objectDef | Extension |
TopStatSeq ::= TopStat {semi TopStat} TopStat ::= Import | Export | Annotations Modifiers Def | Packaging | package object objectDef | Extension |
Attributes
- Inherited from:
- Parser
Type ::= FunType
| HkTypeParamClause ‘=>>’ Type
| FunParamClause ‘=>>’ Type
| MatchType
| InfixType
| CaptureSet Type -- under captureChecking
FunType ::= (MonoFunType | PolyFunType)
MonoFunType ::= FunTypeArgs (‘=>’ | ‘?=>’) Type
| (‘->’ | ‘?->’ ) Type -- under pureFunctions
PolyFunType ::= HKTypeParamClause '=>' Type
| HKTypeParamClause ‘->’ Type -- under pureFunctions
FunTypeArgs ::= InfixType
| (' [ [ ‘[using]’ ‘['erased'] FunArgType {
,' FunArgType } ] `)'
| '(' [ ‘[using]’ ‘['erased'] TypedFunParam {',' TypedFunParam } ')'
Type ::= FunType
| HkTypeParamClause ‘=>>’ Type
| FunParamClause ‘=>>’ Type
| MatchType
| InfixType
| CaptureSet Type -- under captureChecking
FunType ::= (MonoFunType | PolyFunType)
MonoFunType ::= FunTypeArgs (‘=>’ | ‘?=>’) Type
| (‘->’ | ‘?->’ ) Type -- under pureFunctions
PolyFunType ::= HKTypeParamClause '=>' Type
| HKTypeParamClause ‘->’ Type -- under pureFunctions
FunTypeArgs ::= InfixType
| (' [ [ ‘[using]’ ‘['erased'] FunArgType {
,' FunArgType } ] `)'
| '(' [ ‘[using]’ ‘['erased'] TypedFunParam {',' TypedFunParam } ')'
Attributes
- Inherited from:
- Parser
TypeArgs ::= [' Type {
,' Type} ]' NamedTypeArgs ::=
[' NamedTypeArg {,' NamedTypeArg}
]'
TypeArgs ::= [' Type {
,' Type} ]' NamedTypeArgs ::=
[' NamedTypeArg {,' NamedTypeArg}
]'
Attributes
- Inherited from:
- Parser
TypeBounds ::= [>:' Type] [
<:' Type]
TypeCaseClause ::= ‘case’ (InfixType | ‘_’) ‘=>’ Type [semi]
TypeDcl ::= id [TypeParamClause] {FunParamClause} TypeBounds [‘=’ Type]
TypeDcl ::= id [TypeParamClause] {FunParamClause} TypeBounds [‘=’ Type]
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Accept identifier and return Ident with its name as a type name.
TypeParamBounds ::= TypeBounds {<%' Type} {
:' Type}
ClsTypeParamClause::= ‘[’ ClsTypeParam {‘,’ ClsTypeParam} ‘]’ ClsTypeParam ::= {Annotation} [‘+’ | ‘-’] id [HkTypeParamClause] TypeParamBounds
ClsTypeParamClause::= ‘[’ ClsTypeParam {‘,’ ClsTypeParam} ‘]’ ClsTypeParam ::= {Annotation} [‘+’ | ‘-’] id [HkTypeParamClause] TypeParamBounds
DefTypeParamClause::= ‘[’ DefTypeParam {‘,’ DefTypeParam} ‘]’ DefTypeParam ::= {Annotation} id [HkTypeParamClause] TypeParamBounds
TypTypeParamClause::= ‘[’ TypTypeParam {‘,’ TypTypeParam} ‘]’ TypTypeParam ::= {Annotation} id [HkTypePamClause] TypeBounds
HkTypeParamClause ::= ‘[’ HkTypeParam {‘,’ HkTypeParam} ‘]’ HkTypeParam ::= {Annotation} [‘+’ | ‘-’] (id [HkTypePamClause] | ‘_’) TypeBounds
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
TypedFunParam ::= id ':' Type
Attributes
- Inherited from:
- ParserCommon
If all other characters on the same line as span
are blanks, widen to
the whole line.
If all other characters on the same line as span
are blanks, widen to
the whole line.
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
{
withConstrApp} but no EOL allowed after
with`.
with Template, with EOL
WithType ::= AnnotType {`with' AnnotType} (deprecated)
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Wrap annotation or constructor in New(...).
Attributes
- Inherited from:
- Parser
Attributes
- Inherited from:
- Parser
Inherited fields
Attributes
- Inherited from:
- Parser
ConstrApp ::= SimpleType1 {Annotation} {ParArgumentExprs}
ConstrExpr ::= SelfInvocation
| {' SelfInvocation {semi BlockStat}
}'
ConstrExpr ::= SelfInvocation
| {' SelfInvocation {semi BlockStat}
}'
Attributes
- Inherited from:
- Parser
Expr ::= [implicit'] FunParams (‘=>’ | ‘?=>’) Expr | HkTypeParamClause ‘=>’ Expr | Expr1 FunParams ::= Bindings | id |
'
ExprInParens ::= PostfixExpr :' Type | Expr BlockResult ::= [‘implicit’] FunParams (‘=>’ | ‘?=>’) Block | HkTypeParamClause ‘=>’ Block | Expr1 Expr1 ::= [‘inline’]
if' (' Expr
)' {nl} Expr [[semi] else Expr]
| [‘inline’] if' Expr
then' Expr [[semi] else Expr]
| while'
(' Expr )' {nl} Expr |
while' Expr do' Expr |
try' Expr Catches [finally' Expr] |
try' Expr [finally' Expr] |
throw' Expr
| return' [Expr] | ForExpr | [SimpleExpr
.'] id =' Expr | PrefixOperator SimpleExpr
=' Expr
| SimpleExpr1 ArgumentExprs =' Expr | PostfixExpr [Ascription] | ‘inline’ InfixExpr MatchClause Bindings ::=
(' [Binding {,' Binding}]
)'
Binding ::= (id | _') [
:' Type]
Ascription ::= :' [CaptureSet] InfixType |
:' Annotation {Annotation}
| :'
' `*'
Catches ::= ‘catch’ (Expr | ExprCaseClause)
Expr ::= [implicit'] FunParams (‘=>’ | ‘?=>’) Expr | HkTypeParamClause ‘=>’ Expr | Expr1 FunParams ::= Bindings | id |
'
ExprInParens ::= PostfixExpr :' Type | Expr BlockResult ::= [‘implicit’] FunParams (‘=>’ | ‘?=>’) Block | HkTypeParamClause ‘=>’ Block | Expr1 Expr1 ::= [‘inline’]
if' (' Expr
)' {nl} Expr [[semi] else Expr]
| [‘inline’] if' Expr
then' Expr [[semi] else Expr]
| while'
(' Expr )' {nl} Expr |
while' Expr do' Expr |
try' Expr Catches [finally' Expr] |
try' Expr [finally' Expr] |
throw' Expr
| return' [Expr] | ForExpr | [SimpleExpr
.'] id =' Expr | PrefixOperator SimpleExpr
=' Expr
| SimpleExpr1 ArgumentExprs =' Expr | PostfixExpr [Ascription] | ‘inline’ InfixExpr MatchClause Bindings ::=
(' [Binding {,' Binding}]
)'
Binding ::= (id | _') [
:' Type]
Ascription ::= :' [CaptureSet] InfixType |
:' Annotation {Annotation}
| :'
' `*'
Catches ::= ‘catch’ (Expr | ExprCaseClause)
Attributes
- Inherited from:
- Parser
FunArgType ::= Type
| =>' Type | [CaptureSet]
->' Type
The offset where the last syntax error was reported, or if a skip to a safepoint occurred afterwards, the offset of the safe point.
The offset where the last syntax error was reported, or if a skip to a safepoint occurred afterwards, the offset of the safe point.
Attributes
- Inherited from:
- ParserCommon
Pattern2 ::= [id `@'] Pattern3
The implicit parameters introduced by _
in the current expression.
Parameters appear in reverse order.
The implicit parameters introduced by _
in the current expression.
Parameters appear in reverse order.
Attributes
- Inherited from:
- Parser
The last offset where a colon at the end of line would be required if a subsequent { ... } block would be converted to an indentation region.
The last offset where a colon at the end of line would be required if a subsequent { ... } block would be converted to an indentation region.
Attributes
- Inherited from:
- Parser
PrefixExpr ::= [PrefixOperator'] SimpleExpr PrefixOperator ::= ‘-’ | ‘+’ | ‘~’ | ‘!’ (if not backquoted)
PrefixExpr ::= [PrefixOperator'] SimpleExpr PrefixOperator ::= ‘-’ | ‘+’ | ‘~’ | ‘!’ (if not backquoted)
Attributes
- Inherited from:
- Parser
RefinedType ::= WithType {[nl] Refinement}
Attributes
- Inherited from:
- Parser
The markup parser. The first time this lazy val is accessed, we assume we were trying to parse an XML literal. The current position is recorded for later error reporting if it turns out that we don't have scala-xml on the compilation classpath.
The markup parser. The first time this lazy val is accessed, we assume we were trying to parse an XML literal. The current position is recorded for later error reporting if it turns out that we don't have scala-xml on the compilation classpath.
Attributes
- Inherited from:
- Parser