File tree 1 file changed +7
-6
lines changed 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -3068,15 +3068,15 @@ class parser
3068
3068
-> void
3069
3069
{
3070
3070
auto m = std::string{msg};
3071
+ auto i = done () ? -1 : 0 ;
3072
+ assert (peek (i));
3071
3073
if (include_curr_token) {
3072
- m += std::string (" (at '" ) + curr (). to_string (true ) + " ')" ;
3074
+ m += std::string (" (at '" ) + peek (i)-> to_string (true ) + " ')" ;
3073
3075
}
3074
3076
if (
3075
3077
err_pos == source_position{}
3076
- && peek (0 )
3077
- )
3078
- {
3079
- err_pos = peek (0 )->position ();
3078
+ ) {
3079
+ err_pos = peek (i)->position ();
3080
3080
}
3081
3081
errors.emplace_back ( err_pos, m, false , fallback );
3082
3082
}
@@ -5093,7 +5093,8 @@ class parser
5093
5093
5094
5094
// If there's no [ [ then this isn't a contract
5095
5095
if (
5096
- curr ().type () != lexeme::LeftBracket
5096
+ done ()
5097
+ || curr ().type () != lexeme::LeftBracket
5097
5098
|| !peek (1 )
5098
5099
|| peek (1 )->type () != lexeme::LeftBracket
5099
5100
)
You can’t perform that action at this time.
0 commit comments