aboutsummaryrefslogtreecommitdiff
path: root/boot/parser.yy
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-08-21 00:05:03 +0200
committerEugen Wissner <belka@caraus.de>2026-08-21 00:05:03 +0200
commit39269cc68a32f6e1a7524b00da36a1fe4cc7fb8b (patch)
tree9558cd6107d60e22127faeddbdeac5031ee2fdbe /boot/parser.yy
parent4f77ad5d019618893c59a0f8d5bfa6b98e50a3be (diff)
downloadelna-39269cc68a32f6e1a7524b00da36a1fe4cc7fb8b.tar.gz
Implement Single and Double floats
Diffstat (limited to 'boot/parser.yy')
-rw-r--r--boot/parser.yy13
1 files changed, 10 insertions, 3 deletions
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 <std::pair<std::uint8_t, elna::boot::integer_sign>> INTEGER8 WORD8
%token <std::pair<std::uint16_t, elna::boot::integer_sign>> INTEGER16 WORD16
%token <std::pair<std::uint32_t, elna::boot::integer_sign>> INTEGER32 WORD32
-%token <double> FLOAT
+%token <float> SINGLE
+%token <double> DOUBLE
%token <std::uint32_t> CHARACTER
%token <std::string> STRING
%token <bool> BOOLEAN
@@ -298,9 +299,15 @@ literal:
$$ = new boot::literal<boot::integer_literal>(boot::make_position(@$),
boot::integer_literal::from(magnitude), wants_signed);
}
- | FLOAT
+ | SINGLE
{
- $$ = new boot::literal<double>(boot::make_position(@$), $1, boot::integer_sign::unmarked);
+ $$ = new boot::literal<boot::float_literal>(boot::make_position(@$),
+ boot::float_literal::from($1), boot::integer_sign::unmarked);
+ }
+ | DOUBLE
+ {
+ $$ = new boot::literal<boot::float_literal>(boot::make_position(@$),
+ boot::float_literal::from($1), boot::integer_sign::unmarked);
}
| BOOLEAN
{