diff --git a/module/language/c99/compiler.mes b/module/language/c99/compiler.mes index 2b554781..a734c284 100644 --- a/module/language/c99/compiler.mes +++ b/module/language/c99/compiler.mes @@ -1073,6 +1073,7 @@ (define (cstring->number s) (cond ((string-prefix? "0x" s) (string->number (string-drop s 2) 16)) + ((string-prefix? "0b" s) (string->number (string-drop s 2) 2)) ((string-prefix? "0" s) (string->number s 8)) (else (string->number s)))) diff --git a/scaffold/t.c b/scaffold/t.c index 8ad92369..015c934d 100644 --- a/scaffold/t.c +++ b/scaffold/t.c @@ -347,6 +347,15 @@ math_test () puts ("t: 3 != 3\n"); if ((3 != 3) != 0) return 1; + puts ("t: 011 == 15\n"); + if (011 != 9) return 1; + + puts ("t: 0b11 == 3\n"); + if (0b11 != 3) return 1; + + puts ("t: 0x11 == 3\n"); + if (0x11 != 17) return 1; + return array_test (env); }