substack/node-falafel — pull request #5 by alex-seville (2012-10-27 15:15:41+00:00)
Title: Check for newline when reading or updating source.

If you parse code without newline characters, i.e.

`"var a =1;if ( a==1){ a=2; }"`

the node range values are correct, but the source() and update() functions assume a newline character follows (node.range[1] **+ 1**).

Instead of automatically adding 1, I added an internal function to check for the newline character and if it exists add 1, otherwise add 0.