It's removing a check and adding a loop and presto, you're done! (global variables would be another topic) Here. For those that want to play around with it I've attached a patch. I won't commit this however (aside the fact that it would also need to be added for global variables for consistency).
Presto! ... you're already halfway there... you're not the kind of person that does only half... now you got to finish it.
I work with git-svn, I do many proof-of-concepts and discard them again.
Also just looking at the case for global variables I think: nope, not going to touch that one.
However, I would like to have a clarification on the following general points:
- Does the compiler need to know the type of the variable before the variable name, because it compiles in one step, and as soon as it encounters an error of this specific nature it stops permanently?
It needs to know the type so that it can parse it correctly. E.g. if it's string or integer. Also the syntax for initialized variables already
is Name: Type = Value. Yours would add a second way (cause why shouldn't it work with a single variable?) which is something that should be avoided when designing a language.
- In these cases, there are no exceptions to allow adaptation to alternative Syntax, such as a possible "NewPascal mode"?
- If you decide to adopt a possible "NewPascal mode", would it be possible to reverse the position of the type declaration order with that of a variable name (var integer: a:=0, b:=0;)?
If a language mode is too incompatible we're inclined to say: nope, not going to support that. We need to maintain that after all and each diversion adds to the complexity of the parser.
- Would it be possible to consider a special mode of Lazarus that would convert "alternative" statements to "canonical" FPC?
Not my area.