summaryrefslogtreecommitdiffhomepage
path: root/src/parse.y
diff options
context:
space:
mode:
authorcremno <[email protected]>2014-01-31 16:06:45 +0100
committercremno <[email protected]>2014-01-31 18:00:36 +0100
commit4507985c3ea2b3a7d14745f1f432e544ddeafe93 (patch)
tree8dce9e42e85ea6a953b37b7dcce73ce56c277fe4 /src/parse.y
parent7c9a1accff4c42ec781f14b1ba5abaf0ad1bb037 (diff)
downloadmruby-4507985c3ea2b3a7d14745f1f432e544ddeafe93.tar.gz
mruby-4507985c3ea2b3a7d14745f1f432e544ddeafe93.zip
use mrb_bool, FALSE and TRUE more
It doesn't matter to me if one is using FALSE/TRUE instead of 1/0 but I prefer a type (alias) which emphasizes boolean vars to int. I changed 1/0 to FALSE/TRUE anyway.
Diffstat (limited to 'src/parse.y')
-rw-r--r--src/parse.y21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/parse.y b/src/parse.y
index 163c3ea55..f0e9369a9 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -3319,8 +3319,8 @@ backref_error(parser_state *p, node *n)
}
}
-static int peeks(parser_state *p, const char *s);
-static int skips(parser_state *p, const char *s);
+static mrb_bool peeks(parser_state *p, const char *s);
+static mrb_bool skips(parser_state *p, const char *s);
static inline int
nextc(parser_state *p)
@@ -3383,7 +3383,7 @@ skip(parser_state *p, char term)
}
}
-static int
+static mrb_bool
peek_n(parser_state *p, int c, int n)
{
node *list = 0;
@@ -3405,7 +3405,7 @@ peek_n(parser_state *p, int c, int n)
}
#define peek(p,c) peek_n((p), (c), 0)
-static int
+static mrb_bool
peeks(parser_state *p, const char *s)
{
int len = strlen(s);
@@ -3426,7 +3426,7 @@ peeks(parser_state *p, const char *s)
return FALSE;
}
-static int
+static mrb_bool
skips(parser_state *p, const char *s)
{
int c;
@@ -3855,8 +3855,8 @@ heredoc_identifier(parser_state *p)
{
int c;
int type = str_heredoc;
- int indent = FALSE;
- int quote = FALSE;
+ mrb_bool indent = FALSE;
+ mrb_bool quote = FALSE;
node *newnode;
parser_heredoc_info *info;
@@ -5197,7 +5197,7 @@ mrb_parser_parse(parser_state *p, mrbc_context *c)
}
p->cmd_start = TRUE;
- p->in_def = p->in_single = FALSE;
+ p->in_def = p->in_single = 0;
p->nerr = p->nwarn = 0;
p->lex_strterm = NULL;
@@ -5227,7 +5227,6 @@ mrb_parser_new(mrb_state *mrb)
*p = parser_state_zero;
p->mrb = mrb;
p->pool = pool;
- p->in_def = p->in_single = 0;
p->s = p->send = NULL;
#ifdef ENABLE_STDIO
@@ -5235,9 +5234,9 @@ mrb_parser_new(mrb_state *mrb)
#endif
p->cmd_start = TRUE;
- p->in_def = p->in_single = FALSE;
+ p->in_def = p->in_single = 0;
- p->capture_errors = 0;
+ p->capture_errors = FALSE;
p->lineno = 1;
p->column = 0;
#if defined(PARSER_TEST) || defined(PARSER_DEBUG)