diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/ScriptRunner.scala | 4 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 9 | ||||
-rw-r--r-- | src/manual/scala/man1/scala.scala | 6 | ||||
-rw-r--r-- | src/reflect/scala/reflect/internal/StdNames.scala | 1 |
4 files changed, 8 insertions, 12 deletions
diff --git a/src/compiler/scala/tools/nsc/ScriptRunner.scala b/src/compiler/scala/tools/nsc/ScriptRunner.scala index d553d71bf5..c2d62db558 100644 --- a/src/compiler/scala/tools/nsc/ScriptRunner.scala +++ b/src/compiler/scala/tools/nsc/ScriptRunner.scala @@ -19,7 +19,7 @@ import util.Exceptional.unwrap * exec scala "$0" "$@" * !# * Console.println("Hello, world!") - * argv.toList foreach Console.println + * args.toList foreach Console.println * </pre> * <p>And here is a batch file example on Windows XP:</p> * <pre> @@ -29,7 +29,7 @@ import util.Exceptional.unwrap * goto :eof * ::!# * Console.println("Hello, world!") - * argv.toList foreach Console.println + * args.toList foreach Console.println * </pre> * * @author Lex Spoon diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index e3d2bf14a0..5dadbd0825 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -413,12 +413,10 @@ self => * * {{{ * object moduleName { - * def main(argv: Array[String]): Unit = { - * val args = argv + * def main(args: Array[String]): Unit = * new AnyRef { * stmts * } - * } * } * }}} */ @@ -433,9 +431,8 @@ self => // def main def mainParamType = AppliedTypeTree(Ident(tpnme.Array), List(Ident(tpnme.String))) - def mainParameter = List(ValDef(Modifiers(Flags.PARAM), nme.argv, mainParamType, EmptyTree)) - def mainSetArgv = List(ValDef(NoMods, nme.args, TypeTree(), Ident(nme.argv))) - def mainDef = DefDef(NoMods, nme.main, Nil, List(mainParameter), scalaDot(tpnme.Unit), Block(mainSetArgv, gen.mkAnonymousNew(stmts))) + def mainParameter = List(ValDef(Modifiers(Flags.PARAM), nme.args, mainParamType, EmptyTree)) + def mainDef = DefDef(NoMods, nme.main, Nil, List(mainParameter), scalaDot(tpnme.Unit), gen.mkAnonymousNew(stmts)) // object Main def moduleName = newTermName(ScriptRunner scriptMain settings) diff --git a/src/manual/scala/man1/scala.scala b/src/manual/scala/man1/scala.scala index 6b3be8b77f..92d9c59cca 100644 --- a/src/manual/scala/man1/scala.scala +++ b/src/manual/scala/man1/scala.scala @@ -215,7 +215,7 @@ object scala extends Command { "exec scala \"$0\" \"$@\"\n" + "!#\n" + "Console.println(\"Hello, world!\")\n" + - "argv.toList foreach Console.println"), + "args.toList foreach Console.println"), "Here is a complete Scala script for MS Windows: ", @@ -226,7 +226,7 @@ object scala extends Command { "goto :eof\n" + "::!#\n" + "Console.println(\"Hello, world!\")\n" + - "argv.toList foreach Console.println"), + "args.toList foreach Console.println"), "If you want to use the compilation cache to speed up multiple executions " + "of the script, then add " & Mono("-savecompiled") & " to the scala " + @@ -237,7 +237,7 @@ object scala extends Command { "exec scala -savecompiled \"$0\" \"$@\"\n" + "!#\n" + "Console.println(\"Hello, world!\")\n" + - "argv.toList foreach Console.println")) + "args.toList foreach Console.println")) val exitStatus = Section("EXIT STATUS", diff --git a/src/reflect/scala/reflect/internal/StdNames.scala b/src/reflect/scala/reflect/internal/StdNames.scala index 679186f938..923102a049 100644 --- a/src/reflect/scala/reflect/internal/StdNames.scala +++ b/src/reflect/scala/reflect/internal/StdNames.scala @@ -640,7 +640,6 @@ trait StdNames { val applyDynamicNamed: NameType = "applyDynamicNamed" val applyOrElse: NameType = "applyOrElse" val args : NameType = "args" - val argv : NameType = "argv" val arrayClass: NameType = "arrayClass" val array_apply : NameType = "array_apply" val array_clone : NameType = "array_clone" |