@@ -196,7 +196,7 @@ object Parsers {
196
196
197
197
def isIdent = in.isIdent
198
198
def isIdent (name : Name ) = in.isIdent(name)
199
- def isPureArrow (name : Name ): Boolean = in.pureFunsEnabled && isIdent(name)
199
+ def isPureArrow (name : Name ): Boolean = isIdent(name) && Feature .pureFunsEnabled
200
200
def isPureArrow : Boolean = isPureArrow(nme.PUREARROW ) || isPureArrow(nme.PURECTXARROW )
201
201
def isErased = isIdent(nme.erased) && in.erasedEnabled
202
202
def isSimpleLiteral =
@@ -972,7 +972,7 @@ object Parsers {
972
972
* capture set `{ref1, ..., refN}` followed by a token that can start a type?
973
973
*/
974
974
def followingIsCaptureSet (): Boolean =
975
- in.featureEnabled( Feature .captureChecking) && {
975
+ Feature .ccEnabled && {
976
976
val lookahead = in.LookaheadScanner ()
977
977
def followingIsTypeStart () =
978
978
lookahead.nextToken()
@@ -1485,7 +1485,7 @@ object Parsers {
1485
1485
if ! imods.flags.isEmpty || params.isEmpty then
1486
1486
syntaxError(em " illegal parameter list for type lambda " , start)
1487
1487
token = ARROW
1488
- else if in .pureFunsEnabled then
1488
+ else if Feature .pureFunsEnabled then
1489
1489
// `=>` means impure function under pureFunctions or captureChecking
1490
1490
// language imports, whereas `->` is then a regular function.
1491
1491
imods |= Impure
@@ -1891,7 +1891,7 @@ object Parsers {
1891
1891
if in.token == ARROW || isPureArrow(nme.PUREARROW ) then
1892
1892
val isImpure = in.token == ARROW
1893
1893
val tp = atSpan(in.skipToken()) { ByNameTypeTree (core()) }
1894
- if isImpure && in .pureFunsEnabled then ImpureByNameTypeTree (tp) else tp
1894
+ if isImpure && Feature .pureFunsEnabled then ImpureByNameTypeTree (tp) else tp
1895
1895
else if in.token == LBRACE && followingIsCaptureSet() then
1896
1896
val start = in.offset
1897
1897
val cs = captureSet()
@@ -3308,10 +3308,8 @@ object Parsers {
3308
3308
languageImport(tree) match
3309
3309
case Some (prefix) =>
3310
3310
in.languageImportContext = in.languageImportContext.importContext(imp, NoSymbol )
3311
- for
3312
- case ImportSelector (id @ Ident (imported), EmptyTree , _) <- selectors
3313
- do
3314
- if globalOnlyImports.contains(QualifiedName (prefix, imported.asTermName)) && ! outermost then
3311
+ for case ImportSelector (id @ Ident (imported), EmptyTree , _) <- selectors do
3312
+ if Feature .handleGlobalLanguageImport(prefix, imported) && ! outermost then
3315
3313
syntaxError(i " this language import is only allowed at the toplevel " , id.span)
3316
3314
if allSourceVersionNames.contains(imported) && prefix.isEmpty then
3317
3315
if ! outermost then
0 commit comments