dontangg/nocco — pull request #13 by JakeH (2013-01-06 04:12:19+00:00)
Title: Many changes for your consideration

Over the holiday week, I did some major changes to this project as it's something I'd like to use for a large TypeScript project I'm working on.

Changes include:

* Index file generated with comment/code snippet previews. (Current implementation is rather boring, but that can be changed with the template file.)
![Index](https://f.cloud.github.com/assets/3156017/45623/5cc0f71e-57a5-11e2-8fba-134e7df67f62.png)

* External configuration file for most application settings.

* Robust command line options for specific job handling as well as some default app setting overrides.
e.g. nocco.exe -p c:\src -o c:\docs -t cs -n "My Project Name" --fullindex --inlineindex

* Language configuration loaded via JSON-formatted external file.

* Language definitions boiled down to easier-to-use values:
```javascript

{
"StartsWith": "/*",
"EndsWith": "*/",
"TrimFromStart":[ "*"],
"IgnoreRepeatingChars" : "true"
}
```

`IgnoreRepeatingChars` makes the comment token `/*` match itself or `/*****` and the token `*/` would also match `******/`

`StartsWith` and `EndsWith` are literal values, not regular expression patterns.

Languages can have many comment directives.

* Comment parser is more complex, returning a line-by-line detail of the exact code and comments extracted, with details on which comment directive was used to match.

* Multi-line comments are now handled

* Self-closing comments inline with code are now handled.
```javascript
/* comment */ var x = false; /* comment 2 */
```

* Comment syntax within string literals are now ignored.
```javascript
var x = 'this /* is not */ a //comment'; // but this is
```

* Parsing of source files is done via a `Stream` to avoid loading the entire file into memory. Summary of the parsing, however, is kept around to build an index file at the end.

* Unit tests have been introduced. Current tests are for the code parser and comment cleaner.

* Code is self-documenting or otherwise commented appropriately.