summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/ast/NodePrinters.scala
Commit message (Collapse)AuthorAgeFilesLines
* Removed warningsEECOLOR2015-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | - Added `since` to deprecation statement - Added unit to parameter list - Removed usage of deprecated method polyType - Replaced deprecated `debugwarn` with `devWarning` - Changed switch statement to if else in order to remove a warning - Switched implementation of `init` and `processOptions` to prevent warning - Replaced deprecated `Console.readLine` with `scala.io.StdIn.readLine` - Replaced deprecated `startOrPoint` with `start` - Replaced deprecated `tpe_=` with `setType` - Replaced deprecated `typeCheck` with `typecheck` - Replaced deprecated `CompilationUnit.warning` with `typer.context.warning` - Replaced deprecated `scala.tools.nsc.util.ScalaClassLoader` with `scala.reflect.internal.util.ScalaClassLoader` - Replaced deprecated `scala.tools.ListOfNil` with `scala.reflect.internal.util.ListOfNil` - Replaced deprecated `scala.tools.utils.ScalaClassLoader` with `scala.reflect.internal.util.ScalaClassLoader` - Replaced deprecated `emptyValDef` with `noSelfType` - In `BoxesRunTime` removed unused method and commented out unused values. Did not delete to keep a reference to the values. If they are deleted people might wonder why `1` and `2` are not used. - Replaced deprecated `scala.tools.nsc.util.AbstractFileClassLoader` with `scala.reflect.internal.util.AbstractFileClassLoader`
* Type housekeeping.Paul Phillips2013-09-181-1/+1
| | | | | | | | | | | Moved ListOfNil somewhere more generally accessible. No reason the compiler should hoard it for itself. Flitted to a few locations with constructs like ".head.head" and ".tail.head" looking for code which could be rewritten. Found some, admittedly not always making use of ListOfNil. Made overdue moves of ConstantType(Constant(true|false|null)) to vals in Definitions.
* SI-7261 Implicit conversion of BooleanSetting to Boolean and BooleanFlagSom Snytt2013-03-271-4/+4
| | | | | | | This commit shortens expressions of the form `if (settings.debug.value)` to `if (settings.debug)` for various settings. Rarely, the setting is supplied as a method argument. The conversion is not employed in simple definitions where the Boolean type would have to be specified.
* fixes printing of AppliedTypeTreeEugene Burmako2013-01-091-8/+12
|
* -Yshow-trees-compact respects other optionsEugene Burmako2012-11-111-1/+1
| | | | | | | | The aforementioned tree printer now respects other tree printing options such as -uniqid and -Xprint-types. This helps debugging reify, which uses `nodePrinters`, not `showRaw` to print its trees, because back then `showRaw` didn't exist yet.
* Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013Heather Miller2012-11-021-1/+1
|
* Eliminate breaking relative names in source.Paul Phillips2012-09-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These things are killing me. Constructions like package scala.foo.bar.baz import foo.Other DO NOT WORK in general. Such files are not really in the "scala" package, because it is not declared package scala package foo.bar.baz And there is a second problem: using a relative path name means compilation will fail in the presence of a directory of the same name, e.g. % mkdir reflect % scalac src/reflect/scala/reflect/internal/util/Position.scala src/reflect/scala/reflect/internal/util/Position.scala:9: error: object ClassTag is not a member of package reflect import reflect.ClassTag ^ src/reflect/scala/reflect/internal/util/Position.scala:10: error: object base is not a member of package reflect import reflect.base.Attachments ^ As a rule, do not use relative package paths unless you have explicitly imported the path to which you think you are relative. Better yet, don't use them at all. Unfortunately they mostly work because scala variously thinks everything scala.* is in the scala package and/or because you usually aren't bootstrapping and it falls through to an existing version of the class already on the classpath. Making the paths explicit is not a complete solution - in particular, we remain enormously vulnerable to any directory or package called "scala" which isn't ours - but it greatly limts the severity of the problem.
* cleanup of reflection- and macro-related stuffEugene Burmako2012-08-151-2/+1
| | | | | | mostly removes [Eugene] marks that I left back then and reviews related code some of those tokens got left in place, because I don't know to how fix them without imposing risks on 2.10.0
* update and normalize copyright noticeAdriaan Moors2012-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are the regexp replacements performed: Sxcala -> Scala Copyright (\d*) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*)(,?) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*) Scala Solutions and LAMP/EPFL -> Copyright $1-2012 Scala Solutions and LAMP/EPFL \(C\) (\d*)-(\d*) LAMP/EPFL -> (C) $1-2012 LAMP/EPFL Copyright \(c\) (\d*)-(\d*)(.*?)EPFL -> Copyright (c) $1-2012$3EPFL The last one was needed for two HTML-ified copyright notices. Here's the summarized diff: Created using ``` git diff -w | grep ^- | sort | uniq | mate git diff -w | grep ^+ | sort | uniq | mate ``` ``` - <div id="footer">Scala programming documentation. Copyright (c) 2003-2011 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> - copyright.string=Copyright 2002-2011, LAMP/EPFL - <meta name="Copyright" content="(C) 2002-2011 LAMP/EPFL"/> - * Copyright 2002-2011 LAMP/EPFL - * Copyright 2004-2011 LAMP/EPFL - * Copyright 2005 LAMP/EPFL - * Copyright 2005-2011 LAMP/EPFL - * Copyright 2006-2011 LAMP/EPFL - * Copyright 2007 LAMP/EPFL - * Copyright 2007-2011 LAMP/EPFL - * Copyright 2009-2011 Scala Solutions and LAMP/EPFL - * Copyright 2009-2011 Scxala Solutions and LAMP/EPFL - * Copyright 2010-2011 LAMP/EPFL - * Copyright 2012 LAMP/EPFL -# Copyright 2002-2011, LAMP/EPFL -* Copyright 2005-2011 LAMP/EPFL -/* NSC -- new Scala compiler -- Copyright 2007-2011 LAMP/EPFL */ -rem # Copyright 2002-2011, LAMP/EPFL ``` ``` + <div id="footer">Scala programming documentation. Copyright (c) 2003-2012 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> + copyright.string=Copyright 2002-2012 LAMP/EPFL + <meta name="Copyright" content="(C) 2002-2012 LAMP/EPFL"/> + * Copyright 2002-2012 LAMP/EPFL + * Copyright 2004-2012 LAMP/EPFL + * Copyright 2005-2012 LAMP/EPFL + * Copyright 2006-2012 LAMP/EPFL + * Copyright 2007-2012 LAMP/EPFL + * Copyright 2009-2012 Scala Solutions and LAMP/EPFL + * Copyright 2010-2012 LAMP/EPFL + * Copyright 2011-2012 LAMP/EPFL +# Copyright 2002-2012 LAMP/EPFL +* Copyright 2005-2012 LAMP/EPFL +/* NSC -- new Scala compiler -- Copyright 2007-2012 LAMP/EPFL */ +rem # Copyright 2002-2012 LAMP/EPFL ```
* improves showRawEugene Burmako2012-06-191-1/+1
| | | | addresses concerns raised in http://groups.google.com/group/scala-user/browse_thread/thread/de5a5be2e083cf8e
* The new reflectionEugene Burmako2012-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A must read: "SIP: Scala Reflection": https://docs.google.com/document/d/1Z1VhhNPplbUpaZPIYdc0_EUv5RiGQ2X4oqp0i-vz1qw/edit Highlights: * Architecture has undergone a dramatic rehash. * Universes and mirrors are now separate entities: universes host reflection artifacts (trees, symbols, types, etc), mirrors abstract loading of those artifacts (e.g. JavaMirror loads stuff using a classloader and annotation unpickler, while GlobalMirror uses internal compiler classreader to achieve the same goal). * No static reflection mirror is imposed on the user. One is free to choose between lightweight mirrors and full-blown classloader-based mirror (read below). * Public reflection API is split into scala.reflect.base and scala.reflect.api. The former represents a minimalistic snapshot that is exactly enough to build reified trees and types. To build, but not to analyze - everything smart (for example, getting a type signature) is implemented in scala.reflect.api. * Both reflection domains have their own universe: scala.reflect.basis and scala.reflect.runtime.universe. The former is super lightweight and doesn't involve any classloaders, while the latter represents a stripped down compiler. * Classloader problems from 2.10.0-M3 are solved. * Exprs and type tags are now bound to a mirror upon creation. * However there is an easy way to migrate exprs and type tags between mirrors and even between universes. * This means that no classloader is imposed on the user of type tags and exprs. If one doesn't like a classloader that's there (associated with tag's mirror), one can create a custom mirror and migrate the tag or the expr to it. * There is a shortcut that works in most cases. Requesting a type tag from a full-blown universe will create that tag in a mirror that corresponds to the callsite classloader aka `getClass.getClassLoader`. This imposes no obligations on the programmer, since Type construction is lazy, so one can always migrate a tag into a different mirror. Migration notes for 2.10.0-M3 users: * Incantations in Predef are gone, some of them have moved to scala.reflect. * Everything path-dependent requires implicit prefix (for example, to refer to a type tag, you need to explicitly specify the universe it belongs to, e.g. reflect.basis.TypeTag or reflect.runtime.universe.TypeTag). * ArrayTags have been removed, ConcreteTypeTag have been renamed to TypeTags, TypeTags have been renamed to AbsTypeTags. Look for the reasoning in the nearby children of this commit. Why not in this commit? Scroll this message to the very bottom to find out the reason. * Some of the functions have been renamed or moved around. The rule of thumb is to look for anything non-trivial in scala.reflect.api. Some of tree build utils have been moved to Universe.build. * staticModule and staticClass have been moved from universes to mirrors * ClassTag.erasure => ClassTag.runtimeClass * For the sake of purity, type tags no longer have erasures. Use multiple context bounds (e.g. def foo[T: ru.TypeTag : ClassTag](...) = ...) if you're interested in having both erasures and types for type parameters. * reify now rolls back macro applications. * Runtime evaluation is now explicit, requires import scala.tools.reflect.Eval and scala-compiler.jar on the classpath. * Macro context now has separate universe and mirror fields. * Most of the useful stuff is declared in c.universe, so be sure to change your "import c.universe._" to "import c.mirror._". * Due to the changes in expressions and type tags, their regular factories are now really difficult to use. We acknowledge that macro users need to frequently create exprs and tags, so we added old-style factories to context. Bottom line: almost always prepend Expr(...)/TypeTag(...) with "c.". * Expr.eval has been renamed to Expr.splice. * Expr.value no longer splices (it can still be used to express cross-stage path-dependent types as specified in SIP-16). * c.reifyTree now has a mirror parameter that lets one customize the initial mirror the resulting Expr will be bound to. If you provide EmptyTree, then the reifier will automatically pick a reasonable mirror (callsite classloader mirror for a full-blown universe and rootMirror for a basis universe). Bottom line: this parameter should be EmptyTree in 99% of cases. * c.reifyErasure => c.reifyRuntimeClass. Known issues: * API is really raw, need your feedback. * All reflection artifacts are now represented by abstract types. This means that pattern matching against them will emit unchecked warnings. Adriaan is working on a patch that will fix that. WARNING, FELLOW CODE EXPLORER! You have entered a turbulence zone. For this commit and its nearby parents and children tests are not guaranteed to work. Things get back to normal only after the "repairs the tests after the refactoring spree" commit. Why so weird? These twentish changesets were once parts of a humongous blob, which spanned 1200 files and 15 kLOC. I did my best to split up the blob, so that the individual parts of the code compile and make sense in isolation. However doing the same for tests would be too much work.
* improves traces and error messagesEugene Burmako2012-06-081-0/+2
|
* Removing extraneous files.Paul Phillips2012-05-151-33/+1
| | | | Culling accumulated unnecessary code.
* Better position printing in NodePrinters.Paul Phillips2012-04-261-12/+36
| | | | | | Try this unreasonably long command line: scalac -Xprint-pos -Yshow-trees -Xprint:all -Yrangepos *.scala
* Enabling postfix ops feature warning, and working on libs to avoid them.Martin Odersky2012-04-121-0/+1
|
* Next generation of macrosEugene Burmako2012-04-121-13/+19
| | | | | | | | | | | | | | | | | | | | | | Implements SIP 16: Self-cleaning macros: http://bit.ly/wjjXTZ Features: * Macro defs * Reification * Type tags * Manifests aliased to type tags * Extended reflection API * Several hundred tests * 1111 changed files Not yet implemented: * Reification of refined types * Expr.value splicing * Named and default macro expansions * Intricacies of interaction between macros and implicits * Emission of debug information for macros (compliant with JSR-45) Dedicated to Yuri Alekseyevich Gagarin
* Lots of tedious warning and tree printing work.Paul Phillips2012-03-201-25/+65
| | | | | | | | | | | Fewer deprecation warnings, prettier trees, prettier symbols, more polished error messages. Oh the interesting people you meet handling warnings, I feel sorry for you all that I get to do it all the time. One of the characters I met invited me into the "Dead Code Society" and that's what I'm doing on Tuesdays now. No of course you haven't, it's a SECRET society.
* Tweak to string coloring.Paul Phillips2012-03-201-8/+7
| | | | Concluded String->String would be more useful more often.
* Overhaul of NodePrinters.Paul Phillips2012-03-191-247/+277
| | | | | | | | | Drawing on the previous, a half-decade overdue overhaul of NodePrinters. Now with colors if you like colors. % scalac -Xprint:all -Yshow-trees -Dscala.colors a.scala Am heading toward general purpose color configuration.
* Assorted fixesEugene Burmako2012-02-061-25/+30
| | | | | Multiple fixes that have been accumulated during my investigations of 5273. Too heterogeneous to describe here, too minor to split into changesets.
* Cosmetic removal of redundant toList call on it...Paul Phillips2011-06-251-1/+1
| | | | | Cosmetic removal of redundant toList call on iterable target, no review.
* Changed Super to fix #4300Martin Odersky2011-03-141-1/+2
|
* Updated copyright notices to 2011Antonio Cunei2011-01-201-1/+1
|
* Eliminated SYNTHETICMETH flag.Paul Phillips2010-12-031-57/+3
| | | | | | | meaningful name inside the pattern matcher. Created a tracker for TRANS_FLAG which could enforce the transience it promises us, but didn't turn it on. No review.
* One of those annoying patches for which I apolo...Paul Phillips2010-11-021-1/+1
| | | | | | | | | | One of those annoying patches for which I apologize in advance. It's a step toward a better world. Almost all the changes herein are simple transformations of "x hasFlag FOO" to "x.isFoo", with the remainder minor cleanups. It's too big to review, so let's say no review: but I'm still all ears for input on the issues mostly outlined in HasFlags.scala.
* Abstracting out the common flags code between S...Paul Phillips2010-10-111-1/+0
| | | | | | | | | | | | | | | | | | | | | Abstracting out the common flags code between Symbol and Modifiers into HasFlags. This patch includes only the non-invasive changes: the HasFlags trait is not integrated into those classes. The remainder is complete but I'm checking this part in case anyone would like to throw some feedback my way at this point: general comments, or the open issues noted in comments in HasFlags.scala. This commit also eliminates the (now unused) MONOMORPHIC flag and includes utility methods for reflective analysis of a Flags object which generate code and comments based on the accessors found. See the comment at the top of symtab.Flags and the flagToString implementation in that class for illustration. I haven't tested the very latest, but a slightly older incarnation without material differences showed no measurable performance change. No specific review, but comments welcome.
* Removed more than 3400 svn '$Id' keywords and r...Antonio Cunei2010-05-121-1/+0
| | | | | Removed more than 3400 svn '$Id' keywords and related junk.
* As a brief diversion from real work, implemente...Paul Phillips2010-04-061-1/+1
| | | | | | | | | As a brief diversion from real work, implemented Damerau–Levenshtein and ran it on trunk to elicit obvious misspellings. Unfortunately they're mostly in places like compiler comments which real people never see, but I fixed them anyway. All those English Lit majors who peruse our sources are sure to be pleased. No review.
* The initial results of running a basic cut and ...Paul Phillips2010-02-231-46/+22
| | | | | | | | The initial results of running a basic cut and paste detector over trunk and trying to undo some of it. I can live with history but if I see Cutty McPastington in new commits I will get all finger waggly. Don't make me cross that ocean. No review.
* integration of java and scala deprecationLukas Rytz2009-12-141-1/+0
|
* Updated copyright notices to 2010Antonio Cunei2009-12-071-1/+1
|
* switch to unnested packages.Martin Odersky2009-07-241-3/+6
|
* big overhaul of annotations implementation.Lukas Rytz2009-05-301-10/+10
|
* Named and default argumentsLukas Rytz2009-05-301-0/+1
| | | | | | | - MethodTypes now have (params: List[Symbol]) - "copy"-methods for case classes - the "copy" object in the compiler is now called "treeCopy"
* Fixed problem that spurious caused exhaustivene...Martin Odersky2009-05-271-2/+0
| | | | | | Fixed problem that spurious caused exhaustiveness warning for RefChecks. Enriched positions and worked on the interactive compiler.
* added manifest tests and util.Marshalmichelou2008-11-251-7/+9
|
* Added code pretty-printing for *all* of the pos...Geoffrey Washburn2008-04-171-5/+55
| | | | | | Added code pretty-printing for *all* of the possible FLAGS, since many important ones were missing.
* minor correction in outputmichelou2008-02-211-1/+1
|
* added node info for blocksmichelou2007-10-081-1/+1
|
* Massive check-in for IDE.Sean McDirmid2007-09-171-1/+2
|
* small fix in outputmichelou2007-08-221-3/+3
|
* removed type aliases, old for-syntax, ..michelou2007-07-121-1/+15
|
* 1.Martin Odersky2007-07-121-2/+3
| | | | | | | 2. some new tests. 3. split Type.symbol to typeSymbol/termSymbol 4. some fixes to lub opertation
* also prints ownermichelou2007-06-251-3/+5
|
* incremented MinorVersion, deprecated All/AllRef...michelou2007-06-131-1/+3
| | | | | | incremented MinorVersion, deprecated All/AllRef, remove many type aliases
* added existential typesMartin Odersky2007-06-091-0/+1
|
* Added structural subtyping.Gilles Dubochet2007-06-051-0/+13
|
* fixed bugs 1143, 1136, 1102Martin Odersky2007-05-291-1/+40
|
* Annotations clean up, including:Lex Spoon2007-05-211-1/+1
| | | | | | | | - AnnotationInfo has no type parameter. It always has a parse tree, and sometimes has a constant. - SymbolReifier is separated from LiftCode for independent use - reification into reflect.* structures handles more cases - unreify is added, for enough cases that annotations work
* merged Burak's destructive rev11032 with rev11031michelou2007-05-151-1/+1
|