lexer: added function hex2val.
Lexer: optimized scanning and converting digits.

* Fix: advance p after 3rd digit of octal escape seq.
* Rolled out loop for decoding escape seq hex digits.