Fix if_break_else to not require -Wno-misleading-indentation with gcc

parent b828f15c
Pipeline #42677 passed with stages
in 12 minutes and 44 seconds
......@@ -35,9 +35,7 @@ override CFLAGS+=-DWINDOWS
else
override CFLAGS+=-DPOSIX -D_POSIX_C_SOURCE=199309L -D_XOPEN_SOURCE=500 -D_C99_SOURCE
endif
ifeq ($(USING_CLANG),0)
override CFLAGS+=-Wno-misleading-indentation
else
ifeq ($(USING_CLANG),1)
override CFLAGS+=-Wno-parentheses-equality
ifneq ($(OS),Mac)
# Avoid address significance table on ELF; this is not support by all assemblers yet
......
......@@ -92,11 +92,11 @@ where
mark t :== append "MARK" t
concat_up_to_mark t=:{output} :==
let (ls,[_:rest]) = span ((<>) "MARK") output in
{t & output=[join " " (reverse ls):rest]}
{t & output=[concat (reverse ls):rest]}
where
join :: !String ![String] -> String
join _ [s] = s
join g [s:ss] = s+-+g+-+join g ss
concat :: ![String] -> String
concat [s] = s
concat [s:ss] = s+-+concat ss
drop_last_line t=:{output=[_:os]} :== {t & output=os}
instr_unimplemented :: !Target -> Target
......@@ -404,7 +404,7 @@ if_then_else c then elifs else t
-> t
if_break_else :: !(Expr TBool) !(Target -> Target) !Target -> Target
if_break_else c else t = concat_up_to_mark (else (append ("\t\tif ("+-+c+-+") break;") (mark t)))
if_break_else c else t = concat_up_to_mark (else (append ("\t\tif ("+-+c+-+") break;\n\t") (mark t)))
instance ensure_hp (Expr t) where ensure_hp i t = append ("\tNEED_HEAP("+-+i+-+");") t
instance ensure_hp Int where ensure_hp i t = append ("\tNEED_HEAP("+-+toString i+-+");") t
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment