lectures.alex.balgavy.eu

Lecture notes from university.
git clone git://git.alex.balgavy.eu/lectures.alex.balgavy.eu.git
Log | Files | Refs | Submodules

syntax_test_tsx.tsx (1404B)


      1 // SYNTAX TEST "Packages/JavaScript/TSX.sublime-syntax"
      2 
      3     <foo />;
      4 //  ^^^^^^^ meta.jsx meta.tag
      5 //  ^ punctuation.definition.tag.begin
      6 //   ^^^ meta.tag.name entity.name.tag
      7 //       ^^ punctuation.definition.tag.end
      8 
      9     type x < T = Foo > = any;
     10 //  ^^^^^^^^^^^^^^^^^^^^^^^^ meta.type-alias
     11 //  ^^^^ storage.type
     12 //       ^ entity.name.type
     13 //         ^^^^^^^^^^^ meta.generic
     14 //         ^ punctuation.definition.generic.begin
     15 //           ^ variable.parameter.generic
     16 //             ^ keyword.operator.assignment
     17 //               ^^^ support.class
     18 //                   ^ punctuation.definition.generic.end
     19 //                     ^ keyword.operator.assignment
     20 //                       ^^^ meta.type-alias support.type.any
     21 
     22 let x : T.U<V>;
     23 //      ^^^^^^ meta.type
     24 //      ^ support.class
     25 //       ^ punctuation.accessor
     26 //        ^ support.class
     27 //         ^^^ meta.generic
     28 //          ^ support.class
     29 
     30 // This is invalid TSX as the TypeScript type assertion is parsed as a JSX tag
     31 let strLength: number = (<string>someValue).length; // </string> );
     32 //                       ^^^^^^^^ meta.tag - meta.assertion
     33 //                                                     ^^^^^^^^^ meta.tag - comment
     34 
     35 var foo = 1 << 0;
     36 //          ^^ keyword.operator.bitwise
     37 
     38 if (a < b || c <= d) {}
     39 //    ^ keyword.operator.comparison
     40 //        ^^ keyword.operator.logical
     41 //             ^^ keyword.operator.comparison