From 39269cc68a32f6e1a7524b00da36a1fe4cc7fb8b Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Fri, 21 Aug 2026 00:05:03 +0200 Subject: Implement Single and Double floats --- boot/parser.yy | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'boot/parser.yy') diff --git a/boot/parser.yy b/boot/parser.yy index 411922d..c45fdbc 100644 --- a/boot/parser.yy +++ b/boot/parser.yy @@ -82,7 +82,8 @@ along with GCC; see the file COPYING3. If not see %token > INTEGER8 WORD8 %token > INTEGER16 WORD16 %token > INTEGER32 WORD32 -%token FLOAT +%token SINGLE +%token DOUBLE %token CHARACTER %token STRING %token BOOLEAN @@ -298,9 +299,15 @@ literal: $$ = new boot::literal(boot::make_position(@$), boot::integer_literal::from(magnitude), wants_signed); } - | FLOAT + | SINGLE { - $$ = new boot::literal(boot::make_position(@$), $1, boot::integer_sign::unmarked); + $$ = new boot::literal(boot::make_position(@$), + boot::float_literal::from($1), boot::integer_sign::unmarked); + } + | DOUBLE + { + $$ = new boot::literal(boot::make_position(@$), + boot::float_literal::from($1), boot::integer_sign::unmarked); } | BOOLEAN { -- cgit v1.2.3