July 28, 2013
Well, knowing the lean and mean way dmd is written, alias initializer can be a semantical error rather than syntactical.
July 28, 2013
On Sunday, 28 July 2013 at 13:44:03 UTC, Jacob Carlborg wrote:
> I don't think it's necessary for semantic analysis to be included in Phobos. It's enough to start with a lexer, then later add a parser and semantic analysis.

Those were 2 separate not related questions ;)
July 28, 2013
Am 28.07.2013 00:27, schrieb Brian Schott:
> DScanner is a tool for analyzing D source code. It has the
> following features:
>
> * Prints out a complete AST of a source file in XML format.
> * Syntax checks code and prints warning/error messages
> * Prints a listing of modules imported by a source file
> * Syntax highlights code in HTML format
> * Provides more meaningful "line of code" count than wc
> * Counts tokens in a source file
>
> The lexer/parser/AST are located in the "std/d" directory in the
> repository. These files should prove useful to anyone else
> working on D tooling.
>
> https://github.com/Hackerpilot/Dscanner
>
> Aside: the D grammar that I reverse-engineered can be located
> here:
> https://rawgithub.com/Hackerpilot/DGrammar/master/grammar.html
>

would be nice to habe some sort of binary output (beside xml and json)
to ease (and maybe speed-up) the usage
July 29, 2013
On Saturday, 27 July 2013 at 22:27:35 UTC, Brian Schott wrote:
> DScanner is a tool for analyzing D source code. It has the following features:
>
> * Prints out a complete AST of a source file in XML format.
> * Syntax checks code and prints warning/error messages
> * Prints a listing of modules imported by a source file
> * Syntax highlights code in HTML format
> * Provides more meaningful "line of code" count than wc
> * Counts tokens in a source file
>
> The lexer/parser/AST are located in the "std/d" directory in the repository. These files should prove useful to anyone else working on D tooling.
>
> https://github.com/Hackerpilot/Dscanner
>
> Aside: the D grammar that I reverse-engineered can be located here: https://rawgithub.com/Hackerpilot/DGrammar/master/grammar.html

Dscanner looks like a good starting point for a code formatting tool (like gofmt). However, there seems to be a tradeoff with performance involved. For compilation you want a fast lexer and parser. For formatting you need to preserve comments, though.

For example, convert this from source to AST to source without losing the comments:

void /*hello*/ /*world*/ main () { }
July 31, 2013
Any chance of you turning this into a daemon? Something likt margo or
gocode?
On 29 Jul 2013 11:05, "qznc" <qznc@web.de> wrote:

> On Saturday, 27 July 2013 at 22:27:35 UTC, Brian Schott wrote:
>
>> DScanner is a tool for analyzing D source code. It has the following features:
>>
>> * Prints out a complete AST of a source file in XML format.
>> * Syntax checks code and prints warning/error messages
>> * Prints a listing of modules imported by a source file
>> * Syntax highlights code in HTML format
>> * Provides more meaningful "line of code" count than wc
>> * Counts tokens in a source file
>>
>> The lexer/parser/AST are located in the "std/d" directory in the repository. These files should prove useful to anyone else working on D tooling.
>>
>> https://github.com/**Hackerpilot/Dscanner<https://github.com/Hackerpilot/Dscanner>
>>
>> Aside: the D grammar that I reverse-engineered can be located here: https://rawgithub.com/**Hackerpilot/DGrammar/master/**grammar.html<https://rawgithub.com/Hackerpilot/DGrammar/master/grammar.html>
>>
>
> Dscanner looks like a good starting point for a code formatting tool (like gofmt). However, there seems to be a tradeoff with performance involved. For compilation you want a fast lexer and parser. For formatting you need to preserve comments, though.
>
> For example, convert this from source to AST to source without losing the comments:
>
> void /*hello*/ /*world*/ main () { }
>


July 31, 2013
On Wed, 31 Jul 2013 20:30:17 +0200, Rory McGuire wrote:

> Any chance of you turning this into a daemon? Something likt margo or gocode?

The author has another project here: https://github.com/Hackerpilot/DCD
July 31, 2013
On Wednesday, 31 July 2013 at 18:41:17 UTC, Justin Whear wrote:
> On Wed, 31 Jul 2013 20:30:17 +0200, Rory McGuire wrote:
>
>> Any chance of you turning this into a daemon? Something likt margo or
>> gocode?
>
> The author has another project here: https://github.com/Hackerpilot/DCD

I wouldn't bother trying to use that yet. Maybe next week, but not now. When I get it working there will be a thread on D.announce.
August 01, 2013
okay, I look forward to its release.
I'm really looking forward to code completion in Sublime Text 2



On Wed, Jul 31, 2013 at 10:44 PM, Brian Schott <briancschott@gmail.com>wrote:

> On Wednesday, 31 July 2013 at 18:41:17 UTC, Justin Whear wrote:
>
>> On Wed, 31 Jul 2013 20:30:17 +0200, Rory McGuire wrote:
>>
>>  Any chance of you turning this into a daemon? Something likt margo or
>>> gocode?
>>>
>>
>> The author has another project here: https://github.com/**Hackerpilot/DCD<https://github.com/Hackerpilot/DCD>
>>
>
> I wouldn't bother trying to use that yet. Maybe next week, but not now. When I get it working there will be a thread on D.announce.
>


August 01, 2013
On Saturday, 27 July 2013 at 22:27:35 UTC, Brian Schott wrote:
> DScanner is a tool for analyzing D source code. It has the following features:
>
> * Prints out a complete AST of a source file in XML format.
> * Syntax checks code and prints warning/error messages
> * Prints a listing of modules imported by a source file
> * Syntax highlights code in HTML format
> * Provides more meaningful "line of code" count than wc
> * Counts tokens in a source file
>
> The lexer/parser/AST are located in the "std/d" directory in the repository. These files should prove useful to anyone else working on D tooling.
>
> https://github.com/Hackerpilot/Dscanner
>
> Aside: the D grammar that I reverse-engineered can be located here: https://rawgithub.com/Hackerpilot/DGrammar/master/grammar.html

Thanks Brian!
I do not know about others, but I will definitely use these modules in my projects! :)
Keep up with the good work.
August 02, 2013
On Sun, 28 Jul 2013 00:27:34 +0200
"Brian Schott" <briancschott@gmail.com> wrote:

> DScanner is a tool for analyzing D source code.
>[...]

When I try to compile it (DMD 2.063.2 Win32) I get this:

C:\Users\Nick\AppData\Roaming\dvm\compilers\dmd-2.063.2\bin\..\src\phobos\std\array.d(321):
Error: function core.memory.GC.malloc (uint sz, uint ba = 0u) is not
callable using argument types (ulong, BlkAttr)
C:\Users\Nick\AppData\Roaming\dvm\compilers\dmd-2.063.2\bin\..\src\phobos\std\array.d(272):
Error: template instance std.array.arrayAllocImpl!(false, ubyte[],
ulong) error instantiating main.d(77):        instantiated from here:
uninitializedArray!(ubyte[], ulong) main.d(77): Error: template
instance std.array.uninitializedArray!(ubyte[], ulong) error
instantiating