Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-25 Thread Nick Sabalausky
Regan Heath re...@netmail.co.nz wrote in message news:op.vswbv8qj54x...@puck.auriga.bhead.co.uk... On Wed, 23 Mar 2011 21:16:02 -, Jonathan M Davis jmdavisp...@gmx.com wrote: There are tasks for which you need to be able to lex and parse D code. To 100% correctly remove unit tests would

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-25 Thread Nick Sabalausky
Jonathan M Davis jmdavisp...@gmx.com wrote in message news:mailman.2700.1300915109.4748.digitalmars-d-le...@puremagic.com... On 3/23/11, Jonathan M Davis jmdavisp...@gmx.com wrote: That would require a full-blown D lexer and parser. - Jonathan M Davis Isn't DDMD written in D? I'm not

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-24 Thread Alexey Prokhin
Currently, as far as I know, there are only two lexers and two parsers for D: the C++ front end which dmd, gdc, and ldc use and the D front end which ddmd uses and which is based on the C++ front end. Both of those are under the GPL (which makes them useless for a lot of stuff) and both of

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-24 Thread spir
On 03/24/2011 08:53 AM, Alexey Prokhin wrote: Currently, as far as I know, there are only two lexers and two parsers for D: the C++ front end which dmd, gdc, and ldc use and the D front end which ddmd uses and which is based on the C++ front end. Both of those are under the GPL (which makes

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-24 Thread Trass3r
Is there a copy of the official D grammar somewhere online? I wrote a lexer for my Compiler class and would love to try and apply it to another grammar. The official D grammar is spread among the specification. But I recall that someone compiled a complete grammar for D1 some time ago.

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-23 Thread Jonathan M Davis
On 03/23/2011 09:16 AM, Jonathan M Davis wrote: On Sun, 20 Mar 2011 07:50:10 -, Jonathan M Davisjmdavisp...@gmx.com wrote: Jonathan M Davis wrote: On Saturday 19 March 2011 18:04:57 Don wrote: Jonathan M Davis wrote: On Saturday 19 March 2011 17:11:56 Don wrote: Here's the

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-23 Thread Jonathan M Davis
On 3/23/11, Jonathan M Davis jmdavisp...@gmx.com wrote: That would require a full-blown D lexer and parser. - Jonathan M Davis Isn't DDMD written in D? I'm not sure about how finished it is though. Yes, but the lexer and parser in ddmd are not only GPL (which would be a problem for

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-23 Thread Andrej Mitrovic
On 3/23/11, Jonathan M Davis jmdavisp...@gmx.com wrote: On 3/23/11, Jonathan M Davis jmdavisp...@gmx.com wrote: That would require a full-blown D lexer and parser. - Jonathan M Davis Isn't DDMD written in D? I'm not sure about how finished it is though. Yes, but the lexer and parser in

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-23 Thread Andrej Mitrovic
What about the artistic license, the front-end can be used with that license. Is that less restrictive than GPL?

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-23 Thread Jonathan M Davis
What about the artistic license, the front-end can be used with that license. Is that less restrictive than GPL? I don't know what the exact licensing situation is. However, as I understand it, the C++ front-end is under the GPL, and therefore because ddmd is based on the C++ front-end, it is

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-21 Thread Simen kjaeraas
On Mon, 21 Mar 2011 01:52:45 +0100, Ary Manzana a...@esperanto.org.ar wrote: On 3/19/11 9:11 PM, Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Strip out all comments as well. Print out the resulting file.

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-20 Thread Don
Jonathan M Davis wrote: On Saturday 19 March 2011 18:04:57 Don wrote: Jonathan M Davis wrote: On Saturday 19 March 2011 17:11:56 Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Strip out all comments as well. Print

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-20 Thread Jonathan M Davis
Jonathan M Davis wrote: On Saturday 19 March 2011 18:04:57 Don wrote: Jonathan M Davis wrote: On Saturday 19 March 2011 17:11:56 Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Strip out all comments as

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-20 Thread Don
Jonathan M Davis wrote: Jonathan M Davis wrote: On Saturday 19 March 2011 18:04:57 Don wrote: Jonathan M Davis wrote: On Saturday 19 March 2011 17:11:56 Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Strip out

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-20 Thread Jonathan M Davis
Jonathan M Davis wrote: Jonathan M Davis wrote: On Saturday 19 March 2011 18:04:57 Don wrote: Jonathan M Davis wrote: On Saturday 19 March 2011 17:11:56 Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them.

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-20 Thread Tyro[a.c.edwards]
Not very elegant but this should get the job done: 000 module strip; 001 import std.algoritm : countUntil; 002 import std.array: strip; 003 import std.file : read; 004 import std.string : splitlines; 005 import std.stdio: writeln; 006 007 void main(string[] args) 008 { 009 bool

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-20 Thread Tyro[a.c.edwards]
The following patch addresses the following issues: 1) fixed improper handling of nested and multiline comments that do not take up a complete line. 2) eliminate extra blank lines where unit tests and comments are removed. Replace lines 31 32 with: # auto n = countUntil(line, +/); # if(n !=

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-20 Thread Tyro[a.c.edwards]
Messed that up again: see embeded change. Wish I could just copy and pase but that's not possible with my current setup. == Quote from Tyro[a.c.edwards] (nos...@home.com)'s article The following patch addresses the following issues: 1) fixed improper handling of nested and multiline comments

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-20 Thread Kai Meyer
On 03/19/2011 06:11 PM, Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Strip out all comments as well. Print out the resulting file. Motivation: Bug reports frequently come with very large test cases. Even ones

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-20 Thread Zirneklis
On 20/03/2011 19:55, Kai Meyer wrote: On 03/19/2011 06:11 PM, Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Strip out all comments as well. Print out the resulting file. Motivation: Bug reports frequently come

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-20 Thread Ary Manzana
On 3/19/11 9:11 PM, Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Strip out all comments as well. Print out the resulting file. Motivation: Bug reports frequently come with very large test cases. Even ones which

Want to help DMD bugfixing? Write a simple utility.

2011-03-19 Thread Don
Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Strip out all comments as well. Print out the resulting file. Motivation: Bug reports frequently come with very large test cases. Even ones which look small often import from

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-19 Thread David Nadlinger
On 3/20/11 1:11 AM, Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Strip out all comments as well. Print out the resulting file. I realize that you asked for a very specific utility, but in several instances,

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-19 Thread Jonathan M Davis
On Saturday 19 March 2011 17:11:56 Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Strip out all comments as well. Print out the resulting file. Motivation: Bug reports frequently come with very large test

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-19 Thread Don
Jonathan M Davis wrote: On Saturday 19 March 2011 17:11:56 Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Strip out all comments as well. Print out the resulting file. Motivation: Bug reports frequently come with

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-19 Thread Jonathan M Davis
On Saturday 19 March 2011 18:04:57 Don wrote: Jonathan M Davis wrote: On Saturday 19 March 2011 17:11:56 Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Strip out all comments as well. Print out the

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-19 Thread Michel Fortin
On 2011-03-19 20:41:09 -0400, Jonathan M Davis jmdavisp...@gmx.com said: On Saturday 19 March 2011 17:11:56 Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Strip out all comments as well. Print out the resulting