libdparse
libdparse copied to clipboard
Library for lexing and parsing D source code
... by using an appropriate constructor ;-) I just had the unpleasant experience of debugging this segfault: ``` Program received signal SIGSEGV, Segmentation fault. 0x00000000005b118c in dparse.rollback_allocator.RollbackAllocator.allocate(const(ulong)) (this=..., size=72) at...
> I couldn't find a place for tests of the formatter. A good start for a test suite would be to parse, and dump a lot of D code with...
templated enums decl are called EponymousTemplateDeclaration, but not auto. Maybe they should be the same. ```d enum ep1(T) = T.sizeof; // EponymousTemplateDeclaration auto ep2(T) = T.sizeof; // for now VariableDeclaration......
For ``` D const a (0); ``` no error is emitted. DMD parser finds > Error: unexpected ( in declarator
Now after using the libdparse API again, I have to complain a bit. As a user I don't care about LexerConfig, StringCache, RollBackAllocator etc. - those are mostly implementation details...
``` $ dscanner --ast @test void foo(); test foo void ``` Yet: ``` $ dscanner --ast @test: void foo(); test foo void ``` Notice that the first one has the...
The following ExpressionStatement containing a function literal gets parsed as a block statement. ``` d import std.stdio; void main() { { writeln("test"); }; } ``` Note: DMD gets this wrong...
Not Found - Request ID: 01GDEMHJHV1T1MEEPEHSA2JH2B HTTPS broken
Co-authored-by: Eyal Lotem Signed-off-by: Luís Ferreira --- Adapted from https://github.com/weka/libdparse/commit/caac5e48884992aebddf1f3bd051f5c128d505d6 to upstream. CC @EyalIO . Fixes #370 and somewhat related to #73.
it's valid syntax