mainland/language-c-quote — pull request #20 by sw17ch (2013-07-10 04:20:09+00:00)
Title: Fixing lexing of hex constants.

This pull request fixes a problem where lexer fails to interpet the integer value of hexadecimal constants.

In the following example, we'd expect `[cexp|0x10|]` to result in an expression with an integer value of `16`. Instead, it comes back with a value of `0`.

```haskell
exp_hex :: Test
exp_hex = testCase "exp hex" $
(C.Const (C.IntConst "0x10" C.Signed 16 noLoc) noLoc) @=? [cexp|0x10|]
```

I isolated this problem to some issues in the `lexInteger` function in `Lexer.x`. The changes I made involved the following:

* For `i`, use `num` instead of `s`.
* In `num` and `suffix` is the digit-checking function from `radix` instead of `isDigit` from `Data.Char`.
* Adding two test cases to check that parsing of hex and octal constants continued to work.