File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -3068,15 +3068,15 @@ class parser
30683068 -> void
30693069 {
30703070 auto m = std::string{msg};
3071+ auto i = done () ? -1 : 0 ;
3072+ assert (peek (i));
30713073 if (include_curr_token) {
3072- m += std::string (" (at '" ) + curr (). to_string (true ) + " ')" ;
3074+ m += std::string (" (at '" ) + peek (i)-> to_string (true ) + " ')" ;
30733075 }
30743076 if (
30753077 err_pos == source_position{}
3076- && peek (0 )
3077- )
3078- {
3079- err_pos = peek (0 )->position ();
3078+ ) {
3079+ err_pos = peek (i)->position ();
30803080 }
30813081 errors.emplace_back ( err_pos, m, false , fallback );
30823082 }
@@ -5093,7 +5093,8 @@ class parser
50935093
50945094 // If there's no [ [ then this isn't a contract
50955095 if (
5096- curr ().type () != lexeme::LeftBracket
5096+ done ()
5097+ || curr ().type () != lexeme::LeftBracket
50975098 || !peek (1 )
50985099 || peek (1 )->type () != lexeme::LeftBracket
50995100 )
You can’t perform that action at this time.
0 commit comments