From 9d74b1c7c76992634ef6649fa3de15e4e47ab1fe Mon Sep 17 00:00:00 2001 From: Li Jin Date: Tue, 28 Jan 2020 01:19:27 +0800 Subject: fix. --- makefile | 2 +- src/MoonP/parser.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/makefile b/makefile index a3379a4..d290ad9 100644 --- a/makefile +++ b/makefile @@ -2,7 +2,7 @@ # The name of the executable to be created BIN_NAME := moonc # Compiler used -CXX ?= g++ +CXX ?= clang # Extension of source files used in the project SRC_EXT = cpp # Path to the source directory, relative to the makefile diff --git a/src/MoonP/parser.cpp b/src/MoonP/parser.cpp index 19c0068..94f80af 100644 --- a/src/MoonP/parser.cpp +++ b/src/MoonP/parser.cpp @@ -824,7 +824,7 @@ bool _context::parse_non_term(rule &r) { rule::_state old_state = r.m_state; //success/failure result - bool ok; + bool ok = false; //compute the new position size_t new_pos = m_pos.m_it - m_begin; @@ -927,7 +927,7 @@ bool _context::parse_term(rule &r) { rule::_state old_state = r.m_state; //success/failure result - bool ok; + bool ok = false; //compute the new position size_t new_pos = m_pos.m_it - m_begin; @@ -1026,7 +1026,7 @@ bool _context::parse_term(rule &r) { //parse non-term rule internal. bool _context::_parse_non_term(rule &r) { - bool ok; + bool ok = false; if (_private::get_parse_proc(r)) { pos b = m_pos; ok = _private::get_expr(r)->parse_non_term(*this); @@ -1043,7 +1043,7 @@ bool _context::_parse_non_term(rule &r) { //parse term rule internal. bool _context::_parse_term(rule &r) { - bool ok; + bool ok = false; if (_private::get_parse_proc(r)) { pos b = m_pos; ok = _private::get_expr(r)->parse_term(*this); -- cgit v1.2.3-55-g6feb