...

Text file src/github.com/alecthomas/chroma/lexers/testdata/gdscript.expected

Documentation: github.com/alecthomas/chroma/lexers/testdata

     1[
     2  {"type":"CommentSingle","value":"# a file is a class!"},
     3  {"type":"Text","value":"\n\n"},
     4  {"type":"CommentSingle","value":"# inheritance"},
     5  {"type":"Text","value":"\n\n"},
     6  {"type":"Keyword","value":"extends"},
     7  {"type":"Text","value":" "},
     8  {"type":"Name","value":"BaseClass"},
     9  {"type":"Text","value":"\n\n"},
    10  {"type":"CommentSingle","value":"# member variables"},
    11  {"type":"Text","value":"\n\n"},
    12  {"type":"Keyword","value":"var"},
    13  {"type":"Text","value":" "},
    14  {"type":"Name","value":"a"},
    15  {"type":"Text","value":" "},
    16  {"type":"Operator","value":"="},
    17  {"type":"Text","value":" "},
    18  {"type":"LiteralNumberInteger","value":"5"},
    19  {"type":"Text","value":"\n"},
    20  {"type":"Keyword","value":"var"},
    21  {"type":"Text","value":" "},
    22  {"type":"Name","value":"s"},
    23  {"type":"Text","value":" "},
    24  {"type":"Operator","value":"="},
    25  {"type":"Text","value":" "},
    26  {"type":"LiteralStringDouble","value":"\"Hello\""},
    27  {"type":"Text","value":"\n"},
    28  {"type":"Keyword","value":"var"},
    29  {"type":"Text","value":" "},
    30  {"type":"Name","value":"arr"},
    31  {"type":"Text","value":" "},
    32  {"type":"Operator","value":"="},
    33  {"type":"Text","value":" "},
    34  {"type":"Punctuation","value":"["},
    35  {"type":"LiteralNumberInteger","value":"1"},
    36  {"type":"Punctuation","value":","},
    37  {"type":"Text","value":" "},
    38  {"type":"LiteralNumberInteger","value":"2"},
    39  {"type":"Punctuation","value":","},
    40  {"type":"Text","value":" "},
    41  {"type":"LiteralNumberInteger","value":"3"},
    42  {"type":"Punctuation","value":"]"},
    43  {"type":"Text","value":"\n"},
    44  {"type":"Keyword","value":"var"},
    45  {"type":"Text","value":" "},
    46  {"type":"Name","value":"dict"},
    47  {"type":"Text","value":" "},
    48  {"type":"Operator","value":"="},
    49  {"type":"Text","value":" "},
    50  {"type":"Punctuation","value":"{"},
    51  {"type":"LiteralStringDouble","value":"\"key\""},
    52  {"type":"Punctuation","value":":"},
    53  {"type":"Text","value":" "},
    54  {"type":"LiteralStringDouble","value":"\"value\""},
    55  {"type":"Punctuation","value":","},
    56  {"type":"Text","value":" "},
    57  {"type":"LiteralNumberInteger","value":"2"},
    58  {"type":"Punctuation","value":":"},
    59  {"type":"LiteralNumberInteger","value":"3"},
    60  {"type":"Punctuation","value":"}"},
    61  {"type":"Text","value":"\n\n"},
    62  {"type":"CommentSingle","value":"# constants"},
    63  {"type":"Text","value":"\n\n"},
    64  {"type":"Keyword","value":"const"},
    65  {"type":"Text","value":" "},
    66  {"type":"Name","value":"answer"},
    67  {"type":"Text","value":" "},
    68  {"type":"Operator","value":"="},
    69  {"type":"Text","value":" "},
    70  {"type":"LiteralNumberInteger","value":"42"},
    71  {"type":"Text","value":"\n"},
    72  {"type":"Keyword","value":"const"},
    73  {"type":"Text","value":" "},
    74  {"type":"Name","value":"thename"},
    75  {"type":"Text","value":" "},
    76  {"type":"Operator","value":"="},
    77  {"type":"Text","value":" "},
    78  {"type":"LiteralStringDouble","value":"\"Charly\""},
    79  {"type":"Text","value":"\n\n"},
    80  {"type":"CommentSingle","value":"# enums"},
    81  {"type":"Text","value":"\n\n"},
    82  {"type":"Keyword","value":"enum"},
    83  {"type":"Text","value":" "},
    84  {"type":"Punctuation","value":"{"},
    85  {"type":"Name","value":"UNIT_NEUTRAL"},
    86  {"type":"Punctuation","value":","},
    87  {"type":"Text","value":" "},
    88  {"type":"Name","value":"UNIT_ENEMY"},
    89  {"type":"Punctuation","value":","},
    90  {"type":"Text","value":" "},
    91  {"type":"Name","value":"UNIT_ALLY"},
    92  {"type":"Punctuation","value":"}"},
    93  {"type":"Text","value":"\n"},
    94  {"type":"Keyword","value":"enum"},
    95  {"type":"Text","value":" "},
    96  {"type":"Name","value":"Named"},
    97  {"type":"Text","value":" "},
    98  {"type":"Punctuation","value":"{"},
    99  {"type":"Name","value":"THING_1"},
   100  {"type":"Punctuation","value":","},
   101  {"type":"Text","value":" "},
   102  {"type":"Name","value":"THING_2"},
   103  {"type":"Punctuation","value":","},
   104  {"type":"Text","value":" "},
   105  {"type":"Name","value":"ANOTHER_THING"},
   106  {"type":"Text","value":" "},
   107  {"type":"Operator","value":"="},
   108  {"type":"Text","value":" "},
   109  {"type":"Operator","value":"-"},
   110  {"type":"LiteralNumberInteger","value":"1"},
   111  {"type":"Punctuation","value":"}"},
   112  {"type":"Text","value":"\n\n"},
   113  {"type":"CommentSingle","value":"# function"},
   114  {"type":"Text","value":"\n\n"},
   115  {"type":"Keyword","value":"func"},
   116  {"type":"Text","value":" "},
   117  {"type":"Name","value":"some_function"},
   118  {"type":"Punctuation","value":"("},
   119  {"type":"Name","value":"param1"},
   120  {"type":"Punctuation","value":","},
   121  {"type":"Text","value":" "},
   122  {"type":"Name","value":"param2"},
   123  {"type":"Punctuation","value":"):"},
   124  {"type":"Text","value":"\n    "},
   125  {"type":"Keyword","value":"var"},
   126  {"type":"Text","value":" "},
   127  {"type":"Name","value":"local_var"},
   128  {"type":"Text","value":" "},
   129  {"type":"Operator","value":"="},
   130  {"type":"Text","value":" "},
   131  {"type":"LiteralNumberInteger","value":"5"},
   132  {"type":"Text","value":"\n\n    "},
   133  {"type":"Keyword","value":"if"},
   134  {"type":"Text","value":" "},
   135  {"type":"Name","value":"param1"},
   136  {"type":"Text","value":" "},
   137  {"type":"Operator","value":"\u003c"},
   138  {"type":"Text","value":" "},
   139  {"type":"Name","value":"local_var"},
   140  {"type":"Punctuation","value":":"},
   141  {"type":"Text","value":"\n        "},
   142  {"type":"NameBuiltin","value":"print"},
   143  {"type":"Punctuation","value":"("},
   144  {"type":"Name","value":"param1"},
   145  {"type":"Punctuation","value":")"},
   146  {"type":"Text","value":"\n    "},
   147  {"type":"Keyword","value":"elif"},
   148  {"type":"Text","value":" "},
   149  {"type":"Name","value":"param2"},
   150  {"type":"Text","value":" "},
   151  {"type":"Operator","value":"\u003e"},
   152  {"type":"Text","value":" "},
   153  {"type":"LiteralNumberInteger","value":"5"},
   154  {"type":"Punctuation","value":":"},
   155  {"type":"Text","value":"\n        "},
   156  {"type":"NameBuiltin","value":"print"},
   157  {"type":"Punctuation","value":"("},
   158  {"type":"Name","value":"param2"},
   159  {"type":"Punctuation","value":")"},
   160  {"type":"Text","value":"\n    "},
   161  {"type":"Keyword","value":"else"},
   162  {"type":"Punctuation","value":":"},
   163  {"type":"Text","value":"\n        "},
   164  {"type":"NameBuiltin","value":"print"},
   165  {"type":"Punctuation","value":"("},
   166  {"type":"LiteralStringDouble","value":"\"fail!\""},
   167  {"type":"Punctuation","value":")"},
   168  {"type":"Text","value":"\n\n    "},
   169  {"type":"Keyword","value":"for"},
   170  {"type":"Text","value":" "},
   171  {"type":"Name","value":"i"},
   172  {"type":"Text","value":" "},
   173  {"type":"OperatorWord","value":"in"},
   174  {"type":"Text","value":" "},
   175  {"type":"NameBuiltin","value":"range"},
   176  {"type":"Punctuation","value":"("},
   177  {"type":"LiteralNumberInteger","value":"20"},
   178  {"type":"Punctuation","value":"):"},
   179  {"type":"Text","value":"\n        "},
   180  {"type":"NameBuiltin","value":"print"},
   181  {"type":"Punctuation","value":"("},
   182  {"type":"Name","value":"i"},
   183  {"type":"Punctuation","value":")"},
   184  {"type":"Text","value":"\n\n    "},
   185  {"type":"Keyword","value":"while"},
   186  {"type":"Text","value":" "},
   187  {"type":"Name","value":"param2"},
   188  {"type":"Text","value":" "},
   189  {"type":"Operator","value":"!="},
   190  {"type":"Text","value":" "},
   191  {"type":"LiteralNumberInteger","value":"0"},
   192  {"type":"Punctuation","value":":"},
   193  {"type":"Text","value":"\n        "},
   194  {"type":"Name","value":"param2"},
   195  {"type":"Text","value":" "},
   196  {"type":"Operator","value":"-="},
   197  {"type":"Text","value":" "},
   198  {"type":"LiteralNumberInteger","value":"1"},
   199  {"type":"Text","value":"\n\n    "},
   200  {"type":"Keyword","value":"var"},
   201  {"type":"Text","value":" "},
   202  {"type":"Name","value":"local_var2"},
   203  {"type":"Text","value":" "},
   204  {"type":"Operator","value":"="},
   205  {"type":"Text","value":" "},
   206  {"type":"Name","value":"param1"},
   207  {"type":"Operator","value":"+"},
   208  {"type":"LiteralNumberInteger","value":"3"},
   209  {"type":"Text","value":"\n    "},
   210  {"type":"Keyword","value":"return"},
   211  {"type":"Text","value":" "},
   212  {"type":"Name","value":"local_var2"},
   213  {"type":"Text","value":"\n\n\n"},
   214  {"type":"CommentSingle","value":"# inner class"},
   215  {"type":"Text","value":"\n\n"},
   216  {"type":"Keyword","value":"class"},
   217  {"type":"Text","value":" "},
   218  {"type":"Name","value":"Something"},
   219  {"type":"Punctuation","value":":"},
   220  {"type":"Text","value":"\n    "},
   221  {"type":"Keyword","value":"var"},
   222  {"type":"Text","value":" "},
   223  {"type":"Name","value":"a"},
   224  {"type":"Text","value":" "},
   225  {"type":"Operator","value":"="},
   226  {"type":"Text","value":" "},
   227  {"type":"LiteralNumberInteger","value":"10"},
   228  {"type":"Text","value":"\n\n"},
   229  {"type":"CommentSingle","value":"# constructor"},
   230  {"type":"Text","value":"\n\n"},
   231  {"type":"Keyword","value":"func"},
   232  {"type":"Text","value":" "},
   233  {"type":"Name","value":"_init"},
   234  {"type":"Punctuation","value":"():"},
   235  {"type":"Text","value":"\n    "},
   236  {"type":"NameBuiltin","value":"print"},
   237  {"type":"Punctuation","value":"("},
   238  {"type":"LiteralStringDouble","value":"\"constructed!\""},
   239  {"type":"Punctuation","value":")"},
   240  {"type":"Text","value":"\n    "},
   241  {"type":"Keyword","value":"var"},
   242  {"type":"Text","value":" "},
   243  {"type":"Name","value":"lv"},
   244  {"type":"Text","value":" "},
   245  {"type":"Operator","value":"="},
   246  {"type":"Text","value":" "},
   247  {"type":"Name","value":"Something"},
   248  {"type":"Operator","value":"."},
   249  {"type":"Name","value":"new"},
   250  {"type":"Punctuation","value":"()"},
   251  {"type":"Text","value":"\n    "},
   252  {"type":"NameBuiltin","value":"print"},
   253  {"type":"Punctuation","value":"("},
   254  {"type":"Name","value":"lv"},
   255  {"type":"Operator","value":"."},
   256  {"type":"Name","value":"a"},
   257  {"type":"Punctuation","value":")"}
   258]

View as plain text