04.01.2013, 19:49
Today I learned you can have (almost) arbitrary placed numeric placeholders(they are skipped while parsing though):
All of these are valid:
And as a added bonus, here's (pseudo) yacc grammar for these:
All of these are valid:
Code:
0b_10_1 0x_1DEAD 1_3_4_5 1_2.1_e-4
Code:
digit: [0-9] hex: [a-fA-f0-9] boolean: 0b[01_]+ integer: {digit}({digit}|_)* hexadec: ({digit}|(0x)?)({hex} | '_')* float: {digit}({digit} | '_')*\.{digit}({digit} | '_')*(e(-)?{digit}*)?