DRY and generally reduce code in scanPunctuator function.

Performance impact is negligible.

https://code.google.com/p/esprima/issues/detail?id=370