summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-compiler/core
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-08-14 14:34:53 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-10-12 16:21:40 +0900
commit8a87549315d0c7fd984a8ad239ebe3dbab4d2855 (patch)
treeb5a0209755619ecc2e7bca1314b7a8e61c7b0d21 /mrbgems/mruby-compiler/core
parentef9df5dc7d32b79e6b4e0d6924eeae2cc614dfce (diff)
downloadmruby-8a87549315d0c7fd984a8ad239ebe3dbab4d2855.tar.gz
mruby-8a87549315d0c7fd984a8ad239ebe3dbab4d2855.zip
Rename float configuration option names.
- `MRB_WITHOUT_FLOAT` => `MRB_NO_FLOAT` - `MRB_USE_FLOAT` => `MRB_USE_FLOAT32` The former is to use `USE_XXX` naming convention. The latter is to make sure `float` is 32bit float and not floating point number in general.
Diffstat (limited to 'mrbgems/mruby-compiler/core')
-rw-r--r--mrbgems/mruby-compiler/core/codegen.c16
-rw-r--r--mrbgems/mruby-compiler/core/parse.y4
-rw-r--r--mrbgems/mruby-compiler/core/y.tab.c4
3 files changed, 12 insertions, 12 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c
index f60f1f077..372a2c5f7 100644
--- a/mrbgems/mruby-compiler/core/codegen.c
+++ b/mrbgems/mruby-compiler/core/codegen.c
@@ -530,7 +530,7 @@ new_lit(codegen_scope *s, mrb_value val)
return i;
}
break;
-#ifndef MRB_WITHOUT_FLOAT
+#ifndef MRB_NO_FLOAT
case MRB_TT_FLOAT:
for (i=0; i<s->irep->plen; i++) {
mrb_float f1, f2;
@@ -588,7 +588,7 @@ new_lit(codegen_scope *s, mrb_value val)
}
break;
-#ifndef MRB_WITHOUT_FLOAT
+#ifndef MRB_NO_FLOAT
case MRB_TT_FLOAT:
pv->tt = IREP_TT_FLOAT;
pv->u.f = mrb_float(val);
@@ -1330,7 +1330,7 @@ raise_error(codegen_scope *s, const char *msg)
genop_1(s, OP_ERR, idx);
}
-#ifndef MRB_WITHOUT_FLOAT
+#ifndef MRB_NO_FLOAT
static double
readint_float(codegen_scope *s, const char *p, int base)
{
@@ -2442,7 +2442,7 @@ codegen(codegen_scope *s, node *tree, int val)
mrb_bool overflow;
i = readint_mrb_int(s, p, base, FALSE, &overflow);
-#ifndef MRB_WITHOUT_FLOAT
+#ifndef MRB_NO_FLOAT
if (overflow) {
double f = readint_float(s, p, base);
int off = new_lit(s, mrb_float_value(s->mrb, f));
@@ -2473,7 +2473,7 @@ codegen(codegen_scope *s, node *tree, int val)
}
break;
-#ifndef MRB_WITHOUT_FLOAT
+#ifndef MRB_NO_FLOAT
case NODE_FLOAT:
if (val) {
char *p = (char*)tree;
@@ -2490,7 +2490,7 @@ codegen(codegen_scope *s, node *tree, int val)
{
nt = nint(tree->car);
switch (nt) {
-#ifndef MRB_WITHOUT_FLOAT
+#ifndef MRB_NO_FLOAT
case NODE_FLOAT:
if (val) {
char *p = (char*)tree->cdr;
@@ -2511,7 +2511,7 @@ codegen(codegen_scope *s, node *tree, int val)
mrb_bool overflow;
i = readint_mrb_int(s, p, base, TRUE, &overflow);
-#ifndef MRB_WITHOUT_FLOAT
+#ifndef MRB_NO_FLOAT
if (overflow) {
double f = readint_float(s, p, base);
int off = new_lit(s, mrb_float_value(s->mrb, -f));
@@ -2531,7 +2531,7 @@ codegen(codegen_scope *s, node *tree, int val)
int off = new_lit(s, mrb_fixnum_value(i));
genop_2(s, OP_LOADL, cursp(), off);
}
-#ifndef MRB_WITHOUT_FLOAT
+#ifndef MRB_NO_FLOAT
}
#endif
push();
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y
index c67c694fe..8e3087a2a 100644
--- a/mrbgems/mruby-compiler/core/parse.y
+++ b/mrbgems/mruby-compiler/core/parse.y
@@ -981,7 +981,7 @@ new_int(parser_state *p, const char *s, int base, int suffix)
return result;
}
-#ifndef MRB_WITHOUT_FLOAT
+#ifndef MRB_NO_FLOAT
/* (:float . i) */
static node*
new_float(parser_state *p, const char *s, int suffix)
@@ -5661,7 +5661,7 @@ parser_yylex(parser_state *p)
}
tokfix(p);
if (is_float) {
-#ifdef MRB_WITHOUT_FLOAT
+#ifdef MRB_NO_FLOAT
yywarning_s(p, "floating point numbers are not supported", tok(p));
pylval.nd = new_int(p, "0", 10, 0);
return tINTEGER;
diff --git a/mrbgems/mruby-compiler/core/y.tab.c b/mrbgems/mruby-compiler/core/y.tab.c
index 096543349..48173933f 100644
--- a/mrbgems/mruby-compiler/core/y.tab.c
+++ b/mrbgems/mruby-compiler/core/y.tab.c
@@ -1044,7 +1044,7 @@ new_int(parser_state *p, const char *s, int base, int suffix)
return result;
}
-#ifndef MRB_WITHOUT_FLOAT
+#ifndef MRB_NO_FLOAT
/* (:float . i) */
static node*
new_float(parser_state *p, const char *s, int suffix)
@@ -11553,7 +11553,7 @@ parser_yylex(parser_state *p)
}
tokfix(p);
if (is_float) {
-#ifdef MRB_WITHOUT_FLOAT
+#ifdef MRB_NO_FLOAT
yywarning_s(p, "floating point numbers are not supported", tok(p));
pylval.nd = new_int(p, "0", 10, 0);
return tINTEGER;