macro processor: remove unnecessary type specifiers

issue#70
Houtan Bastani 2020-02-04 10:36:55 +01:00
parent ee972d9638
commit 6284e991fc
No known key found for this signature in database
GPG Key ID: 000094FB955BE169
3 changed files with 11 additions and 11 deletions

View File

@ -75,7 +75,7 @@ Include::interpret(ostream &output, bool no_line_macro, vector<filesystem::path>
// Calling `string()` method on filename and filename.stem() because of bug in // Calling `string()` method on filename and filename.stem() because of bug in
// MinGW 8.3.0 that ignores implicit conversion to string from filename::path. // MinGW 8.3.0 that ignores implicit conversion to string from filename::path.
// Test if bug exists when version of MinGW is upgraded on Debian runners // Test if bug exists when version of MinGW is upgraded on Debian runners
m.parse(filename.string(), filename.stem().string(), incfile, output, false, vector<pair<string, string>>{}, paths); m.parse(filename.string(), filename.stem().string(), incfile, output, false, {}, paths);
} }
catch (StackTrace &ex) catch (StackTrace &ex)
{ {

View File

@ -37,7 +37,7 @@ Driver::parse(const string &file_arg, const string &basename_arg, istream &modfi
command_line_defines_with_endl << "@#define " << var << " = " << val << endl; command_line_defines_with_endl << "@#define " << var << " = " << val << endl;
Driver m(env, true); Driver m(env, true);
istream is(command_line_defines_with_endl.rdbuf()); istream is(command_line_defines_with_endl.rdbuf());
m.parse("command_line_defines", "command_line_defines", is, output, debug, vector<pair<string, string>>{}, paths); m.parse("command_line_defines", "command_line_defines", is, output, debug, {}, paths);
} }
// Handle empty files // Handle empty files

View File

@ -154,7 +154,7 @@ directive_one_line : INCLUDE expr
; ;
name_list : NAME name_list : NAME
{ $$ = vector<string>{$1}; } { $$ = {$1}; }
| name_list NAME | name_list NAME
{ {
$1.emplace_back($2); $1.emplace_back($2);
@ -229,13 +229,13 @@ if_list1 : expr EOL
{ {
auto context = driver.popContext(); auto context = driver.popContext();
context.emplace_back(make_shared<TextNode>("\n", driver.env, @2)); context.emplace_back(make_shared<TextNode>("\n", driver.env, @2));
$$ = vector<pair<ExpressionPtr, vector<DirectivePtr>>> {{$1, context}}; $$ = {{$1, context}};
} }
| expr EOL statements | expr EOL statements
{ {
auto context = driver.popContext(); auto context = driver.popContext();
context.emplace_back(make_shared<TextNode>("\n", driver.env, @3)); context.emplace_back(make_shared<TextNode>("\n", driver.env, @3));
$$ = vector<pair<ExpressionPtr, vector<DirectivePtr>>> {{$1, context}}; $$ = {{$1, context}};
} }
| if_list1 elseif | if_list1 elseif
{ {
@ -297,25 +297,25 @@ function : NAME LPAREN RPAREN
; ;
function_args : symbol function_args : symbol
{ $$ = vector<ExpressionPtr>{$1}; } { $$ = {$1}; }
| function_args COMMA symbol | function_args COMMA symbol
{ $1.emplace_back($3); $$ = $1; } { $1.emplace_back($3); $$ = $1; }
; ;
comma_expr : %empty comma_expr : %empty
{ $$ = vector<ExpressionPtr>{}; } { $$ = {}; }
| expr | expr
{ $$ = vector<ExpressionPtr>{$1}; } { $$ = {$1}; }
| comma_expr COMMA expr | comma_expr COMMA expr
{ $1.emplace_back($3); $$ = $1; } { $1.emplace_back($3); $$ = $1; }
; ;
tuple_comma_expr : %empty tuple_comma_expr : %empty
{ $$ = vector<ExpressionPtr>{}; } { $$ = {}; }
| expr COMMA | expr COMMA
{ $$ = vector<ExpressionPtr>{$1}; } { $$ = {$1}; }
| expr COMMA expr | expr COMMA expr
{ $$ = vector<ExpressionPtr>{$1, $3}; } { $$ = {$1, $3}; }
| tuple_comma_expr COMMA expr | tuple_comma_expr COMMA expr
{ $1.emplace_back($3); $$ = $1; } { $1.emplace_back($3); $$ = $1; }
; ;