...

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

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

     1[
     2  {"type":"CommentSingle","value":";; An example of some possible linters using Fennel's --plugin option."},
     3  {"type":"TextWhitespace","value":"\n\n"},
     4  {"type":"CommentSingle","value":";; The first two linters here can only function on static module"},
     5  {"type":"TextWhitespace","value":"\n"},
     6  {"type":"CommentSingle","value":";; use. For instance, this code can be checked because they use static"},
     7  {"type":"TextWhitespace","value":"\n"},
     8  {"type":"CommentSingle","value":";; field access on a local directly bound to a require call:"},
     9  {"type":"TextWhitespace","value":"\n\n"},
    10  {"type":"CommentSingle","value":";; (local m (require :mymodule))"},
    11  {"type":"TextWhitespace","value":"\n"},
    12  {"type":"CommentSingle","value":";; (print m.field) ; fails if mymodule lacks a :field field"},
    13  {"type":"TextWhitespace","value":"\n"},
    14  {"type":"CommentSingle","value":";; (print (m.function 1 2 3)) ; fails unless mymodule.function takes 3 args"},
    15  {"type":"TextWhitespace","value":"\n\n"},
    16  {"type":"CommentSingle","value":";; However, these cannot:"},
    17  {"type":"TextWhitespace","value":"\n\n"},
    18  {"type":"CommentSingle","value":";; (local m (do (require :mymodule)) ; m is not directly bound"},
    19  {"type":"TextWhitespace","value":"\n"},
    20  {"type":"CommentSingle","value":";; (print (. m field)) ; not a static field reference"},
    21  {"type":"TextWhitespace","value":"\n"},
    22  {"type":"CommentSingle","value":";; (let [f m.function]"},
    23  {"type":"TextWhitespace","value":"\n"},
    24  {"type":"CommentSingle","value":";;   (print (f 1 2 3)) ; intermediate local, not a static field call on m"},
    25  {"type":"TextWhitespace","value":"\n\n"},
    26  {"type":"CommentSingle","value":";; Still, pretty neat, huh?"},
    27  {"type":"TextWhitespace","value":"\n\n"},
    28  {"type":"CommentSingle","value":";; This file is provided as an example and is not part of Fennel's public API."},
    29  {"type":"TextWhitespace","value":"\n\n"},
    30  {"type":"Punctuation","value":"("},
    31  {"type":"KeywordDeclaration","value":"fn "},
    32  {"type":"NameVariable","value":"save-require-meta"},
    33  {"type":"TextWhitespace","value":" "},
    34  {"type":"Punctuation","value":"["},
    35  {"type":"NameVariable","value":"from"},
    36  {"type":"TextWhitespace","value":" "},
    37  {"type":"NameVariable","value":"to"},
    38  {"type":"TextWhitespace","value":" "},
    39  {"type":"NameVariable","value":"scope"},
    40  {"type":"Punctuation","value":"]"},
    41  {"type":"TextWhitespace","value":"\n  "},
    42  {"type":"LiteralString","value":"\"When destructuring, save module name if local is bound to a `require' call.\nDoesn't do any linting on its own; just saves the data for other linters.\""},
    43  {"type":"TextWhitespace","value":"\n  "},
    44  {"type":"Punctuation","value":"("},
    45  {"type":"Keyword","value":"when "},
    46  {"type":"Punctuation","value":"("},
    47  {"type":"Keyword","value":"and "},
    48  {"type":"Punctuation","value":"("},
    49  {"type":"NameFunction","value":"sym?"},
    50  {"type":"TextWhitespace","value":" "},
    51  {"type":"NameVariable","value":"to"},
    52  {"type":"Punctuation","value":")"},
    53  {"type":"TextWhitespace","value":" "},
    54  {"type":"Punctuation","value":"("},
    55  {"type":"Keyword","value":"not "},
    56  {"type":"Punctuation","value":"("},
    57  {"type":"NameFunction","value":"multi-sym?"},
    58  {"type":"TextWhitespace","value":" "},
    59  {"type":"NameVariable","value":"to"},
    60  {"type":"Punctuation","value":"))"},
    61  {"type":"TextWhitespace","value":" "},
    62  {"type":"Punctuation","value":"("},
    63  {"type":"NameFunction","value":"list?"},
    64  {"type":"TextWhitespace","value":" "},
    65  {"type":"NameVariable","value":"from"},
    66  {"type":"Punctuation","value":")"},
    67  {"type":"TextWhitespace","value":"\n             "},
    68  {"type":"Punctuation","value":"("},
    69  {"type":"NameFunction","value":"sym?"},
    70  {"type":"TextWhitespace","value":" "},
    71  {"type":"Punctuation","value":"("},
    72  {"type":"Keyword","value":". "},
    73  {"type":"NameVariable","value":"from"},
    74  {"type":"TextWhitespace","value":" "},
    75  {"type":"LiteralNumberInteger","value":"1"},
    76  {"type":"Punctuation","value":"))"},
    77  {"type":"TextWhitespace","value":" "},
    78  {"type":"Punctuation","value":"("},
    79  {"type":"Keyword","value":"= "},
    80  {"type":"LiteralStringSymbol","value":":require"},
    81  {"type":"TextWhitespace","value":" "},
    82  {"type":"Punctuation","value":"("},
    83  {"type":"NameBuiltin","value":"tostring "},
    84  {"type":"Punctuation","value":"("},
    85  {"type":"Keyword","value":". "},
    86  {"type":"NameVariable","value":"from"},
    87  {"type":"TextWhitespace","value":" "},
    88  {"type":"LiteralNumberInteger","value":"1"},
    89  {"type":"Punctuation","value":")))"},
    90  {"type":"TextWhitespace","value":"\n             "},
    91  {"type":"Punctuation","value":"("},
    92  {"type":"Keyword","value":"= "},
    93  {"type":"LiteralStringSymbol","value":":string"},
    94  {"type":"TextWhitespace","value":" "},
    95  {"type":"Punctuation","value":"("},
    96  {"type":"NameBuiltin","value":"type "},
    97  {"type":"Punctuation","value":"("},
    98  {"type":"Keyword","value":". "},
    99  {"type":"NameVariable","value":"from"},
   100  {"type":"TextWhitespace","value":" "},
   101  {"type":"LiteralNumberInteger","value":"2"},
   102  {"type":"Punctuation","value":"))))"},
   103  {"type":"TextWhitespace","value":"\n    "},
   104  {"type":"Punctuation","value":"("},
   105  {"type":"Keyword","value":"let "},
   106  {"type":"Punctuation","value":"["},
   107  {"type":"NameVariable","value":"meta"},
   108  {"type":"TextWhitespace","value":" "},
   109  {"type":"Punctuation","value":"("},
   110  {"type":"Keyword","value":". "},
   111  {"type":"NameVariable","value":"scope.symmeta"},
   112  {"type":"TextWhitespace","value":" "},
   113  {"type":"Punctuation","value":"("},
   114  {"type":"NameBuiltin","value":"tostring "},
   115  {"type":"NameVariable","value":"to"},
   116  {"type":"Punctuation","value":"))]"},
   117  {"type":"TextWhitespace","value":"\n      "},
   118  {"type":"Punctuation","value":"("},
   119  {"type":"Keyword","value":"set "},
   120  {"type":"NameVariable","value":"meta.required"},
   121  {"type":"TextWhitespace","value":" "},
   122  {"type":"Punctuation","value":"("},
   123  {"type":"NameBuiltin","value":"tostring "},
   124  {"type":"Punctuation","value":"("},
   125  {"type":"Keyword","value":". "},
   126  {"type":"NameVariable","value":"from"},
   127  {"type":"TextWhitespace","value":" "},
   128  {"type":"LiteralNumberInteger","value":"2"},
   129  {"type":"Punctuation","value":"))))))"},
   130  {"type":"TextWhitespace","value":"\n\n"},
   131  {"type":"Punctuation","value":"("},
   132  {"type":"KeywordDeclaration","value":"fn "},
   133  {"type":"NameVariable","value":"check-module-fields"},
   134  {"type":"TextWhitespace","value":" "},
   135  {"type":"Punctuation","value":"["},
   136  {"type":"NameVariable","value":"symbol"},
   137  {"type":"TextWhitespace","value":" "},
   138  {"type":"NameVariable","value":"scope"},
   139  {"type":"Punctuation","value":"]"},
   140  {"type":"TextWhitespace","value":"\n  "},
   141  {"type":"LiteralString","value":"\"When referring to a field in a local that's a module, make sure it exists.\""},
   142  {"type":"TextWhitespace","value":"\n  "},
   143  {"type":"Punctuation","value":"("},
   144  {"type":"Keyword","value":"let "},
   145  {"type":"Punctuation","value":"[["},
   146  {"type":"NameVariable","value":"module-local"},
   147  {"type":"TextWhitespace","value":" "},
   148  {"type":"NameVariable","value":"field"},
   149  {"type":"Punctuation","value":"]"},
   150  {"type":"TextWhitespace","value":" "},
   151  {"type":"Punctuation","value":"("},
   152  {"type":"Keyword","value":"or "},
   153  {"type":"Punctuation","value":"("},
   154  {"type":"NameFunction","value":"multi-sym?"},
   155  {"type":"TextWhitespace","value":" "},
   156  {"type":"NameVariable","value":"symbol"},
   157  {"type":"Punctuation","value":")"},
   158  {"type":"TextWhitespace","value":" "},
   159  {"type":"Punctuation","value":"[])"},
   160  {"type":"TextWhitespace","value":"\n        "},
   161  {"type":"NameVariable","value":"module-name"},
   162  {"type":"TextWhitespace","value":" "},
   163  {"type":"Punctuation","value":"("},
   164  {"type":"Keyword","value":"-?\u003e "},
   165  {"type":"NameVariable","value":"scope.symmeta"},
   166  {"type":"TextWhitespace","value":" "},
   167  {"type":"Punctuation","value":"("},
   168  {"type":"Keyword","value":". "},
   169  {"type":"Punctuation","value":"("},
   170  {"type":"NameBuiltin","value":"tostring "},
   171  {"type":"NameVariable","value":"module-local"},
   172  {"type":"Punctuation","value":"))"},
   173  {"type":"TextWhitespace","value":" "},
   174  {"type":"Punctuation","value":"("},
   175  {"type":"Keyword","value":". "},
   176  {"type":"LiteralStringSymbol","value":":required"},
   177  {"type":"Punctuation","value":"))"},
   178  {"type":"TextWhitespace","value":"\n        "},
   179  {"type":"NameBuiltin","value":"module "},
   180  {"type":"Punctuation","value":"("},
   181  {"type":"Keyword","value":"and "},
   182  {"type":"NameVariable","value":"module-name"},
   183  {"type":"TextWhitespace","value":" "},
   184  {"type":"Punctuation","value":"("},
   185  {"type":"NameBuiltin","value":"require "},
   186  {"type":"NameVariable","value":"module-name"},
   187  {"type":"Punctuation","value":"))]"},
   188  {"type":"TextWhitespace","value":"\n    "},
   189  {"type":"Punctuation","value":"("},
   190  {"type":"NameFunction","value":"assert-compile"},
   191  {"type":"TextWhitespace","value":" "},
   192  {"type":"Punctuation","value":"("},
   193  {"type":"Keyword","value":"or "},
   194  {"type":"Punctuation","value":"("},
   195  {"type":"Keyword","value":"= "},
   196  {"type":"NameBuiltin","value":"module "},
   197  {"type":"NameVariable","value":"nil"},
   198  {"type":"Punctuation","value":")"},
   199  {"type":"TextWhitespace","value":" "},
   200  {"type":"Punctuation","value":"("},
   201  {"type":"Keyword","value":"not= "},
   202  {"type":"Punctuation","value":"("},
   203  {"type":"Keyword","value":". "},
   204  {"type":"NameBuiltin","value":"module "},
   205  {"type":"NameVariable","value":"field"},
   206  {"type":"Punctuation","value":")"},
   207  {"type":"TextWhitespace","value":" "},
   208  {"type":"NameVariable","value":"nil"},
   209  {"type":"Punctuation","value":"))"},
   210  {"type":"TextWhitespace","value":"\n                    "},
   211  {"type":"Punctuation","value":"("},
   212  {"type":"NameBuiltin","value":"string.format "},
   213  {"type":"LiteralString","value":"\"Missing field %s in module %s\""},
   214  {"type":"TextWhitespace","value":"\n                                   "},
   215  {"type":"Punctuation","value":"("},
   216  {"type":"Keyword","value":"or "},
   217  {"type":"NameVariable","value":"field"},
   218  {"type":"TextWhitespace","value":" "},
   219  {"type":"LiteralStringSymbol","value":":?"},
   220  {"type":"Punctuation","value":")"},
   221  {"type":"TextWhitespace","value":" "},
   222  {"type":"Punctuation","value":"("},
   223  {"type":"Keyword","value":"or "},
   224  {"type":"NameVariable","value":"module-name"},
   225  {"type":"TextWhitespace","value":" "},
   226  {"type":"LiteralStringSymbol","value":":?"},
   227  {"type":"Punctuation","value":"))"},
   228  {"type":"TextWhitespace","value":" "},
   229  {"type":"NameVariable","value":"symbol"},
   230  {"type":"Punctuation","value":")))"},
   231  {"type":"TextWhitespace","value":"\n\n"},
   232  {"type":"Punctuation","value":"("},
   233  {"type":"KeywordDeclaration","value":"fn "},
   234  {"type":"NameVariable","value":"arity-check?"},
   235  {"type":"TextWhitespace","value":" "},
   236  {"type":"Punctuation","value":"["},
   237  {"type":"NameVariable","value":"module"},
   238  {"type":"Punctuation","value":"]"},
   239  {"type":"TextWhitespace","value":" "},
   240  {"type":"Punctuation","value":"("},
   241  {"type":"Keyword","value":"-?\u003e "},
   242  {"type":"NameBuiltin","value":"module getmetatable "},
   243  {"type":"Punctuation","value":"("},
   244  {"type":"Keyword","value":". "},
   245  {"type":"LiteralStringSymbol","value":":arity-check?"},
   246  {"type":"Punctuation","value":")))"},
   247  {"type":"TextWhitespace","value":"\n\n"},
   248  {"type":"Punctuation","value":"("},
   249  {"type":"KeywordDeclaration","value":"fn "},
   250  {"type":"NameVariable","value":"arity-check-call"},
   251  {"type":"TextWhitespace","value":" "},
   252  {"type":"Punctuation","value":"[["},
   253  {"type":"NameVariable","value":"f"},
   254  {"type":"TextWhitespace","value":" "},
   255  {"type":"Operator","value":"\u0026"},
   256  {"type":"TextWhitespace","value":" "},
   257  {"type":"NameVariable","value":"args"},
   258  {"type":"Punctuation","value":"]"},
   259  {"type":"TextWhitespace","value":" "},
   260  {"type":"NameVariable","value":"scope"},
   261  {"type":"Punctuation","value":"]"},
   262  {"type":"TextWhitespace","value":"\n  "},
   263  {"type":"LiteralString","value":"\"Perform static arity checks on static function calls in a module.\""},
   264  {"type":"TextWhitespace","value":"\n  "},
   265  {"type":"Punctuation","value":"("},
   266  {"type":"Keyword","value":"let "},
   267  {"type":"Punctuation","value":"["},
   268  {"type":"NameVariable","value":"arity"},
   269  {"type":"TextWhitespace","value":" "},
   270  {"type":"Punctuation","value":"("},
   271  {"type":"Operator","value":"#"},
   272  {"type":"TextWhitespace","value":" "},
   273  {"type":"NameVariable","value":"args"},
   274  {"type":"Punctuation","value":")"},
   275  {"type":"TextWhitespace","value":"\n        "},
   276  {"type":"NameVariable","value":"last-arg"},
   277  {"type":"TextWhitespace","value":" "},
   278  {"type":"Punctuation","value":"("},
   279  {"type":"Keyword","value":". "},
   280  {"type":"NameVariable","value":"args"},
   281  {"type":"TextWhitespace","value":" "},
   282  {"type":"NameVariable","value":"arity"},
   283  {"type":"Punctuation","value":")"},
   284  {"type":"TextWhitespace","value":"\n        "},
   285  {"type":"Punctuation","value":"["},
   286  {"type":"NameVariable","value":"f-local"},
   287  {"type":"TextWhitespace","value":" "},
   288  {"type":"NameVariable","value":"field"},
   289  {"type":"Punctuation","value":"]"},
   290  {"type":"TextWhitespace","value":" "},
   291  {"type":"Punctuation","value":"("},
   292  {"type":"Keyword","value":"or "},
   293  {"type":"Punctuation","value":"("},
   294  {"type":"NameFunction","value":"multi-sym?"},
   295  {"type":"TextWhitespace","value":" "},
   296  {"type":"NameVariable","value":"f"},
   297  {"type":"Punctuation","value":")"},
   298  {"type":"TextWhitespace","value":" "},
   299  {"type":"Punctuation","value":"[])"},
   300  {"type":"TextWhitespace","value":"\n        "},
   301  {"type":"NameVariable","value":"module-name"},
   302  {"type":"TextWhitespace","value":" "},
   303  {"type":"Punctuation","value":"("},
   304  {"type":"Keyword","value":"-?\u003e "},
   305  {"type":"NameVariable","value":"scope.symmeta"},
   306  {"type":"TextWhitespace","value":" "},
   307  {"type":"Punctuation","value":"("},
   308  {"type":"Keyword","value":". "},
   309  {"type":"Punctuation","value":"("},
   310  {"type":"NameBuiltin","value":"tostring "},
   311  {"type":"NameVariable","value":"f-local"},
   312  {"type":"Punctuation","value":"))"},
   313  {"type":"TextWhitespace","value":" "},
   314  {"type":"Punctuation","value":"("},
   315  {"type":"Keyword","value":". "},
   316  {"type":"LiteralStringSymbol","value":":required"},
   317  {"type":"Punctuation","value":"))"},
   318  {"type":"TextWhitespace","value":"\n        "},
   319  {"type":"NameBuiltin","value":"module "},
   320  {"type":"Punctuation","value":"("},
   321  {"type":"Keyword","value":"and "},
   322  {"type":"NameVariable","value":"module-name"},
   323  {"type":"TextWhitespace","value":" "},
   324  {"type":"Punctuation","value":"("},
   325  {"type":"NameBuiltin","value":"require "},
   326  {"type":"NameVariable","value":"module-name"},
   327  {"type":"Punctuation","value":"))]"},
   328  {"type":"TextWhitespace","value":"\n    "},
   329  {"type":"Punctuation","value":"("},
   330  {"type":"Keyword","value":"when "},
   331  {"type":"Punctuation","value":"("},
   332  {"type":"Keyword","value":"and "},
   333  {"type":"Punctuation","value":"("},
   334  {"type":"NameFunction","value":"arity-check?"},
   335  {"type":"TextWhitespace","value":" "},
   336  {"type":"NameVariable","value":"module"},
   337  {"type":"Punctuation","value":")"},
   338  {"type":"TextWhitespace","value":" "},
   339  {"type":"NameVariable","value":"_G.debug"},
   340  {"type":"TextWhitespace","value":" "},
   341  {"type":"NameVariable","value":"_G.debug.getinfo"},
   342  {"type":"TextWhitespace","value":"\n               "},
   343  {"type":"Punctuation","value":"("},
   344  {"type":"Keyword","value":"not "},
   345  {"type":"Punctuation","value":"("},
   346  {"type":"NameFunction","value":"varg?"},
   347  {"type":"TextWhitespace","value":" "},
   348  {"type":"NameVariable","value":"last-arg"},
   349  {"type":"Punctuation","value":"))"},
   350  {"type":"TextWhitespace","value":" "},
   351  {"type":"Punctuation","value":"("},
   352  {"type":"Keyword","value":"not "},
   353  {"type":"Punctuation","value":"("},
   354  {"type":"NameFunction","value":"list?"},
   355  {"type":"TextWhitespace","value":" "},
   356  {"type":"NameVariable","value":"last-arg"},
   357  {"type":"Punctuation","value":")))"},
   358  {"type":"TextWhitespace","value":"\n      "},
   359  {"type":"Punctuation","value":"("},
   360  {"type":"NameFunction","value":"assert-compile"},
   361  {"type":"TextWhitespace","value":" "},
   362  {"type":"Punctuation","value":"("},
   363  {"type":"Keyword","value":"= "},
   364  {"type":"Punctuation","value":"("},
   365  {"type":"NameBuiltin","value":"type "},
   366  {"type":"Punctuation","value":"("},
   367  {"type":"Keyword","value":". "},
   368  {"type":"NameBuiltin","value":"module "},
   369  {"type":"NameVariable","value":"field"},
   370  {"type":"Punctuation","value":"))"},
   371  {"type":"TextWhitespace","value":" "},
   372  {"type":"LiteralStringSymbol","value":":function"},
   373  {"type":"Punctuation","value":")"},
   374  {"type":"TextWhitespace","value":"\n                      "},
   375  {"type":"Punctuation","value":"("},
   376  {"type":"NameBuiltin","value":"string.format "},
   377  {"type":"LiteralString","value":"\"Missing function %s in module %s\""},
   378  {"type":"TextWhitespace","value":"\n                                     "},
   379  {"type":"Punctuation","value":"("},
   380  {"type":"Keyword","value":"or "},
   381  {"type":"NameVariable","value":"field"},
   382  {"type":"TextWhitespace","value":" "},
   383  {"type":"LiteralStringSymbol","value":":?"},
   384  {"type":"Punctuation","value":")"},
   385  {"type":"TextWhitespace","value":" "},
   386  {"type":"NameVariable","value":"module-name"},
   387  {"type":"Punctuation","value":")"},
   388  {"type":"TextWhitespace","value":" "},
   389  {"type":"NameVariable","value":"f"},
   390  {"type":"Punctuation","value":")"},
   391  {"type":"TextWhitespace","value":"\n      "},
   392  {"type":"Punctuation","value":"("},
   393  {"type":"Keyword","value":"match "},
   394  {"type":"Punctuation","value":"("},
   395  {"type":"NameFunction","value":"_G.debug.getinfo"},
   396  {"type":"TextWhitespace","value":" "},
   397  {"type":"Punctuation","value":"("},
   398  {"type":"Keyword","value":". "},
   399  {"type":"NameBuiltin","value":"module "},
   400  {"type":"NameVariable","value":"field"},
   401  {"type":"Punctuation","value":"))"},
   402  {"type":"TextWhitespace","value":"\n        "},
   403  {"type":"Punctuation","value":"{"},
   404  {"type":"Keyword","value":": "},
   405  {"type":"NameVariable","value":"nparams"},
   406  {"type":"TextWhitespace","value":" "},
   407  {"type":"LiteralStringSymbol","value":":what"},
   408  {"type":"TextWhitespace","value":" "},
   409  {"type":"LiteralString","value":"\"Lua\""},
   410  {"type":"TextWhitespace","value":" "},
   411  {"type":"LiteralStringSymbol","value":":isvararg"},
   412  {"type":"TextWhitespace","value":" "},
   413  {"type":"NameVariable","value":"true"},
   414  {"type":"Punctuation","value":"}"},
   415  {"type":"TextWhitespace","value":"\n        "},
   416  {"type":"Punctuation","value":"("},
   417  {"type":"NameFunction","value":"assert-compile"},
   418  {"type":"TextWhitespace","value":" "},
   419  {"type":"Punctuation","value":"("},
   420  {"type":"Keyword","value":"\u003c= "},
   421  {"type":"NameVariable","value":"nparams"},
   422  {"type":"TextWhitespace","value":" "},
   423  {"type":"Punctuation","value":"("},
   424  {"type":"Operator","value":"#"},
   425  {"type":"TextWhitespace","value":" "},
   426  {"type":"NameVariable","value":"args"},
   427  {"type":"Punctuation","value":"))"},
   428  {"type":"TextWhitespace","value":"\n                        "},
   429  {"type":"Punctuation","value":"("},
   430  {"type":"Keyword","value":": "},
   431  {"type":"LiteralString","value":"\"Called %s.%s with %s arguments, expected %s+\""},
   432  {"type":"TextWhitespace","value":"\n                           "},
   433  {"type":"LiteralStringSymbol","value":":format"},
   434  {"type":"TextWhitespace","value":" "},
   435  {"type":"NameVariable","value":"f-local"},
   436  {"type":"TextWhitespace","value":" "},
   437  {"type":"NameVariable","value":"field"},
   438  {"type":"TextWhitespace","value":" "},
   439  {"type":"NameVariable","value":"arity"},
   440  {"type":"TextWhitespace","value":" "},
   441  {"type":"NameVariable","value":"nparams"},
   442  {"type":"Punctuation","value":")"},
   443  {"type":"TextWhitespace","value":" "},
   444  {"type":"NameVariable","value":"f"},
   445  {"type":"Punctuation","value":")"},
   446  {"type":"TextWhitespace","value":"\n        "},
   447  {"type":"Punctuation","value":"{"},
   448  {"type":"Keyword","value":": "},
   449  {"type":"NameVariable","value":"nparams"},
   450  {"type":"TextWhitespace","value":" "},
   451  {"type":"LiteralStringSymbol","value":":what"},
   452  {"type":"TextWhitespace","value":" "},
   453  {"type":"LiteralString","value":"\"Lua\""},
   454  {"type":"TextWhitespace","value":" "},
   455  {"type":"LiteralStringSymbol","value":":isvararg"},
   456  {"type":"TextWhitespace","value":" "},
   457  {"type":"NameVariable","value":"false"},
   458  {"type":"Punctuation","value":"}"},
   459  {"type":"TextWhitespace","value":"\n        "},
   460  {"type":"Punctuation","value":"("},
   461  {"type":"NameFunction","value":"assert-compile"},
   462  {"type":"TextWhitespace","value":" "},
   463  {"type":"Punctuation","value":"("},
   464  {"type":"Keyword","value":"= "},
   465  {"type":"NameVariable","value":"nparams"},
   466  {"type":"TextWhitespace","value":" "},
   467  {"type":"Punctuation","value":"("},
   468  {"type":"Operator","value":"#"},
   469  {"type":"TextWhitespace","value":" "},
   470  {"type":"NameVariable","value":"args"},
   471  {"type":"Punctuation","value":"))"},
   472  {"type":"TextWhitespace","value":"\n                        "},
   473  {"type":"Punctuation","value":"("},
   474  {"type":"Keyword","value":": "},
   475  {"type":"LiteralString","value":"\"Called %s.%s with %s arguments, expected %s\""},
   476  {"type":"TextWhitespace","value":"\n                           "},
   477  {"type":"LiteralStringSymbol","value":":format"},
   478  {"type":"TextWhitespace","value":" "},
   479  {"type":"NameVariable","value":"f-local"},
   480  {"type":"TextWhitespace","value":" "},
   481  {"type":"NameVariable","value":"field"},
   482  {"type":"TextWhitespace","value":" "},
   483  {"type":"NameVariable","value":"arity"},
   484  {"type":"TextWhitespace","value":" "},
   485  {"type":"NameVariable","value":"nparams"},
   486  {"type":"Punctuation","value":")"},
   487  {"type":"TextWhitespace","value":" "},
   488  {"type":"NameVariable","value":"f"},
   489  {"type":"Punctuation","value":")))))"},
   490  {"type":"TextWhitespace","value":"\n\n"},
   491  {"type":"Punctuation","value":"("},
   492  {"type":"KeywordDeclaration","value":"fn "},
   493  {"type":"NameVariable","value":"check-unused"},
   494  {"type":"TextWhitespace","value":" "},
   495  {"type":"Punctuation","value":"["},
   496  {"type":"NameVariable","value":"ast"},
   497  {"type":"TextWhitespace","value":" "},
   498  {"type":"NameVariable","value":"scope"},
   499  {"type":"Punctuation","value":"]"},
   500  {"type":"TextWhitespace","value":"\n  "},
   501  {"type":"Punctuation","value":"("},
   502  {"type":"Keyword","value":"each "},
   503  {"type":"Punctuation","value":"["},
   504  {"type":"NameVariable","value":"symname"},
   505  {"type":"TextWhitespace","value":" "},
   506  {"type":"Punctuation","value":"("},
   507  {"type":"NameBuiltin","value":"pairs "},
   508  {"type":"NameVariable","value":"scope.symmeta"},
   509  {"type":"Punctuation","value":")]"},
   510  {"type":"TextWhitespace","value":"\n    "},
   511  {"type":"Punctuation","value":"("},
   512  {"type":"NameFunction","value":"assert-compile"},
   513  {"type":"TextWhitespace","value":" "},
   514  {"type":"Punctuation","value":"("},
   515  {"type":"Keyword","value":"or "},
   516  {"type":"Punctuation","value":"("},
   517  {"type":"Keyword","value":". "},
   518  {"type":"NameVariable","value":"scope.symmeta"},
   519  {"type":"TextWhitespace","value":" "},
   520  {"type":"NameVariable","value":"symname"},
   521  {"type":"TextWhitespace","value":" "},
   522  {"type":"LiteralStringSymbol","value":":used"},
   523  {"type":"Punctuation","value":")"},
   524  {"type":"TextWhitespace","value":" "},
   525  {"type":"Punctuation","value":"("},
   526  {"type":"NameFunction","value":"symname"},
   527  {"type":"LiteralStringSymbol","value":":find"},
   528  {"type":"TextWhitespace","value":" "},
   529  {"type":"LiteralString","value":"\"^_\""},
   530  {"type":"Punctuation","value":"))"},
   531  {"type":"TextWhitespace","value":"\n                    "},
   532  {"type":"Punctuation","value":"("},
   533  {"type":"NameBuiltin","value":"string.format "},
   534  {"type":"LiteralString","value":"\"unused local %s\""},
   535  {"type":"TextWhitespace","value":" "},
   536  {"type":"Punctuation","value":"("},
   537  {"type":"Keyword","value":"or "},
   538  {"type":"NameVariable","value":"symname"},
   539  {"type":"TextWhitespace","value":" "},
   540  {"type":"LiteralStringSymbol","value":":?"},
   541  {"type":"Punctuation","value":"))"},
   542  {"type":"TextWhitespace","value":" "},
   543  {"type":"NameVariable","value":"ast"},
   544  {"type":"Punctuation","value":")))"},
   545  {"type":"TextWhitespace","value":"\n\n"},
   546  {"type":"Punctuation","value":"{"},
   547  {"type":"LiteralStringSymbol","value":":destructure"},
   548  {"type":"TextWhitespace","value":" "},
   549  {"type":"NameVariable","value":"save-require-meta"},
   550  {"type":"TextWhitespace","value":"\n "},
   551  {"type":"LiteralStringSymbol","value":":symbol-to-expression"},
   552  {"type":"TextWhitespace","value":" "},
   553  {"type":"NameVariable","value":"check-module-fields"},
   554  {"type":"TextWhitespace","value":"\n "},
   555  {"type":"LiteralStringSymbol","value":":call"},
   556  {"type":"TextWhitespace","value":" "},
   557  {"type":"NameVariable","value":"arity-check-call"},
   558  {"type":"TextWhitespace","value":"\n "},
   559  {"type":"CommentSingle","value":";; Note that this will only check unused args inside functions and let blocks,"},
   560  {"type":"TextWhitespace","value":"\n "},
   561  {"type":"CommentSingle","value":";; not top-level locals of a chunk."},
   562  {"type":"TextWhitespace","value":"\n "},
   563  {"type":"LiteralStringSymbol","value":":fn"},
   564  {"type":"TextWhitespace","value":" "},
   565  {"type":"NameVariable","value":"check-unused"},
   566  {"type":"TextWhitespace","value":"\n "},
   567  {"type":"LiteralStringSymbol","value":":do"},
   568  {"type":"TextWhitespace","value":" "},
   569  {"type":"NameVariable","value":"check-unused"},
   570  {"type":"Punctuation","value":"}"},
   571  {"type":"TextWhitespace","value":"\n"}
   572]

View as plain text