- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Positions rewrite
Thu, 2009-07-30, 09:28
Hi Miles, Lukas,
I just checked in a major rewrite of positions. This includes a
rewrite of the position classes themselves.
In particular, sourec, offset, line, column are normal values, not
options. This will probably break a number of things on Miles side.
Miles, can you have a look?
The new positions can be validated like this
scalac -Yrangepos -stop:super *.scala
This will alidate positions after both parser and typer phase. I
verified that most f nsc itself can be compiled with validated
position. I only have two failures that remain. One is in
matching/ParallelMatching.scala, the other is in doc/*.scala. The
parallel matching failure has almost certainly to do with incorrect
positions being generated for default arguments. Lukas, maybe you can
have a look, or we can figure this out together. I'm not sure at the
moment what the problem in doc is.
The rules for positions are documented at the top of
util/Position.scala. I append the relevant doc comment.
Cheers
Thu, 2009-07-30, 10:07
#2
Re: Positions rewrite
On Thu, Jul 30, 2009 at 10:28, martin odersky <martin.odersky@epfl.ch> wrote:
Hi Miles, Lukas,
I just checked in a major rewrite of positions. This includes a
rewrite of the position classes themselves.
In particular, sourec, offset, line, column are normal values, not
options. This will probably break a number of things on Miles side.
Miles, can you have a look?
The new positions can be validated like this
scalac -Yrangepos -stop:super *.scala
This will alidate positions after both parser and typer phase. I
verified that most f nsc itself can be compiled with validated
position. I only have two failures that remain. One is in
matching/ParallelMatching.scala, the other is in doc/*.scala. The
parallel matching failure has almost certainly to do with incorrect
positions being generated for default arguments. Lukas, maybe you can
have a look, or we can figure this out together. I'm not sure at the
moment what the problem in doc is.
OK I'll try to find out what the issue is there.Lukas
Thu, 2009-07-30, 10:17
#3
Re: Re: Positions rewrite
On Thu, Jul 30, 2009 at 10:00 AM, Lukas Rytz wrote:
> OK I'll try to find out what the issue is there.
If you're testing, could you use,
scalac -Yide-debug *.scala
rather than the command line that Martin suggested. -Yide-debug
exactly replicates what IDEs do via the API in
scala.tools.nsc.interactive.
Cheers,
Miles
Thu, 2009-07-30, 10:27
#4
Re: Re: Positions rewrite
On Thu, Jul 30, 2009 at 10:14 AM, Miles Sabin wrote:
> On Thu, Jul 30, 2009 at 10:00 AM, Lukas Rytz wrote:
>> OK I'll try to find out what the issue is there.
>
> If you're testing, could you use,
>
> scalac -Yide-debug *.scala
>
> rather than the command line that Martin suggested. -Yide-debug
> exactly replicates what IDEs do via the API in
> scala.tools.nsc.interactive.
Oh, and any small test cases should go in test/positions ...
Cheers,
Miles
Thu, 2009-07-30, 10:37
#5
Re: Re: Positions rewrite
On Thu, Jul 30, 2009 at 10:16 AM, Miles Sabin wrote:
> Oh, and any small test cases should go in test/positions ...
Sorry, test/files/positions.
Cheers,
Miles
Thu, 2009-07-30, 11:37
#6
Re: Re: Positions rewrite
Hi Miles,
On nsc itself Yide-debug and by setup seem to be equivalent, or rather
-Yrangepos is stricter. One thing Yide-debug does not do yet is
validate positions after parsing. Where did yo notice the problems
with -Yide-debug? I am trying to duplicate with the ant test.positions
target, but it's slow going because the build seems to be messed up on
Windows (and that's where I am right now, working from home)
Cheers
Thu, 2009-07-30, 11:57
#7
Re: Re: Positions rewrite
On Thu, Jul 30, 2009 at 11:33 AM, martin odersky wrote:
> On nsc itself Yide-debug and by setup seem to be equivalent, or rather
> -Yrangepos is stricter.
I'm not sure I understand: -Yide-debug invokes askReload on all the
sources passed to it which should be triggering the same validation
which we expect to happen in the IDE. Has there been some other change
that you've not mentioned?
> One thing Yide-debug does not do yet is validate positions after parsing.
Surely askReload does all the validation that's needed here? If not,
does askReload needs an update?
> Where did yo notice the problems with -Yide-debug?
Pretty much everywhere ... try an empty file for instance (that's one
of the test cases in test/files/positions)
> I am trying to duplicate with the ant test.positions
> target, but it's slow going because the build seems to be messed up on
> Windows (and that's where I am right now, working from home)
Cheers,
Miles
Thu, 2009-07-30, 12:07
#8
Re: Re: Positions rewrite
On Thu, Jul 30, 2009 at 12:47 PM, Miles Sabin wrote:
> On Thu, Jul 30, 2009 at 11:33 AM, martin odersky wrote:
>> On nsc itself Yide-debug and by setup seem to be equivalent, or rather
>> -Yrangepos is stricter.
>
> I'm not sure I understand: -Yide-debug invokes askReload on all the
> sources passed to it which should be triggering the same validation
> which we expect to happen in the IDE. Has there been some other change
> that you've not mentioned?
>
askReload only typechecks in the background. -Trangepos does another
check after typer, but only if called the normal way, not via
askReload. I think we can rig that up better.
>> One thing Yide-debug does not do yet is validate positions after parsing.
>
> Surely askReload does all the validation that's needed here? If not,
> does askReload needs an update?
>
>> Where did yo notice the problems with -Yide-debug?
>
> Pretty much everywhere ... try an empty file for instance (that's one
> of the test cases in test/files/positions)
>
OK, I can reproduce that. It seems that something with the svn merge
failed, so that you changes to Parser did not make it in. I think I
have redone them now, I am testing this at the moment.
Cheers
Thu, 2009-07-30, 14:57
#9
Re: Positions rewrite
I can't build on my mac currently, fresh checkout, same error with java 1.5 / 1.6:
works fine on my linux box though. any ideas? Other mac-guys having the same problem?
Lukas
On Thu, Jul 30, 2009 at 11:00, Lukas Rytz <lukas.rytz@epfl.ch> wrote:
locker.comp:
[mkdir] Created dir: /Users/luc/scala/trunk/build/locker/classes/compiler
[scalacfork] Compiling 231 files to /Users/luc/scala/trunk/build/locker/classes/compiler
[scalacfork] /Users/luc/scala/trunk/src/compiler/scala/tools/nsc/Interpreter.scala:122: error: value Utility is not a member of package net
[scalacfork] import net.Utility.parseURL
[scalacfork] ^
works fine on my linux box though. any ideas? Other mac-guys having the same problem?
Lukas
On Thu, Jul 30, 2009 at 11:00, Lukas Rytz <lukas.rytz@epfl.ch> wrote:
On Thu, Jul 30, 2009 at 10:28, martin odersky <martin.odersky@epfl.ch> wrote:Hi Miles, Lukas,
I just checked in a major rewrite of positions. This includes a
rewrite of the position classes themselves.
In particular, sourec, offset, line, column are normal values, not
options. This will probably break a number of things on Miles side.
Miles, can you have a look?
The new positions can be validated like this
scalac -Yrangepos -stop:super *.scala
This will alidate positions after both parser and typer phase. I
verified that most f nsc itself can be compiled with validated
position. I only have two failures that remain. One is in
matching/ParallelMatching.scala, the other is in doc/*.scala. The
parallel matching failure has almost certainly to do with incorrect
positions being generated for default arguments. Lukas, maybe you can
have a look, or we can figure this out together. I'm not sure at the
moment what the problem in doc is.
OK I'll try to find out what the issue is there.Lukas
Thu, 2009-07-30, 15:17
#10
Re: Positions rewrite
On Thu, Jul 30, 2009 at 15:56, Lukas Rytz <lukas.rytz@epfl.ch> wrote:
I can't build on my mac currently, fresh checkout, same error with java 1.5 / 1.6:locker.comp:
[mkdir] Created dir: /Users/luc/scala/trunk/build/locker/classes/compiler
[scalacfork] Compiling 231 files to /Users/luc/scala/trunk/build/locker/classes/compiler
[scalacfork] /Users/luc/scala/trunk/src/compiler/scala/tools/nsc/Interpreter.scala:122: error: value Utility is not a member of package net
[scalacfork] import net.Utility.parseURL
[scalacfork] ^
changing the line to import scala.net.Utility.parseURL
helps. the question is: why only on (my) mac?
works fine on my linux box though. any ideas? Other mac-guys having the same problem?
Lukas
On Thu, Jul 30, 2009 at 11:00, Lukas Rytz <lukas.rytz@epfl.ch> wrote:
On Thu, Jul 30, 2009 at 10:28, martin odersky <martin.odersky@epfl.ch> wrote:Hi Miles, Lukas,
I just checked in a major rewrite of positions. This includes a
rewrite of the position classes themselves.
In particular, sourec, offset, line, column are normal values, not
options. This will probably break a number of things on Miles side.
Miles, can you have a look?
The new positions can be validated like this
scalac -Yrangepos -stop:super *.scala
This will alidate positions after both parser and typer phase. I
verified that most f nsc itself can be compiled with validated
position. I only have two failures that remain. One is in
matching/ParallelMatching.scala, the other is in doc/*.scala. The
parallel matching failure has almost certainly to do with incorrect
positions being generated for default arguments. Lukas, maybe you can
have a look, or we can figure this out together. I'm not sure at the
moment what the problem in doc is.
OK I'll try to find out what the issue is there.Lukas
Thu, 2009-07-30, 15:27
#11
Re: Re: Positions rewrite
To guess wildly, perhaps there's something on your bootclasspath with
package names beginning with net.
2009/7/30 Lukas Rytz :
>
>
> On Thu, Jul 30, 2009 at 15:56, Lukas Rytz wrote:
>>
>> I can't build on my mac currently, fresh checkout, same error with java
>> 1.5 / 1.6:
>>
>> locker.comp:
>> [mkdir] Created dir:
>> /Users/luc/scala/trunk/build/locker/classes/compiler
>> [scalacfork] Compiling 231 files to
>> /Users/luc/scala/trunk/build/locker/classes/compiler
>> [scalacfork]
>> /Users/luc/scala/trunk/src/compiler/scala/tools/nsc/Interpreter.scala:122:
>> error: value Utility is not a member of package net
>> [scalacfork] import net.Utility.parseURL
>> [scalacfork] ^
>
> changing the line to
> import scala.net.Utility.parseURL
> helps. the question is: why only on (my) mac?
>
>>
>> works fine on my linux box though. any ideas? Other mac-guys having the
>> same problem?
>> Lukas
>>
>>
>> On Thu, Jul 30, 2009 at 11:00, Lukas Rytz wrote:
>>>
>>>
>>> On Thu, Jul 30, 2009 at 10:28, martin odersky
>>> wrote:
>>>>
>>>> Hi Miles, Lukas,
>>>>
>>>> I just checked in a major rewrite of positions. This includes a
>>>> rewrite of the position classes themselves.
>>>> In particular, sourec, offset, line, column are normal values, not
>>>> options. This will probably break a number of things on Miles side.
>>>> Miles, can you have a look?
>>>>
>>>> The new positions can be validated like this
>>>>
>>>> scalac -Yrangepos -stop:super *.scala
>>>>
>>>> This will alidate positions after both parser and typer phase. I
>>>> verified that most f nsc itself can be compiled with validated
>>>> position. I only have two failures that remain. One is in
>>>> matching/ParallelMatching.scala, the other is in doc/*.scala. The
>>>> parallel matching failure has almost certainly to do with incorrect
>>>> positions being generated for default arguments. Lukas, maybe you can
>>>> have a look, or we can figure this out together. I'm not sure at the
>>>> moment what the problem in doc is.
>>>
>>> OK I'll try to find out what the issue is there.
>>> Lukas
>
>
Thu, 2009-07-30, 17:07
#12
Re: Re: Positions rewrite
On Thu, Jul 30, 2009 at 16:20, Ricky Clarkson <ricky.clarkson@gmail.com> wrote:
To guess wildly, perhaps there's something on your bootclasspath with
package names beginning with net.
right thanks. the regression is a special case which can only happen for code insidea package scala.xyz, so it should not be a problem for anybody outside.
cheers: lukas
2009/7/30 Lukas Rytz <lukas.rytz@epfl.ch>:
>
>
> On Thu, Jul 30, 2009 at 15:56, Lukas Rytz <lukas.rytz@epfl.ch> wrote:
>>
>> I can't build on my mac currently, fresh checkout, same error with java
>> 1.5 / 1.6:
>>
>> locker.comp:
>> [mkdir] Created dir:
>> /Users/luc/scala/trunk/build/locker/classes/compiler
>> [scalacfork] Compiling 231 files to
>> /Users/luc/scala/trunk/build/locker/classes/compiler
>> [scalacfork]
>> /Users/luc/scala/trunk/src/compiler/scala/tools/nsc/Interpreter.scala:122:
>> error: value Utility is not a member of package net
>> [scalacfork] import net.Utility.parseURL
>> [scalacfork] ^
>
> changing the line to
> import scala.net.Utility.parseURL
> helps. the question is: why only on (my) mac?
>
>>
>> works fine on my linux box though. any ideas? Other mac-guys having the
>> same problem?
>> Lukas
>>
>>
>> On Thu, Jul 30, 2009 at 11:00, Lukas Rytz <lukas.rytz@epfl.ch> wrote:
>>>
>>>
>>> On Thu, Jul 30, 2009 at 10:28, martin odersky <martin.odersky@epfl.ch>
>>> wrote:
>>>>
>>>> Hi Miles, Lukas,
>>>>
>>>> I just checked in a major rewrite of positions. This includes a
>>>> rewrite of the position classes themselves.
>>>> In particular, sourec, offset, line, column are normal values, not
>>>> options. This will probably break a number of things on Miles side.
>>>> Miles, can you have a look?
>>>>
>>>> The new positions can be validated like this
>>>>
>>>> scalac -Yrangepos -stop:super *.scala
>>>>
>>>> This will alidate positions after both parser and typer phase. I
>>>> verified that most f nsc itself can be compiled with validated
>>>> position. I only have two failures that remain. One is in
>>>> matching/ParallelMatching.scala, the other is in doc/*.scala. The
>>>> parallel matching failure has almost certainly to do with incorrect
>>>> positions being generated for default arguments. Lukas, maybe you can
>>>> have a look, or we can figure this out together. I'm not sure at the
>>>> moment what the problem in doc is.
>>>
>>> OK I'll try to find out what the issue is there.
>>> Lukas
>
>
--
Ricky Clarkson
Java Programmer, AD Holdings
+44 1565 770804
Skype: ricky_clarkson
Google Talk: ricky.clarkson@gmail.com
On Thu, Jul 30, 2009 at 9:28 AM, martin odersky wrote:
> The new positions can be validated like this
>
> scalac -Yrangepos -stop:super *.scala
>
> This will alidate positions after both parser and typer phase. I
> verified that most f nsc itself can be compiled with validated
> position.
Are you sure that this is validating correctly? I get *lots* of
failures with the -Yide-debug option that I added.
Could you try running the test.positions target of the scala/build.xml
which runs scalac with this option against the entire scala source
tree and the new tests in test/positions.
Cheers,
Miles