| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
SI-7488 REPL javap finds new style delayedEndpoint
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The REPL :java -app command is a convenience to locate
the body of DelayedInit code. Now it will look for
new style delayedEndpoints on the class before it
falls back to showing the apply method of the
delayedInit$body closure.
```
apm@mara:~/tmp$ skala
Welcome to Scala version 2.11.0-20130711-153246-eb1c3137f5 (OpenJDK 64-Bit Server VM, Java 1.7.0_21).
Type in expressions to have them evaluated.
Type :help for more information.
scala> :javap -pv -app delayed.C
public final void delayedEndpoint$delayed$C$1();
flags: ACC_PUBLIC, ACC_FINAL
Code:
stack=2, locals=1, args_size=1
0: getstatic #29 // Field scala/Predef$.MODULE$:Lscala/Predef$;
3: ldc #31 // String this is the initialization code of C
5: invokevirtual #35 // Method scala/Predef$.println:(Ljava/lang/Object;)V
8: return
LocalVariableTable:
Start Length Slot Name Signature
0 9 0 this Ldelayed/C;
LineNumberTable:
line 11: 0
scala> :q
apm@mara:~/tmp$ rm delayed/*.class
apm@mara:~/tmp$ scalac delayed.scala
apm@mara:~/tmp$ skala
Welcome to Scala version 2.11.0-20130711-153246-eb1c3137f5 (OpenJDK 64-Bit Server VM, Java 1.7.0_21).
Type in expressions to have them evaluated.
Type :help for more information.
scala> :javap -pv -app delayed.C
public final java.lang.Object apply();
flags: ACC_PUBLIC, ACC_FINAL
Code:
stack=2, locals=1, args_size=1
0: getstatic #13 // Field scala/Predef$.MODULE$:Lscala/Predef$;
3: ldc #15 // String this is the initialization code of C
5: invokevirtual #19 // Method scala/Predef$.println:(Ljava/lang/Object;)V
8: getstatic #25 // Field scala/runtime/BoxedUnit.UNIT:Lscala/runtime/BoxedUnit;
11: areturn
LocalVariableTable:
Start Length Slot Name Signature
0 12 0 this Ldelayed/C$delayedInit$body;
LineNumberTable:
line 11: 0
line 10: 8
```
|
|\ \
| | |
| | | |
SI-7650 No bang expansions in REPL jline
|
| | |
| | |
| | |
| | | |
Disable expandEvents at the earliest opportunity.
|
|\ \ \
| | | |
| | | | |
Commit .gitignore directly
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Rather than relying on the cloner to copy the
provided gitignore.SAMPLE files.
This finishes the job started in c48509598, mostly
by reverting that commit and moving the two existing
SAMPLE files to the final destinations.
Use `.git/info/exclude` to augment the list of patterns
with entries specific to your workflow.
|
|\ \ \
| | | |
| | | | |
Fixing exhaustiveness warnings.
|
|/ / /
| | |
| | |
| | |
| | | |
ClassfileAnnotArg becoming sealed brought tidings of not being
exhaustive.
|
|\ \ \
| | | |
| | | | |
STARR: use 2.11.0-M4, built with 2.11.0-M3
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Replaced starr jars with 2.11.0-M4, built with Scala 2.11.0-M3.
I used `ant replacestarr-opt -Dstarr.use.released=1`, with `starr.number`:
```
starr.version=2.11.0-M3
```
Then pushed the jars to artifactory after moving `lib/jline.jar` out of the way,
as it's no longer "desired" (i.e., not pulled from artifactory). Its presence
seemed to break `./push-binary-libs.sh $ARTIFACTORY_USER $ARTIFACTORY_PASS`.
You can by-pass the custom starr artifact download and use a (released) version
of Scala by changing your `build.properties` to include
```
starr.use.released=1
```
You may optionally change `starr.version` in `starr.number` to whichever version
that maven can resolve for you.
|
| | | |
|
| | | |
|
| |/
|/| |
|
|\ \
| |/
|/| |
Fix typo in Documentation
|
|/ |
|
|\
| |
| | |
SI-7592 Remove scala.tools.nsc.util.MultiHashMap
|
| | |
|
|\ \
| | |
| | | |
SI-7174 Fix initialization issues
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Without constant inlining, the compiler would not even bootstrap
because it depends on constant inlining hiding initialization issues
which would cause a NPE otherwise.
In this case, global is null at runtime, but no NPE is happening
despite accessing members of global (see SubComponent), because
constant inlining has copied the values of those members to the
call-sites and eliminated the dereference of global.
This commit fixes the initialization order.
|
|\ \ \
| | | |
| | | | |
SI-4684 Repl supports whole-file paste (rebased)
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
By special request, :paste -raw simply compiles the pasted
code to the repl output dir.
The -raw flag means no wrapping; the pasted code must be
ordinary top level Scala code, not script.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Add a file argument to the :paste command which loads the
file's contents as though entered in :paste mode.
The :paste command is replayable.
Samples, including companions defined together:
```
scala> :paste junk.scala
File contains no code: junk.scala
scala> :paste no-file.scala
That file does not exist
scala> :paste obj-repl.scala
Pasting file obj-repl.scala...
<console>:2: error: expected start of definition
private foo = 7
^
scala> :paste hw-repl.scala
Pasting file hw-repl.scala...
The pasted code is incomplete!
<pastie>:5: error: illegal start of simple expression
}
^
scala> :replay
Replaying: :paste junk.scala
File contains no code: junk.scala
Replaying: :paste obj-repl.scala
Pasting file obj-repl.scala...
defined trait Foo
defined object Foo
Replaying: Foo(new Foo{})
res0: Int = 7
```
|
|\ \ \ \
| | | | |
| | | | | |
Fix repl-save test
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Make the test a SessionTest, where the file name appears just
once, in the transcript, and is trivially compared against itself.
The contents of the saved file are still output and compared with
the check file.
|
|\ \ \ \
| |/ / /
|/| | | |
Fixes checkinit build failure caused by quasiquotes pull request
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The failure was caused by recent refactoring that moved fields that are
expected by reflection Reifier from early init block to the body of the
class. According to checkinit this may cause initialization issues
although they do not really happen in real life as most of these fields
aren't used during quasiquotes' reification.
|
|\ \ \
| | | |
| | | | |
SI-7487 Revert "Removed -Ymacro-no-expand."
|
|/ / /
| | |
| | |
| | | |
This reverts commit 71fb0b83a, which itself reverted the fix for SI-6812.
|
|\ \ \
| | | |
| | | | |
SI-6419 Repl save session command
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
A simple save command to write out the current replay stack.
```
scala> val i = 7
i: Int = 7
scala> val j= 8
j: Int = 8
scala> i * j
res0: Int = 56
scala> :save multy.script
scala> :q
apm@mara:~/tmp$ cat multy.script
val i = 7
val j= 8
i * j
apm@mara:~/tmp$ skala
Welcome to Scala version 2.11.0-20130626-204845-a83ca5bdf7 (OpenJDK 64-Bit Server VM, Java 1.7.0_21).
Type in expressions to have them evaluated.
Type :help for more information.
scala> :load multy.script
Loading multy.script...
i: Int = 7
j: Int = 8
res0: Int = 56
scala> :load multy.script
Loading multy.script...
i: Int = 7
j: Int = 8
res1: Int = 56
```
|
|\ \ \ \
| | | | |
| | | | | |
SI-4594 Repl settings command
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
A settings command for the rest of us.
The usual command line options are used, except that boolean flags
are enabled with +flag and disabled with -flag.
```
scala> :settings +deprecation
scala> new BigInt(java.math.BigInteger.TEN) { }
<console>:8: warning: inheritance from class BigInt in package math is deprecated: This class will me made final.
new BigInt(java.math.BigInteger.TEN) { }
^
res0: BigInt = 10
scala> :settings -deprecation
scala> new BigInt(java.math.BigInteger.TEN) { }
res1: BigInt = 10
```
Multivalue "colon" options can be reset by supplying no values
after the colon. This behavior is different from the command line.
```
scala> 1 toString
warning: there were 1 feature warning(s); re-run with -feature for details
res0: String = 1
scala> :settings -language:postfixOps
scala> 1 toString
res1: String = 1
scala> :settings
-d = .
-encoding = UTF-8
-explaintypes = false
-language = List(postfixOps)
-nowarn = false
scala> :settings -language:
scala> :settings
-d = .
-encoding = UTF-8
-explaintypes = false
-language = List()
-nowarn = false
```
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | | |
Previously, multi-valued settings (String- and Phase- valued) could be
augmented but not cleared. Also, phase settings included lazily cached
values that were not recomputed when the setting was changed.
|
|\ \ \ \
| | | | |
| | | | | |
SI-7637 Repl edit command
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Open an editor with historical text.
:edit id will use the complete text of the defining line, including
a multiline expression or template definition. The id must be a term
or type in scope, in particular, defined in the current session.
:edit line will use the specified line(s) from history, as a line
number (123), range (123-130), offset (123+7), remaining (123-) or
previous (-10 for last ten lines).
The env var EDITOR is used to specify an editor to invoke.
If EDITOR is not set or if :line command is used, the selected text
is added to the end of history.
Text is still added to history one line at a time (cf SI-1067).
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Fix docs inconsistent (cmp -> ord).
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The parameter name is 'ord', but mentioned in docs with 'cmp'.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Quasiquotes
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
10229316db allowed macro impls to take and return values of type c.Tree
in addition to the usual c.Expr. However it didn't take into account that
it is often useful to return subtypes of trees (e.g. with quasiquotes
that expand into expressions typed as precisely as possible). This patch
fixes that oversight.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This will help the pattern matcher to emit better code for this kind
of extractor that does nothing but wrap the extractee.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Reintroduces treeBuilder at its old location (Global.treeBuilder) by
routing it from the new location (Parsers.treeBuilder) for the sake of
being friendly to tools that might depend on it.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Introduces an extensive ScalaCheck-based test suite for recently
implemented quasiquotes. Provides tools for syntactic tree comparison
and verifying compilation error messages.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Adds a macro hook into the unapply part of `doTypedApply`, provides
`macroExpandUnapply` in the macro engine and applies a couple of minor
refactorings along the way (renames the ugly `macroExpand1` into
oblivion, changes the ctor of `Fingerprint` to be private and upgrades
`MacroRole` from a string to a value class).
Unapply macros haven't been approved for inclusion in 2.11.0, however
they are necessary for pattern-matching quasiquotes. Therefore I'm only
allowing them to expand for QuasiquoteClass_api_unapply.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
- Additions to the reflection API:
- The Quasiquotes implicit class that defines `q`, `tq`, `pq` and `cq`
interpolators which now become a part of the `scala.reflect.api.
Universe`.
- Implementations of the interpolators are macro-based
and are hardwired through `FastTrack`.
- The `Liftable` class and the `StandardLiftables` slice of the cake
that provide a type class and a bunch of its instances that allow
to easily splice user-defined types into quasiquotes.
- Additional methods in `BuildUtils` that are used by the quasiquote
macro to generate trees, notably:
- `SyntacticClassDef`. An extractor/constructor that allows to
construct and deconstruct classes using arguments that mirror
syntactic form of ClassDefs (e.g. constructor outside of the
body).
- `TupleN`, `TupleTypeN`. Extractor/constructor for easy
construction of ast that represents a tuple term or type
with given amount of elements.
- Actual implementation of quasiquotes in the `scala.tools.reflect.
quasiquotes` package which is organized into a cake called
`Quasiquotes` with slices introducing core abstractions necessary to
splice into Scala syntax, routines for interfacing with the parser,
and customized reifiers for tree construction and deconstruction.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Quasiquoting macros are surprisingly similar to reifying macros, since
both take something and then produce Scala ASTs for that something.
Therefore the upcoming quasiquote patch reuses the vanilla reifier,
adjusting it in key points to enable splicing and extraction to
support string interpolation syntax.
In this commit we prepare the reifier for being reused later on,
adding a modest amound of extensibility hooks.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This routine is going to be necessary in scala-reflect.jar to support
ClassDef construction/deconstruction in the upcoming quasiquote patch.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Introduces a scoping operator used to temporarily look into the future.
Backs up scanner data before evaluating a block and restores it after.
Not used anywhere, only necessary for the upcoming quasiquote patch
in order to reliably detect and accordingly process holes in quasiquoted
Scala syntax.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This is the second of the two patches to the parser necessary for
quasiquotes to function.
This one applies just a couple of minor changes to the way parser works,
so that quasiquotes will be able to extend it to support some
corner cases arising from splicing (see the subsequent quasiquote commit
for more details).
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This is the first of the two patches to the parser necessary for
quasiquotes to function.
This one moves TreeBuilder from Global to the internals of the Parsers,
so that quasiquotes will be able to override it later to support some
corner cases arising from splicing (see the subsequent quasiquote commit
for more details).
Surprisingly enough, almost noone used TreeBuilder outside the parser,
and it was necessary to move just a couple of methods to TreeGen to
satisfy broken dependencies.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-6574 Support @tailrec for extension methods.
|