praveenvvstgy / crack-language

Automatically exported from code.google.com/p/crack-language
Other
0 stars 0 forks source link

Semicolon at each instruction #88

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
(Enhancement)

Hello.
I think that semicolon should be at the end of each instruction.
Right now, we can omit the semicolon on the last instruction in blocks.

For instance, this code compile and execute:
#!/usr/bin/env crack
import crack.io cout;

cout `Hello World!\n`;

if(true) {
    cout `Hello World!\n`
}
else {
    cout `Hello World!\n`
}

cout `Hello World!\n`

Three semicolons are missing.

I think this is bad because if we extend the block, we are obligated to add the 
semicolon.

Consequently, I think that semicolon should be an obligation, even on the last 
instruction of a block.

An alternative would be to use newlines instead of semicolons (like in Python).

Thanks.

Original issue reported on code.google.com by boua...@gmail.com on 8 Dec 2011 at 10:02

GoogleCodeExporter commented 9 years ago
This is an intentional syntactical normalization.  Semicolons are only 
necessary to separate statements, not to terminate them.

Original comment by mind...@gmail.com on 8 Dec 2011 at 10:16