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

2011-03-25 Thread Nick Sabalausky
"Jonathan M Davis" wrote in message news:mailman.2700.1300915109.4748.digitalmars-d-le...@puremagic.com... >> On 3/23/11, Jonathan M Davis 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 i

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

2011-03-25 Thread Nick Sabalausky
"Nick Sabalausky" wrote in message news:imivp7$2fu$1...@digitalmars.com... > "Alexey Prokhin" wrote in message > news:mailman.2713.1300954193.4748.digitalmars-d-le...@puremagic.com... >>> Currently, as far as I know, there are only two lexers and two parsers >>> for >>> D: the C++ front end wh

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

2011-03-25 Thread Nick Sabalausky
"Andrej Mitrovic" wrote in message news:mailman.2696.1300895928.4748.digitalmars-d-le...@puremagic.com... > On 3/23/11, Jonathan M Davis 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 thou

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

2011-03-25 Thread Nick Sabalausky
"Alexey Prokhin" wrote in message news:mailman.2713.1300954193.4748.digitalmars-d-le...@puremagic.com... >> 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 ba

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

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

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

2011-03-25 Thread Don
spir wrote: On 03/25/2011 12:08 PM, Regan Heath wrote: On Wed, 23 Mar 2011 21:16:02 -, Jonathan M Davis wrote: There are tasks for which you need to be able to lex and parse D code. To 100% correctly remove unit tests would be one such task. Is that last bit true? You definitely need to

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

2011-03-25 Thread spir
On 03/25/2011 12:08 PM, Regan Heath wrote: On Wed, 23 Mar 2011 21:16:02 -, Jonathan M Davis wrote: There are tasks for which you need to be able to lex and parse D code. To 100% correctly remove unit tests would be one such task. Is that last bit true? You definitely need to be able to l

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

2011-03-25 Thread Regan Heath
On Wed, 23 Mar 2011 21:16:02 -, Jonathan M Davis wrote: There are tasks for which you need to be able to lex and parse D code. To 100% correctly remove unit tests would be one such task. Is that last bit true? You definitely need to be able to lex it, but instead of actually parsing i

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-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 th

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-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 i

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 Andrej Mitrovic
On 3/23/11, Jonathan M Davis wrote: >> On 3/23/11, Jonathan M Davis 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

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

2011-03-23 Thread Jonathan M Davis
> On 3/23/11, Jonathan M Davis 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 some stuff bu

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 > >> 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 w

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

2011-03-23 Thread Kai Meyer
On 03/23/2011 09:16 AM, Jonathan M Davis wrote: On Sun, 20 Mar 2011 07:50:10 -, 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, st

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

2011-03-23 Thread Andrej Mitrovic
On 3/23/11, Jonathan M Davis 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.

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

2011-03-23 Thread Regan Heath
On Wed, 23 Mar 2011 15:16:46 -, Jonathan M Davis wrote: I was just thinking .. if we get a list of the symbols the linker is including, then write an app to take that list, and strip everything else out of the source .. would that work. The Q's are how hard is it to get the symbols from

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

2011-03-23 Thread Jonathan M Davis
> On Sun, 20 Mar 2011 07:50:10 -, 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, s

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

2011-03-23 Thread Regan Heath
On Sun, 20 Mar 2011 07:50:10 -, 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 {} bl

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 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. Motivation: Bug reports fre

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 loo

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 with

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 which

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 t

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]
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 s

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, > >

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 all

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. > >>>

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

2011-03-19 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-19 Thread Michel Fortin
On 2011-03-19 20:41:09 -0400, Jonathan M Davis 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 file. Motivation: Bug

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. > >> Prin

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 ve

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 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, http:

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 Phobos