diff --git a/src/_scala b/src/_scala index 73f82f6..c4ccb37 100644 --- a/src/_scala +++ b/src/_scala @@ -41,12 +41,17 @@ typeset -A opt_args local context state line +_scala_features () { + compadd "postfixOps" "reflectiveCalls" "implicitConversions" "higherKinds" \ + "existentials" "experimental.macros" "_" +} + _scala_phases () { - compadd "parser" "namer" "packageobjects" "typer" "superaccessors" \ - "pickler" "refchecks" "selectiveanf" "liftcode" "selectivecps" "uncurry" \ - "tailcalls" "specialize" "explicitouter" "erasure" "lazyvals" "lambdalift" \ - "constructors" "flatten" "mixin" "cleanup" "icode" "inliner" "closelim" \ - "dce" "jvm" "terminal" + compadd "parser" "namer" "packageobjects" "typer" "patmat" "superaccessors" \ + "extmethods" "pickler" "refchecks" "selectiveanf" "selectivecps" "uncurry" \ + "tailcalls" "specialize" "explicitouter" "erasure" "posterasure" "lazyvals" \ + "lambdalift" "constructors" "flatten" "mixin" "cleanup" "icode" "inliner" \ + "inlineExceptionHandlers" "closelim" "dce" "jvm" "terminal" } local -a shared_opts @@ -65,11 +70,12 @@ shared_opts=( "-J-[pass argument directly to Java runtime system]:JVM argument:" "-javabootclasspath+[Override java boot classpath]:Java boot class path directory]:_files -/" "-javaextdirs+[Override java extdirs classpath]:Java extdirs directory:_files -/" + "-language\:-[Enable one or more language features]:feature:_scala_features" "-no-specialization[Ignore @specialize annotations]" "-nobootcp[Do not use the boot classpath for the scala jars]" "-nowarn[Generate no warnings]" "-optimise[Generate faster bytecode by applying optimisations to the program]" - "-P\:-[Pass an option to a plugin (written :)]" + "-P\:-[Pass an option to a plugin (written plugin\:opt)]:plugin option:" "-print[Print program with Scala-specific features removed]" "-sourcepath+[Specify location(s) of source files]:source file directory:_files -/" "-target\:-[Target platform for object files (default\: jvm-1.5)]:platform name:(jvm-1.5 msil)" @@ -91,17 +97,26 @@ X_opts=( "-Xelide-below+[Calls to @elidable methods are omitted if method priority is lower than integer argument]" "-Xexperimental[Enable experimental extensions]" "-Xfatal-warnings[Fail the compilation if there are any warnings]" + "-Xfull-lubs[Retains pre 2.10 behavior of less aggressive truncation of least upper bounds]" "-Xfuture[Turn on future language features]" "-Xgenerate-phase-graph+[Generate the phase graphs (outputs .dot files) to fileX.dot]:output file:_files" "-Xlint[Enable recommended additional warnings]" + "-Xlog-free-terms[Print a message when reification creates a free term]" + "-Xlog-free-types[Print a message when reification resorts to generating a free type]" "-Xlog-implicits[Show more detail on why some implicits are not applicable]" + "-Xlog-implicit-conversions[Print a message whenever an implicit conversion is inserted]" + "-Xlog-reflective-calls[Print a message when a reflective method call is generated]" + "-Xmacro-settings\:-[Custom settings for macros]:option" + "-Xmain-class+[Class for manifest's Main-Class entry (only useful with -d jar)]:path:" "-Xmax-classfile-name+[Maximum filename length for generated classes]" "-Xmigration[Warn about constructs whose behavior may have changed]" "-Xno-forwarders[Do not generate static forwarders in mirror classes]" + "-Xno-patmat-analysis[Don't perform exhaustivity/unreachability analysis. Also, ignore @switch annotation]" "-Xno-uescape[Disable handling of \u unicode escapes]" "-Xnojline[Do not use JLine for editing]" + "-Xoldpatmat[Use the pre-2.10 pattern matcher. Otherwise, the 'virtualizing' pattern matcher is used in 2.10]" "-Xprint\:-[Print out program after ]:phase name:_scala_phases" - "-Xprint-icode[Log internal icode to *.icode files]" + "-Xprint-icode\:-[Log internal icode to *.icode files after phase (default\: icode)]:phase name:_scala_phases" "-Xprint-pos[Print tree positions, as offsets]" "-Xprint-types[Print tree types (debugging option)]" "-Xprompt[Display a prompt after each error (debugging option)]" @@ -116,7 +131,7 @@ X_opts=( "-Xassem-extdirs+[List of directories containing assemblies (requires -target:msil) (default\: lib)]:assembly directory:_files -/" "-Xassem-name+[Name of the output assembly (requires -target:msil)]:assembly name:_files" "-Xassem-path+[List of assemblies referenced by the program (requires -target:msil)]:assembly path:_files" - "-Xsourcedir+[Mirror source folder structure in output directory (requires -target:msil)]:source directory:_files -/". + "-Xsourcedir+[Mirror source folder structure in output directory (requires -target:msil)]:source directory:_files -/" "-Xplugin\:-[Load one or more plugins from file]:plugin file:_files" "-Xpluginsdir+[Path to search compiler plugins]:plugin directory:_files -/" @@ -134,33 +149,48 @@ Y_opts=( "-Ycompact-trees[Use compact tree printer when displaying trees]" "-Ydead-code[Perform dead code elimination]" "-Ydependent-method-types[Allow dependent method types]" + "-Ydump-classes+[Dump the generated bytecode to .class files (useful for reflective compilation that utilizes in-memory classloaders)]:output directory:_files -/" + "-Yeta-expand-keeps-star[Eta-expand varargs methods to T* rather than Seq[T]. This is a temporary option to ease transition.]" "-Ygen-javap+[Generate a parallel output directory of .javap files]:output directory:_files -/" "-Yinfer-argument-types[Infer types for arguments of overriden methods]" "-Yinline[Perform inlining when possible]" + "-Yinline-handlers[Perform exception handler inlining when possible]" + "-Yinline-warnings[Emit inlining warnings (normally surpressed due to high volume)]" + "-Yinvalidate+[Invalidate classpath entry before run]:classpath entry" "-Ylinearizer\:-[Linearizer to use (default\: rpo)]:linearizer:(normal dfs rpo dump)" "-Ylog-classpath[Output information about what classpath is being applied]" + "-Yno-adapted-args[Do not adapt an argument list (either by inserting unit or creating a tuple) to match the receiver]" + "-Ymacro-debug-lite[Trace essential macro-related activities]" + "-Ymacro-debug-verbose[Trace all macro-related activities: compilation, generation of synthetics, classloading, expansion, exceptions]" "-Yno-completion[Disable tab-completion in the REPL]" "-Yno-generic-signatures[Suppress generation of generic signatures for Java]" "-Yno-imports[Compile without any implicit imports]" + "-Yno-predef[Compile without importing Predef]" "-Yno-self-type-checks[Suppress check for self-type conformance among inherited members]" "-Yno-squeeze[Disable creation of compact code in matching]" "-Ynotnull[Enable (experimental and incomplete) scala.NotNull]" + "-Yoverride-objects[Allow member objects to be overridden]" + "-Yoverride-vars[Allow vars to be overridden]" "-Ypmat-naive[Desugar matches as naively as possible]" "-Ypresentation-delay+[Wait number of ms after typing before starting typechecking]" "-Ypresentation-log+[Log presentation compiler events into file]:log file:_files" "-Ypresentation-replay+[Replay presentation compiler events from file]:log file:_files" + "-Ypresentation-strict[Do not report type errors in sources with syntax errors]" + "-Ypresentation-verbose[Print information about presentation compiler tasks]" "-Yprofile-class+[Specify name of profiler class]:profiler class name" "-Yprofile-memory[Heap snapshot after compiler run (requires jgpagent on JVM -agentpath)]" "-Yrangepos[Use range positions for syntax trees]" "-Yrecursion+[Set recursion depth used when locking symbols]" + "-Yreify-copypaste[Dump the reified trees in copypasteable representation]" "-Yrepl-sync[Do not use asynchronous code for REPL startup]" - "-Ypresentation-verbose[Print information about presentation compiler tasks]" "-Yresolve-term-conflict\:-[Resolve term conflicts (default\: error)]:resolution strategy:(package object error)" - "-Yrich-exceptions[Fancier exceptions. Set source search path with -Dscala.control.sourcepath]" "-Yself-in-annots[Include a \"self\" identifier inside of annotations]" "-Yshow\:-[Show after (requires -Xshow-class or -Xshow-object)]:phase name:_scala_phases" "-Yshow-syms[Print the AST symbol hierarchy after each phase]" - "-Yshow-trees[Print detailed ASTs (requires -Xprint:phase)]" + "-Yshow-symkinds[Print abbreviated symbol kinds next to symbol names]" + "-Yshow-trees[Print detailed ASTs (requires -Xprint\:phase)]" + "-Yshow-trees-compact[Print detailed ASTs in compact form (requires -Xprint\:)]" + "-Yshow-trees-stringified[Print stringifications along with detailed ASTs (requires -Xprint\:)]" "-Ystatistics[Print compiler statistics]" "-Ystruct-dispatch\:-[Structural method dispatch policy (default\: poly-cache)]:policy name:(no-cache mono-cache poly-cache invoke-dynamic)" @@ -172,6 +202,7 @@ Y_opts=( "-Ystop-after\:-[Stop after given phase ]:phase name:_scala_phases" "-Ystop-before\:-[Stop before given phase ]:phase name:_scala_phases" + "-Ywarn-adapted-args[Warn if an argument list is modified to match the receiver]" "-Ywarn-all[Enable all -Y warnings]" "-Ywarn-dead-code[Warn when dead code is identified]" "-Ywarn-inaccessible[Warn about inaccessible types in method signatures]" @@ -179,14 +210,20 @@ Y_opts=( "-Ywarn-nullary-unit[Warn when nullary methods return Unit]" "-Ywarn-numeric-widen[Warn when numerics are widened]" "-Ywarn-value-discard[Warn when non-Unit expression results are unused]" - + + "-Ybuild-manager-debug[Generate debug information for the Refined Build Manager compiler]" + "-Ybuilder-debug\:-[Compile using the specified build manager (default\: none)]:manager:(none refined simple)" "-Ycompletion-debug[Trace all tab completion activity]" "-Ydebug[Increase the quantity of debugging output]" "-Ydoc-debug[Trace all scaladoc activity]" "-Yide-debug[Generate, validate and output trees using the interactive compiler]" "-Yinfer-debug[Trace type inference and implicit search]" + "-Yissue-debug[Print stack traces when a context issues an error]" + "-Ypatmat-debug[Trace pattern matching translation]" "-Ypmat-debug[Trace all pattern matcher activity]" + "-Ypos-debug[Trace position validation]" "-Ypresentation-debug[Enable debugging output for the presentation compiler]" + "-Yreify-debug[Trace reification]" "-Yrepl-debug[Trace all REPL activity]" "-Ytyper-debug[Trace all type assignments]" )