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 was surprised when writing some bebop schemas that:
import "./example.bop";
struct Test {
string Field;
}
... did not compile -- Expected Enum or Struct or Message or Union or Service, but found ';' of kind Semicolon.
And
import "./example.bop"
struct Test {
string Field
}
Also did not compile -- Expected Semicolon, but found '}' of kind CloseBrace
The rules are, in one way, consistent -- top level definitions do not use semicolons and field definitions do use semicolons -- but why care? Why enforce the use of semicolons at all? It's been demonstrated by compilers in the past (Javascript + Typescript)(Go) that you can remove the need for semicolons as above entirely by injecting a semicolon if they are required and not provided.
An additional point of inconsistency: based on the theoretical rule I stated above, this should compile, as it is a top level statement:
const bool boolconst = true
But we get: Expected Semicolon, but found '' of kind EndOfFile
Were bebop to remove the need for semicolons but still support their presence, it would be a backwards compatible change, and formatters could automatically remove all of them (or place them where they are allowed, if that's your preferred style).
The text was updated successfully, but these errors were encountered:
@lynn I don't think this is technically a bug, but I do agree with @200sc, when I started writing bebop for the first time the semicolons confused me a bit. I could see making them optional since (correct me if I am wrong) there is no case where we actually need it.
I was surprised when writing some bebop schemas that:
... did not compile --
Expected Enum or Struct or Message or Union or Service, but found ';' of kind Semicolon.
And
Also did not compile --
Expected Semicolon, but found '}' of kind CloseBrace
The rules are, in one way, consistent -- top level definitions do not use semicolons and field definitions do use semicolons -- but why care? Why enforce the use of semicolons at all? It's been demonstrated by compilers in the past (Javascript + Typescript)(Go) that you can remove the need for semicolons as above entirely by injecting a semicolon if they are required and not provided.
An additional point of inconsistency: based on the theoretical rule I stated above, this should compile, as it is a top level statement:
But we get:
Expected Semicolon, but found '' of kind EndOfFile
Were bebop to remove the need for semicolons but still support their presence, it would be a backwards compatible change, and formatters could automatically remove all of them (or place them where they are allowed, if that's your preferred style).
The text was updated successfully, but these errors were encountered: