SapphireSteel Forum
Welcome, Guest. Please login or register.
May 24, 2013, 02:15:42 AM

Login with username, password and session length
Search:     Advanced search
Welcome to the SapphireSteel forum - for discussion of the Ruby In Steel and Amethyst IDEs
3884 Posts in 800 Topics by 669 Members
Latest Member: m
* Home Help Search Login Register
+  SapphireSteel Forum
|-+  General
| |-+  Amethyst
| | |-+  Small bug in Wrapping: Leave block on a single line
« previous next »
Pages: [1] Print
Author Topic: Small bug in Wrapping: Leave block on a single line  (Read 719 times)
Jason King
Full Member
***
Posts: 159


« on: June 06, 2011, 01:03:36 PM »

There is a small bug when Leave block on a single line is unchecked.  Consider the following code...
Code:
public function Foo():void
{
var abc:Object = {xyz:123};
{x += 5; y += 7;}
return {test:true, bar:10};
}
gets converted into...
Code:
public function Foo():void
{
var abc:Object = {xyz:123};
{
x += 5;
y += 7;
}
return
{
test:true, bar:10
}
;
}
The problem is with the return statement.  It is a statement (like the var abc...) but it is being treated like a block.

Please fix.

Thanks,
Jason
Logged
Dermot
Administrator
Hero Member
*****
Posts: 1005


« Reply #1 on: June 06, 2011, 02:26:48 PM »

Yes - the
Code:
{test:true, bar:10}
is an object literal. I've got code in that detects '=' and parenthesised expressions  for object literals but not return statements. I think that's an easy fix.

Dermot
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!