pugjs / pug-code-gen

https://github.com/pugjs/pug/tree/master/packages/pug-code-gen
7 stars 9 forks source link

Walk the entire AST to look for the doctype #10

Closed ForbesLindesay closed 7 years ago

ForbesLindesay commented 9 years ago

[closes jadejs/jade#1918]

This is a little bit of a fudge, and it really should have some unit tests.

TimothyGu commented 9 years ago

Would it be better to add a doctype property to the outermost AST node in the parser? At least that would save the time for walking the AST again.

ForbesLindesay commented 9 years ago

True, probably needs to be in the linker though, since it could be any of the un-linked ASTs that contain the doctype.

jeromew commented 7 years ago

I decided not to migrate this PR to the monorepo.