Skip to content
Snippets Groups Projects
Unverified Commit ea5348c9 authored by thorstenhater's avatar thorstenhater Committed by GitHub
Browse files

Make if/else statements case insensitive. (#1041)

parent b09ba9c7
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,9 @@ static Keyword keywords[] = {
{"METHOD", tok::method},
{"STEADYSTATE", tok::steadystate},
{"if", tok::if_stmt},
{"IF", tok::if_stmt},
{"else", tok::else_stmt},
{"ELSE", tok::else_stmt},
{"cnexp", tok::cnexp},
{"sparse", tok::sparse},
{"min", tok::min},
......
......@@ -280,6 +280,19 @@ TEST(Parser, parse_if) {
EXPECT_NE(s->false_branch(), nullptr);
}
EXPECT_TRUE(check_parse(s, &Parser::parse_if,
" IF(a<b) { \n"
" a = 2+b \n"
" } ELSE { \n"
" a = 2+b \n"
" } "
));
if (s) {
EXPECT_NE(s->condition()->is_binary(), nullptr);
EXPECT_NE(s->true_branch()->is_block(), nullptr);
EXPECT_NE(s->false_branch(), nullptr);
}
EXPECT_TRUE(check_parse(s, &Parser::parse_if,
" if(fabs(a-b)) { \n"
" a = 2+b \n"
......
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