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
On 03/19/2011 04:51 PM, Andrej Mitrovic wrote:
I'm trying to do something like the following:
File inputfile;
foreach (string name; dirEntries(r.\subdir\, SpanMode.shallow))
{
if (!(isFile(name) getExt(name) == d))
{
continue;
}
inputfile = File(name, a+);
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
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
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.
On 03/19/2011 05:51 PM, Andrej Mitrovic wrote:
I'm trying to do something like the following:
File inputfile;
foreach (string name; dirEntries(r.\subdir\, SpanMode.shallow))
{
if (!(isFile(name) getExt(name) == d))
{
continue;
}
inputfile = File(name, a+);
Do you ever desire literals for byte, ubyte, short and ushort integrals (beside
the currently present for int, uint, long, ulong that are 10, 10U, 10L, 10UL)?
Because of the more strict typing of templates in some situations I have had to
write things like:
cast(ubyte)100
Possible literals
Yeah, I've already done exactly as you guys proposed. Note however
that `inputfile` and `outputfile` should be declared inside the
foreach loop. Either that or you have to call `close()` explicitly. If
you don't do that, file handles don't get released, and you'll
eventually get back a stdio error
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
Piotr Szturmaj Wrote:
Yes, I already used pointers but in other way:
uint[]* temp = aa[5]; // copy uint[] reference
and it worked the same as using 'in'. However, I wasn't sure it's
completely safe.
Depends on what you mean by safe. In your example if 5 is not a key then a
Range
http://d.puremagic.com/issues/show_bug.cgi?id=4870
On 03/20/2011 04:40 PM, bearophile wrote:
Do you ever desire literals for byte, ubyte, short and ushort integrals (beside
the currently present for int, uint, long, ulong that are 10, 10U, 10L, 10UL)?
Because of the more strict typing of templates in some situations I have had to
write things
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 !=
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
On Sun, 20 Mar 2011 19:37:45 +0100, spir denis.s...@gmail.com wrote:
* ideally, I would use the sign to tell signed types apart (1 is
unsigned, +1 is signed)
I hope you messed that one up. An unadorned int literal should be signed.
Period.
* get rid of 01 octal bug!
Oh gods, yes.
On 03/20/2011 09:46 AM, Andrej Mitrovic wrote:
Yeah, I've already done exactly as you guys proposed. Note however
that `inputfile` and `outputfile` should be declared inside the
foreach loop. Either that or you have to call `close()` explicitly. If
you don't do that, file handles don't get
Now I'm trying to do something more complicated, and it seems that while
importing works (it compiles and links fine), actually using the imported
things or pretty much anything that D offers makes the program crash. For
instance, in the D part:
---
module dpart;
import std.stdio;
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
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
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
20 matches
Mail list logo