dud: A dub replacement

Nick Sabalausky (Abscissa) SeeWebsiteToContactMe at semitwist.com
Tue Nov 19 17:13:49 UTC 2019

On 11/19/19 11:30 AM, Steven Schveighoffer wrote:
> And I would complain that the fact json exists as a file format already 
> screws up dub add -- using dub add removes ALL comments in an SDL file, 
> and rewrites the file in the order it sees fit.
> result: I don't use dub add any more.

Oops, that's probably actually my fault, not dub's. Those are current 
limitations of the sdl lib, SDLang-D.

1. The (pull) parser doesn't currently emit comments (and consequently 
the DOM doesn't support them either, not that it matters for dub which 
uses the pull parser directly). IIRC, the comments are currently being 
ignored in the lexer. Shouldn't be TOO terribly hard to fix, though. 
Modify the lexer to emit them as a new token type, and adjust the 
parser's grammar logic to accept them and to emit them as a new pull 
parser event. (PR's always welcome!)

2. IIRC, the lib's only method of generating sdl involves using the DOM, 
and TBH, I don't remember offhand just how friendly/unfriendly it is to 
maintaining a specific ordering. I'd have to look into that. Ideally, 
there should probably be a range-based reverse-pull-parser that just 
takes user-generated pull parser events and spits out an sdl doc.

More information about the Digitalmars-d-announce mailing list