digitalmars.D - Is this a bug or a feature?
- Daniel Murphy (9/9) Jan 07 2010 The following code compiles under dmd v2.037, no closing brace required.
- Lars T. Kyllingstad (4/16) Jan 07 2010 It could be the same as bug 3542:
- =?UTF-8?B?UGVsbGUgTcOlbnNzb24=?= (3/12) Jan 07 2010 I bumped into this myself the other day, I find it being quite a
- Bane (2/17) Jan 07 2010 It is new neural reader algorithm. It completes source code in the momen...
- Sean Kelly (2/14) Jan 07 2010 That's just in there to put a new spin on the halting problem.
- Ellery Newcomer (12/21) Jan 07 2010 in parse.c, Parser::parseStatement, around line 3533, there be
- Don (7/34) Jan 07 2010 It's there to prevent malformed mixins from causing an infinite loop.
The following code compiles under dmd v2.037, no closing brace required. --------------- import std.stdio; void main() { while(true) writeln("Bug!"); --------------- Bug, or feature for the extremely lazy?
Jan 07 2010
Daniel Murphy wrote:The following code compiles under dmd v2.037, no closing brace required. --------------- import std.stdio; void main() { while(true) writeln("Bug!"); --------------- Bug, or feature for the extremely lazy?It could be the same as bug 3542: http://d.puremagic.com/issues/show_bug.cgi?id=3542 -Lars
Jan 07 2010
On 01/07/2010 02:04 PM, Daniel Murphy wrote:The following code compiles under dmd v2.037, no closing brace required. --------------- import std.stdio; void main() { while(true) writeln("Bug!"); --------------- Bug, or feature for the extremely lazy?I bumped into this myself the other day, I find it being quite a feature. If nothing else, it's kinda cool!
Jan 07 2010
Pelle MÃ¥nsson Wrote:On 01/07/2010 02:04 PM, Daniel Murphy wrote:It is new neural reader algorithm. It completes source code in the moment of compilation by analyzing coder's brain waves. It is not documented yet, so many people assume it is bug.The following code compiles under dmd v2.037, no closing brace required. --------------- import std.stdio; void main() { while(true) writeln("Bug!"); --------------- Bug, or feature for the extremely lazy?I bumped into this myself the other day, I find it being quite a feature. If nothing else, it's kinda cool!
Jan 07 2010
Daniel Murphy Wrote:The following code compiles under dmd v2.037, no closing brace required. --------------- import std.stdio; void main() { while(true) writeln("Bug!"); --------------- Bug, or feature for the extremely lazy?That's just in there to put a new spin on the halting problem.
Jan 07 2010
On 01/07/2010 07:04 AM, Daniel Murphy wrote:The following code compiles under dmd v2.037, no closing brace required. --------------- import std.stdio; void main() { while(true) writeln("Bug!"); --------------- Bug, or feature for the extremely lazy?in parse.c, Parser::parseStatement, around line 3533, there be case TOKlcurly: { nextToken(); Statements *statements = new Statements(); while (token.value != TOKrcurly && token.value != TOKeof) { statements->push(parseStatement(PSsemi | PScurlyscope)); } ..... don't know why the TOKeof is there, but that's what's causing the issue.
Jan 07 2010
Ellery Newcomer wrote:On 01/07/2010 07:04 AM, Daniel Murphy wrote:It's there to prevent malformed mixins from causing an infinite loop. Seems like it should be replaced with an error message: while (token != rcurly) { if (token==TOKeof) { error("} expected"); break;} statements->push() }The following code compiles under dmd v2.037, no closing brace required. --------------- import std.stdio; void main() { while(true) writeln("Bug!"); --------------- Bug, or feature for the extremely lazy?in parse.c, Parser::parseStatement, around line 3533, there be case TOKlcurly: { nextToken(); Statements *statements = new Statements(); while (token.value != TOKrcurly && token.value != TOKeof) { statements->push(parseStatement(PSsemi | PScurlyscope)); } ..... don't know why the TOKeof is there, but that's what's causing the issue.
Jan 07 2010