Am 17.11.2013 00:27, schrieb David A. Wheeler:
> On 16 Nov 2013 21:05:11 +0100, Jörg F. Wittenberger 
> <joerg.wittenber...@softeyes.net> wrote:
>> However I have something else in mind atop. I'd like to look into mixing
>> markdown as a "front end syntax" and re-parse / pattern match data content
>> from the resulting XML syntax tree. See:
>> http://askemos.org/A0cd6168e9408c9c095f700d7c6ec3224?_v=search&_id=756
>> (Note: there's also a related remark: neither basic Scheme `read` nor
>> sweet-read and friends will include comments. For some reason I'd like to
>> be able transform source code _including_ comments into derived versions,
>> which will then be the new version presented for edits by human authors.
>> Ergo: I need those comment nodes to be retained and included with the
>> corresponding "write" alike operation.)
> Hmm.  The current reader obviously doesn't support that.
> Our current reader does call "attach-sourceinfo" to allow
> attaching line/column positions to objects as they are read in.
> That makes debugging more pleasant, when it's implemented
> as something other than a no-op.
> However, comments are not objects, so that won't help you.
>
> Are you sure you need it, though?  Why not have two readers,
> once that reads sweet-expressions, and a separate one that
> skims looking for specially-formatted comments?
> Then you don't need to figure out how to make them work together.
> After all, you can control the acceptable input format... just choose an easy 
> one.

There is no special formatted comments.  I't about all comments. What 
I'm doing, at least with the XML syntax tree is to transform it, I 
change parts of the tree.  However afterwards I need to be able to feed 
it to the human to edit it, at which point I don't want the comments to 
be lost.  I want to be able to do the same thing to the AST derived from 
Scheme source code.


> And if that doesn't work... I guess we could add a
> nonstandard mode that inserted special objects so you can
> record comments. I don't know if that would meet your needs,

That would do it.

> and it'd clearly be a special case not normally used.
> I'm not even sure how to generate all cases nicely.
> Most people expect "read" to DROP comments :-).
>

Sure.

/Jörg

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to