mescc: Tinycc support: ignore [ULL], UL, LL, L.

* module/language/c99/compiler.mes (cstring->number): Drop suffix.
This commit is contained in:
Jan Nieuwenhuizen 2017-07-21 21:43:18 +02:00
parent eff1e97cdf
commit ef4868eb13

View file

@ -1318,10 +1318,15 @@
(_ ((jump i386:jump-z (wrap-as (i386:accu-zero?))) o)))))
(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))))
(let ((s (cond ((string-suffix? "ULL" s) (string-drop-right s 3))
((string-suffix? "UL" s) (string-drop-right s 2))
((string-suffix? "LL" s) (string-drop-right s 2))
((string-suffix? "L" s) (string-drop-right s 1))
(else 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)))))
(define (struct-field info)
(lambda (o)