You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if we can improve this but I hit this syntax error today when writing rspec:
Unmatched keyword, missing `end' ?
2 describe "something" do
> 3 if "does something" do
> 5 end
6 end
/tmp/scratchrb:3: syntax error, unexpected `do', expecting `then' or ';' or '\n' (SyntaxError)
if "does something" do
^~
(I used if instead of it).
Both if and do need an end. I think we could explain this better. In this case the original error says "unexpected do', expecting then' or ';' or '\n'". Perhaps as we're trying to explain the problem we should verify that the syntax error of our captured block matches the syntax error of the document, do something differently.
Generated by this code:
describe "something" do
if "does something" do
print "foo"
end
end
The text was updated successfully, but these errors were encountered:
I don't know if we can improve this but I hit this syntax error today when writing rspec:
(I used
if
instead ofit
).Both
if
anddo
need an end. I think we could explain this better. In this case the original error says "unexpecteddo', expecting
then' or ';' or '\n'". Perhaps as we're trying to explain the problem we should verify that the syntax error of our captured block matches the syntax error of the document, do something differently.Generated by this code:
The text was updated successfully, but these errors were encountered: