Mercurial > projects > dil
diff trunk/src/cmd/Generate.d @ 755:90668b83ae5e
Introduced new module dil.SourceText and class SourceText.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Wed, 13 Feb 2008 20:21:25 +0100 |
parents | 51e9dfe27f20 |
children | e4b60543c5e8 |
line wrap: on
line diff
--- a/trunk/src/cmd/Generate.d Wed Feb 13 17:10:55 2008 +0100 +++ b/trunk/src/cmd/Generate.d Wed Feb 13 20:21:25 2008 +0100 @@ -12,9 +12,10 @@ dil.ast.Types; import dil.lexer.Lexer; import dil.parser.Parser; -import dil.File; +import dil.SourceText; +import common; + import tango.io.Print; -import common; /// Options for the generate command. enum DocOption @@ -405,8 +406,7 @@ void syntaxToDoc(string filePath, Print!(char) print, DocOption options) { auto tags = options & DocOption.HTML ? html_tags : xml_tags; - auto sourceText = loadFile(filePath); - auto parser = new Parser(sourceText, filePath); + auto parser = new Parser(new SourceText(filePath, true)); auto root = parser.start(); auto lx = parser.lexer; @@ -450,8 +450,7 @@ void tokensToDoc(string filePath, Print!(char) print, DocOption options) { auto tags = options & DocOption.HTML ? html_tags : xml_tags; - auto sourceText = loadFile(filePath); - auto lx = new Lexer(sourceText, filePath); + auto lx = new Lexer(new SourceText(filePath, true)); lx.scanAll(); print(tags[DocPart.Head]~\n);