hsutter / cppfront

A personal experimental C++ Syntax 2 -> Syntax 1 compiler
Other
5.27k stars 225 forks source link

Friendlier error message when user puts semicolon after type definition closing brace #931

Closed bluetarpmedia closed 6 months ago

bluetarpmedia commented 6 months ago

Due to C and C++ habit I occasionally write this:

mytype: type = {

};  // <-- oops

I thought a friendlier error message might be useful for this specific case.

Before this PR:

error: unexpected text at end of Cpp2 code section (at ';')
error: parse failed for section starting here

After this PR:

error: Cpp2 does not allow a semicolon after the closing brace of a type definition
hsutter commented 6 months ago

Thanks!