Who Commenting on your Adverts
Mar 02

Learning from others about semi-colons :)

Groovy, Tech Add comments

Mark Igra is looking to others to help make decisions and learn:

The term semicolon insertion informally refers to the ability to write programs while omitting semicolons between statements. In both ECMAScript 3 and ECMAScript 4 there are two kinds of semicolon insertion:

Grammatical Semicolon Insertion
Semicolons before a closing } and the end of the program are optional in both ECMAScript 3 and 2.0. In addition, the ECMAScript 4 parser allows semicolons to be omitted before the else of an if-else statement and before the while of a do-while statement.

Line-Break Semicolon Insertion
If the first through the nth tokens of an ECMAScript program form are grammatically valid but the first through the n+1st tokens are not and there is a line break between the nth tokens and the n+1st tokens, then the parser tries to parse the program again after inserting a VirtualSemicolon token between the nth and the n+1st tokens.

Grammatical semicolon insertion is implemented directly by the syntactic grammar’s productions, which simply do not require a semicolon in the aforementioned cases. Line breaks in the source code are not relevant to grammatical semicolon insertion.

Line-break semicolon insertion cannot be easily implemented in the syntactic grammar. This kind of semicolon insertion turns a syntactically incorrect program into a correct program and relies on line breaks in the source code.

After working in languages that don’t require;
putting semi colons;
at the end;
of;
statement;
It is nice to have the option to not have too;

As long as:

a) it is implementable
b) it doesn’t cause other horrible things to happen in the language just to make it implementable.

NOTE: I can understand reasons why you may like semi colons (history, java, periods in language). This is one of those personal feel things for me.

3 Responses to “Learning from others about semi-colons :)”

  1. kuper Says:

    CZESC CHCIAL BYM DZIWKE ZAMUWIC CHCE SIE DOWJEDZIEC CENY NA CZERWIEC NAJLEPIEJ BL

  2. tomek Says:

    czesc
    co robisz co robisz chce sie stobą um

  3. pocket pc movie downloads Says:

    Hello, nice site look this:
    Village, The
    Meltdown
    Interpreter, The

Leave a Reply

Spam is a pain, I am sorry to have to do this to you, but can you answer the question below?

Q: What is the number before 3? (just put in the digit)