Unexpected Compiler error on Thread.yield()

6 views
Skip to first unread message

James Caska

unread,
Sep 4, 2014, 4:38:05 PM9/4/14
to boo...@googlegroups.com

I am trying to compile the following test for threads. It runs as long as I don't have Thread.yield () which generates a syntax error, or Thread.sleep(1) which emits an int bytecode instead of long for the parameter.

-------
namespace Boojay.Boogie
 
import java.lang 

class T(Thread):
loops_ as int
def constructor(loops as int):
loops_ = loops
def run():
for x in range(loops_):
print loops_
#Thread.yield() # compile fails
Thread.sleep(1) # compiles ok

class TestBoo():
def doTest():
T(3).start()
T(4).start()
T(5).start()
--------

The Thread.yield() is generating the following boojay compiler error

>boojay\src\Boojay.Boogie\TestBoo.boo(14,19): BCE0043: Unexpected token: ..
>boojay\src\Boojay.Boogie\TestBoo.boo(14,25): BCE0 043: Unexpected token: (.
>boojay\src\Boojay.Boogie\TestBoo.boo(14,26): BCE0 043: Unexpected token: ).

Any suggestions on what causes this/how to fix it. I need yield() as I use simple threading.

Thanks in advance.
James Caska

Rodrigo B. de Oliveira

unread,
Sep 4, 2014, 10:10:45 PM9/4/14
to boo...@googlegroups.com
I've just committed an improvement to boo master that allows yield in
member name position
(https://github.com/bamboo/boo/commit/2c6b923ede17335c5e1d806b3a6e920680f73f8e).

Rebuild boojay against that and it should work.
> --
> You received this message because you are subscribed to the Google Groups
> "boojay" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to boojay+un...@googlegroups.com.
> To post to this group, send email to boo...@googlegroups.com.
> Visit this group at http://groups.google.com/group/boojay.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages