Go syntax - many issues

Discuss syntax highlighting or submit new syntax files.
Post Reply
Alextp
Posts: 69
Joined: 23 Aug 2014 23:36

Go syntax - many issues

Post by Alextp »

I checked SublimeText test for Golang, and found many issues

- numbers is many formats - note Go has hex+float, and has _ separator
- {{ }} brackets inside quotes - they can have nested " so you must handle "{{ and }}" special

Code: Select all

    0; 123456789; -0; -123456789; 1777_000_000;
    00; 01234567; -01234567; 0_0; 012_45;
    08; 09; //invalid octals
    0o660; 0O061; -0o02; 0o_660; 0O0_6_1;
    0x0; 0x0123456789ABCDEFabcdef; -0x0123456789ABCDEFabcdef;
    0x_0; 0x012_3456_7_8_9ABCDEFabcd_ef;
    0b1011; 0B00001; -0b1; 0b_1; 0B1_0;
    000.000; 123.456; .0; 1.;
    0_1.0_1; 1_23.4_6;
    -000.000; -123.456; -.0; -1. -1.. ;
    0e+0; 0E+0; 0.0e+0; 0.0E+0; 123.456e+789;
    1_2e+0; 1E+0_1; 0.1_2e2; 1_23.4_56e+78_9;
    0e-0; 0E-0; 0.0e-0; 0.0E-0; 123.456e-789;
    0.e+0; .0e+0; 0.e-0; .0e-0;
    0x1p-2; 0X1P+2; 0x1p2;
    0x_1p-2; 0X1_1P+2; 0x_1p2_1;
    0x1.0P-1021; 0X1.0p-1021;
    0x_1_1.0_7P-1_021;
    0x2.p10; 0x1.Fp+0; 0X.8p-0;
    000i; 100i; -100i; 1_1i;
    123.456i; -123.456i; 1_23.45_6i;
    1e+2i; 1e-2i; 1.2e+3i; 1.2e-3i; 1E+2i; 1E-2i; 1.2E+3i; 1.2E-3i;
    1_1e+2_1i; 1.2_1E-3_5i;
    0o6i; 0O35i; 0o_6i; 0O3_5i;
    0x0i; 0x0123456789ABCDEFabcdefi; 0x_012_CD_Efi;
    0b1011i; 0B00001i; 0b_1011i; 0B000_01i;
    0x1p-2i; 0x1.0P-1021i; 0x1.Fp+0i;
    0x_1p-2i; 0x1_4.0_5P-102_1i;

    t = "{{with $x := "output" | printf "%q"}}{{$x}}{{end}}"
    t = "{{with $x := "output"}}{{$x = "new value"}}{{$x | printf "%q"}}{{end}}"

Post Reply