@@ -196,7 +196,7 @@ object Parsers {
196196
197197 def isIdent = in.isIdent
198198 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
200200 def isPureArrow : Boolean = isPureArrow(nme.PUREARROW ) || isPureArrow(nme.PURECTXARROW )
201201 def isErased = isIdent(nme.erased) && in.erasedEnabled
202202 def isSimpleLiteral =
@@ -972,7 +972,7 @@ object Parsers {
972972 * capture set `{ref1, ..., refN}` followed by a token that can start a type?
973973 */
974974 def followingIsCaptureSet (): Boolean =
975- in.featureEnabled( Feature .captureChecking) && {
975+ Feature .ccEnabled && {
976976 val lookahead = in.LookaheadScanner ()
977977 def followingIsTypeStart () =
978978 lookahead.nextToken()
@@ -1485,7 +1485,7 @@ object Parsers {
14851485 if ! imods.flags.isEmpty || params.isEmpty then
14861486 syntaxError(em " illegal parameter list for type lambda " , start)
14871487 token = ARROW
1488- else if in .pureFunsEnabled then
1488+ else if Feature .pureFunsEnabled then
14891489 // `=>` means impure function under pureFunctions or captureChecking
14901490 // language imports, whereas `->` is then a regular function.
14911491 imods |= Impure
@@ -1891,7 +1891,7 @@ object Parsers {
18911891 if in.token == ARROW || isPureArrow(nme.PUREARROW ) then
18921892 val isImpure = in.token == ARROW
18931893 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
18951895 else if in.token == LBRACE && followingIsCaptureSet() then
18961896 val start = in.offset
18971897 val cs = captureSet()
@@ -3308,10 +3308,8 @@ object Parsers {
33083308 languageImport(tree) match
33093309 case Some (prefix) =>
33103310 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
33153313 syntaxError(i " this language import is only allowed at the toplevel " , id.span)
33163314 if allSourceVersionNames.contains(imported) && prefix.isEmpty then
33173315 if ! outermost then
0 commit comments