On Fri, 16 Jan 2015 02:05:09 +
deadalnix via Digitalmars-d digitalmars-d@puremagic.com wrote:
On Tuesday, 13 January 2015 at 12:43:05 UTC, ketmar via
Digitalmars-d wrote:
On Tue, 13 Jan 2015 12:37:22 +
Bruno Medeiros via Digitalmars-d digitalmars-d@puremagic.com
wrote:
On
On 1/11/15 3:48 PM, Walter Bright wrote:
On 1/11/2015 9:45 AM, Stefan Koch wrote:
I'm powerful writing a parser-generator, that will be able to
transform the
generated parse-tree back into source automatically.
writing a rule-based formatter should be pretty doable.
Formatting the AST into
On Friday, 16 January 2015 at 15:06:42 UTC, Ary Borenszweig wrote:
The way I did it in Descent (I copied the logic from JDT) is to
parse the code into an AST, and then walk the AST in sync with
a lexer.
My dfmt tool does something similar. The parser runs over the
code first and makes notes
Hi there, I'm a C++/Python refugee, new to D.
clang-format seems to do a pretty good job with both of these.
Comments seem to be intact unless they're too long, then
they're wrapped. It seems to wrap at a space or other
non-identifier character. Same thing with expressions that are
too long.
On Friday, 16 January 2015 at 15:55:53 UTC, Brian Schott wrote:
On Friday, 16 January 2015 at 15:06:42 UTC, Ary Borenszweig
wrote:
The way I did it in Descent (I copied the logic from JDT) is
to parse the code into an AST, and then walk the AST in sync
with a lexer.
My dfmt tool does
On Saturday, 10 January 2015 at 20:18:03 UTC, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
I with one my good student have started project coDewife 1,5
month ago. It based on some interesting theoretical approach
(something like FSM, but with essential differences).
On Tuesday, 13 January 2015 at 12:43:05 UTC, ketmar via
Digitalmars-d wrote:
On Tue, 13 Jan 2015 12:37:22 +
Bruno Medeiros via Digitalmars-d digitalmars-d@puremagic.com
wrote:
On 10/01/2015 22:11, Walter Bright wrote:
On 1/10/2015 12:17 PM, Walter Bright wrote:
2. it tends to end
On 10/01/2015 22:11, Walter Bright wrote:
On 1/10/2015 12:17 PM, Walter Bright wrote:
2. it tends to end bikeshedding arguments about the right way to format
things
No, it wouldn't. The tool would have to support formatting options, not
just one style (or the tool would be crap). And even
On 10/01/2015 20:17, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
With the DDT parser, it would be fairly easy to add such functionality,
but it never has been high priority.
--
Bruno Medeiros
https://twitter.com/brunodomedeiros
On Tue, 13 Jan 2015 12:37:22 +
Bruno Medeiros via Digitalmars-d digitalmars-d@puremagic.com wrote:
On 10/01/2015 22:11, Walter Bright wrote:
On 1/10/2015 12:17 PM, Walter Bright wrote:
2. it tends to end bikeshedding arguments about the right way to format
things
No, it wouldn't.
On 11/01/2015 18:48, Walter Bright wrote:
On 1/11/2015 9:45 AM, Stefan Koch wrote:
I'm powerful writing a parser-generator, that will be able to
transform the
generated parse-tree back into source automatically.
writing a rule-based formatter should be pretty doable.
Formatting the AST into
On Sun, 11 Jan 2015 13:15:22 -0800
Walter Bright via Digitalmars-d digitalmars-d@puremagic.com wrote:
On 1/11/2015 11:50 AM, Andrei Alexandrescu wrote:
On 1/11/15 10:48 AM, Walter Bright wrote:
The main problem is what to do about comments, which don't fit into the
grammar.
In the first
On 2015-01-11 19:48, Walter Bright wrote:
The main problem is what to do about comments, which don't fit into the
grammar.
Both Clang and Eclipse JDT provide API's for accessing comments.
--
/Jacob Carlborg
On 2015-01-12 09:11, ketmar via Digitalmars-d wrote:
it's easy: put it before `for`.
/*comment*/
for (...)
or just ignore it. and i must confess that i've never seen comment like
this in my lifetime.
I agree. clang-format manage to keep it in the same place.
--
/Jacob Carlborg
On Monday, 12 January 2015 at 01:53:20 UTC, Brian Schott wrote:
On Saturday, 10 January 2015 at 20:18:03 UTC, Walter Bright
wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
https://github.com/Hackerpilot/dfmt
The above is the work of one afternoon and not well tested.
Thanks Brian,
On Sun, 2015-01-11 at 11:19 -0800, Walter Bright via Digitalmars-d wrote:
[…]
It would be in the DMD front end, so LDC and GDC would it
automatically.
s/it/get it/ ?
What wouldn't be automatic would be the command line options and other
surrounding bits and pieces.
[…]
The rules are
On 2015-01-12 03:23:28 +, deadalnix said:
On Saturday, 10 January 2015 at 20:18:03 UTC, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
That is amongst the plans for libd. I'd be happy to support anyone that
want to work on it :)
This is part of the reason I
On Monday, 12 January 2015 at 15:30:42 UTC, qznc wrote:
So I started conceiving of a language in which even the
*comments* were part of the AST. For, me this would be the
aesthetic ideal. It just seemed like the next step in total
AST integration.
The clang-format approach is to make
On Monday, 12 January 2015 at 08:11:27 UTC, ketmar via
Digitalmars-d wrote:
it's easy: put it before `for`.
/*comment*/
for (...)
or just ignore it. and i must confess that i've never seen
comment like
this in my lifetime.
You can't ignore. That is why building such tool in not that
On Monday, 12 January 2015 at 15:30:34 UTC, qznc wrote:
The clang-format approach is to make decisions based on the
AST, but edit the byte array.
dfix uses a similar approach. It uses the AST location
information to make decisions while iterating through the token
array. I think I will end
On Monday, 12 January 2015 at 15:20:24 UTC, Shammah Chancellor
wrote:
On 2015-01-12 03:23:28 +, deadalnix said:
On Saturday, 10 January 2015 at 20:18:03 UTC, Walter Bright
wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
That is amongst the plans for libd. I'd be happy to
On Mon, 12 Jan 2015 19:17:47 +
deadalnix via Digitalmars-d digitalmars-d@puremagic.com wrote:
On Monday, 12 January 2015 at 08:11:27 UTC, ketmar via
Digitalmars-d wrote:
it's easy: put it before `for`.
/*comment*/
for (...)
or just ignore it. and i must confess that i've
On Monday, 12 January 2015 at 05:43:33 UTC, Zach the Mystic wrote:
On Monday, 12 January 2015 at 00:38:20 UTC, Walter Bright wrote:
On 1/11/15 10:48 AM, Walter Bright wrote:
The main problem is what to do about comments, which don't
fit into the
grammar.
In the first version comments might
On Monday, 12 January 2015 at 05:43:33 UTC, Zach the Mystic wrote:
On Monday, 12 January 2015 at 00:38:20 UTC, Walter Bright wrote:
On 1/11/15 10:48 AM, Walter Bright wrote:
The main problem is what to do about comments, which don't
fit into the
grammar.
In the first version comments might
Can this problem be solve on Text Editor level?
I use Sublime, and I need some tool for code formating. Maybe
there is any ready to use addons for D?
On Saturday, 10 January 2015 at 22:11:55 UTC, Walter Bright wrote:
On 1/10/2015 12:17 PM, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
Next question - standalone tool, or built in to dmd (like Ddoc)?
BTW, I think dfmt would be a significant win for D:
1. people
On Saturday, 10 January 2015 at 22:11:55 UTC, Walter Bright wrote:
On 1/10/2015 12:17 PM, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
Next question - standalone tool, or built in to dmd (like Ddoc)?
Please don't make the compiler-executable modify source code. It
On 2015-01-10 23:11, Walter Bright wrote:
Next question - standalone tool, or built in to dmd (like Ddoc)?
Ideally the dmd front end should be available as a library then dfmt
should be a separate tool that uses the same front end library as dmd.
But I know that we're not there yet.
It's
On Saturday, 10 January 2015 at 22:11:55 UTC, Walter Bright wrote:
On 1/10/2015 12:17 PM, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
Next question - standalone tool, or built in to dmd (like Ddoc)?
BTW, I think dfmt would be a significant win for D:
1. people
On 1/11/2015 2:00 AM, NVolcz wrote:
I guess dfmt is to small for GSOC
I'm not so sure. If the code has no comments, it's trivial. Handling comments,
though, can be a bit of a challenge.
Jacob Carlborg wrote in message news:m8thr2$pag$1...@digitalmars.com...
Ideally the dmd front end should be available as a library then dfmt
should be a separate tool that uses the same front end library as dmd. But
I know that we're not there yet.
Well, some of it is. If somebody wants to
On Sun, 2015-01-11 at 11:04 +0100, Jacob Carlborg via Digitalmars-d wrote:
On 2015-01-10 23:11, Walter Bright wrote:
Next question - standalone tool, or built in to dmd (like Ddoc)?
Ideally the dmd front end should be available as a library then dfmt
should be a separate tool that uses
On Sat, 2015-01-10 at 14:11 -0800, Walter Bright via Digitalmars-d wrote:
On 1/10/2015 12:17 PM, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
Next question - standalone tool, or built in to dmd (like Ddoc)?
Why in the compiler, source code formatting is not a
On Saturday, 10 January 2015 at 22:11:55 UTC, Walter Bright wrote:
On 1/10/2015 12:17 PM, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
Next question - standalone tool, or built in to dmd (like Ddoc)?
I think best approach is akin to git subcommands - you can call
On 1/10/15, weaselcat via Digitalmars-d digitalmars-d@puremagic.com wrote:
On Saturday, 10 January 2015 at 20:18:03 UTC, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
Uncrustify claims D support.
http://uncrustify.sourceforge.net/
Yes, and the author is responsive
On 1/11/2015 4:47 AM, Russel Winder via Digitalmars-d wrote:
Next question - standalone tool, or built in to dmd (like Ddoc)?
Also why in DMD and not in LDC or GDC?
It would be in the DMD front end, so LDC and GDC would it automatically.
1. people expect this sort of thing these days
On 1/11/2015 5:11 AM, Dicebot wrote:
I would love to see DDOC implemented that way too.
Ddoc makes use of semantic info, not just an AST. For semantic info, you pretty
much need a real compiler.
On Sun, 11 Jan 2015 12:47:41 +
Russel Winder via Digitalmars-d digitalmars-d@puremagic.com wrote:
I don't think it'll be hard to do as a builtin feature of dmd.
It should be a separate tool not a part of one of the three compilers.
i can't see anything wrong with built-in tool. even if
On 2015-01-11 20:20, Walter Bright wrote:
Ddoc makes use of semantic info, not just an AST. For semantic info, you
pretty much need a real compiler.
I've been thinking of that the last couple of days. It should be pretty
straightforward to copy-paste the driver part of DMD, i.e the part
On 2015-01-11 19:48, Walter Bright wrote:
The main problem is what to do about comments, which don't fit into the
grammar.
A secondary problem is what to do when the line length limit is
exceeded, such as for long expressions.
clang-format seems to do a pretty good job with both of these.
On 1/11/15 10:48 AM, Walter Bright wrote:
On 1/11/2015 9:45 AM, Stefan Koch wrote:
I'm powerful writing a parser-generator, that will be able to
transform the
generated parse-tree back into source automatically.
writing a rule-based formatter should be pretty doable.
Formatting the AST into
I'm powerful writing a parser-generator, that will be able to
transform the generated parse-tree back into source automatically.
writing a rule-based formatter should be pretty doable.
On 1/11/2015 9:45 AM, Stefan Koch wrote:
I'm powerful writing a parser-generator, that will be able to transform the
generated parse-tree back into source automatically.
writing a rule-based formatter should be pretty doable.
Formatting the AST into text is straightforward, dmd already does
On 1/11/2015 11:50 AM, Andrei Alexandrescu wrote:
On 1/11/15 10:48 AM, Walter Bright wrote:
The main problem is what to do about comments, which don't fit into the
grammar.
In the first version comments might go through unchanged.
Consider:
for /*comment*/ (a;
b;
On 1/11/2015 5:53 PM, Brian Schott wrote:
On Saturday, 10 January 2015 at 20:18:03 UTC, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
https://github.com/Hackerpilot/dfmt
The above is the work of one afternoon and not well tested.
That was quick!
On 1/11/15 1:15 PM, Walter Bright wrote:
On 1/11/2015 11:50 AM, Andrei Alexandrescu wrote:
On 1/11/15 10:48 AM, Walter Bright wrote:
The main problem is what to do about comments, which don't fit into the
grammar.
In the first version comments might go through unchanged.
Consider:
for
On 1/11/15 4:37 PM, Walter Bright wrote:
On 1/11/2015 1:31 PM, Andrei Alexandrescu wrote:
On 1/11/15 1:15 PM, Walter Bright wrote:
On 1/11/2015 11:50 AM, Andrei Alexandrescu wrote:
On 1/11/15 10:48 AM, Walter Bright wrote:
The main problem is what to do about comments, which don't fit into
On Saturday, 10 January 2015 at 20:18:03 UTC, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
That is amongst the plans for libd. I'd be happy to support
anyone that want to work on it :)
On 1/11/2015 1:31 PM, Andrei Alexandrescu wrote:
On 1/11/15 1:15 PM, Walter Bright wrote:
On 1/11/2015 11:50 AM, Andrei Alexandrescu wrote:
On 1/11/15 10:48 AM, Walter Bright wrote:
The main problem is what to do about comments, which don't fit into the
grammar.
In the first version comments
On Sunday, 11 January 2015 at 19:50:51 UTC, Andrei Alexandrescu
wrote:
A secondary problem is what to do when the line length limit is
exceeded, such as for long expressions.
I think that's problem #1.
The usual way is to associate cost with various cesures and run
something Dijkstra (or
On Saturday, 10 January 2015 at 20:18:03 UTC, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
https://github.com/Hackerpilot/dfmt
The above is the work of one afternoon and not well tested.
On Sunday, 11 January 2015 at 21:16:41 UTC, Walter Bright wrote:
On 1/11/2015 11:50 AM, Andrei Alexandrescu wrote:
On 1/11/15 10:48 AM, Walter Bright wrote:
The main problem is what to do about comments, which don't
fit into the
grammar.
In the first version comments might go through
On Monday, 12 January 2015 at 00:38:20 UTC, Walter Bright wrote:
On 1/11/15 10:48 AM, Walter Bright wrote:
The main problem is what to do about comments, which don't
fit into the
grammar.
In the first version comments might go through unchanged.
Consider:
for /*comment*/ (a;
Has someone made a dfmt, like http://gofmt.com/ ?
On Saturday, 10 January 2015 at 21:17:29 UTC, Meta wrote:
On Saturday, 10 January 2015 at 20:54:56 UTC, Jacob Carlborg
wrote:
On 2015-01-10 21:17, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
I have thought about it a couple of times but never started.
It would be
On Saturday, 10 January 2015 at 20:54:56 UTC, Jacob Carlborg
wrote:
On 2015-01-10 21:17, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
I have thought about it a couple of times but never started. It
would be really nice to have.
https://github.com/Hackerpilot/dfix
On 2015-01-10 21:17, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
I have thought about it a couple of times but never started. It would be
really nice to have.
--
/Jacob Carlborg
On Saturday, 10 January 2015 at 20:18:03 UTC, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
Uncrustify claims D support.
http://uncrustify.sourceforge.net/
On 1/10/2015 12:17 PM, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
Next question - standalone tool, or built in to dmd (like Ddoc)?
BTW, I think dfmt would be a significant win for D:
1. people expect this sort of thing these days
2. it tends to end bikeshedding
On Saturday, 10 January 2015 at 22:11:55 UTC, Walter Bright wrote:
On 1/10/2015 12:17 PM, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
Next question - standalone tool, or built in to dmd (like Ddoc)?
My only concern about it is if dfmt is changed, then we get
faced
On 2015-01-10 20:17:34 +, Walter Bright said:
Has someone made a dfmt, like http://gofmt.com/ ?
No, I was planning on working on one if we ever got libd parsing 100%
of the code.Unfortunately I haven't had a lot of time to work on
these sorts of things lately.
-Shammah
On Saturday, 10 January 2015 at 21:18:58 UTC, Meta wrote:
https://github.com/Hackerpilot/dfix
Ah, never mind me. Although the functionality between dfix and
a dfmt is probably quite similar.
dfix is more complicated than it could be because it tries to
avoid changing the formatting of the
On Saturday, 10 January 2015 at 20:18:03 UTC, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
I have a module in libdparse that takes an AST and formats it to
an output range, but it is still fairly primitive at the moment.
It could probably be made into a real
On Saturday, 10 January 2015 at 22:11:55 UTC, Walter Bright wrote:
On 1/10/2015 12:17 PM, Walter Bright wrote:
Has someone made a dfmt, like http://gofmt.com/ ?
Next question - standalone tool, or built in to dmd (like Ddoc)?
BTW, I think dfmt would be a significant win for D:
1. people
64 matches
Mail list logo