www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - [SAoC2022] Replace libdparse with dmd-as-a-library in D-Scanner week 4

reply Lucian Danescu <lucidanescu28 yahoo.com> writes:
Hello!

This week I added initial implementations for the following 
visitor:
[imports_sortedness](https://github.com/Dlang-UPB/D-scanner/pull/28)

Also created a [pull 
request](https://github.com/dlang/dmd/pull/14578) in `dmd` that
adds an API in `ASTBase`, for the `Expression` class, to check if 
an expression is of
a particular type.

I am also exploring and planning to add an API that can store all 
the tokens in a file.
Here there are 2 options: 1) I will have to create for my project 
a custom lexer that
extends the `dmd` one, and 2) Updating the `dmd` lexer to have 
the possibility to store all
the lexed tokens, maybe under `version(DMDLIB)`. What do you 
think, is that something
worth having in `dmd`?
Oct 18 2022
parent rikki cattermole <rikki cattermole.co.nz> writes:
On 19/10/2022 3:36 AM, Lucian Danescu wrote:
 1) I will have to create for my project a custom lexer that
 extends the `dmd` one
That wouldn't be a custom lexer, however you don't need to do that. https://github.com/dlang/dmd/blob/master/compiler/test/dub_package/lexer.d
Oct 18 2022