Add syntax highlighting to the readme (#478)

This commit is contained in:
clYd3r 2017-06-24 14:40:18 +02:00 committed by Petar Kirov
parent 7de68bf5f9
commit 721f2bc907
1 changed files with 89 additions and 82 deletions

View File

@ -21,11 +21,13 @@ compilers instead of DMD. To install, simply place the generated binary (in the
# Usage
The following examples assume that we are analyzing a simple file called helloworld.d
```d
import std.stdio;
void main(string[] args)
{
writeln("Hello World");
}
```
### Token Count
The "--tokenCount" or "-t" option prints the number of tokens in the given file
@ -214,7 +216,11 @@ If a `dscanner.ini` file is locate in the working directory or any of it's paren
The "--ast" or "--xml" options will dump the complete abstract syntax tree of
the given source file to standard output in XML format.
```sh
$ dscanner --ast helloworld.d
```
```xml
<module>
<declaration>
<importDeclaration>
@ -291,6 +297,7 @@ the given source file to standard output in XML format.
</functionDeclaration>
</declaration>
</module>
```
For more readable output, pipe the command through [xmllint](http://xmlsoft.org/xmllint.html)
using its formatting switch.