diff --git a/lexers/f/fennel.go b/lexers/f/fennel.go index 3f97f7231..23134d4eb 100644 --- a/lexers/f/fennel.go +++ b/lexers/f/fennel.go @@ -44,6 +44,7 @@ func fennelRules() Rules { return Rules{ "root": { {`;.*$`, CommentSingle, nil}, + {`\s+`, Whitespace, nil}, {`-?\d+\.\d+`, LiteralNumberFloat, nil}, {`-?\d+`, LiteralNumberInteger, nil}, {`0x-?[abcdef\d]+`, LiteralNumberHex, nil}, diff --git a/lexers/testdata/fennel.expected b/lexers/testdata/fennel.expected index ea677a2c0..1c31bb4f8 100644 --- a/lexers/testdata/fennel.expected +++ b/lexers/testdata/fennel.expected @@ -1,194 +1,194 @@ [ {"type":"CommentSingle","value":";; An example of some possible linters using Fennel's --plugin option."}, - {"type":"Error","value":"\n\n"}, + {"type":"TextWhitespace","value":"\n\n"}, {"type":"CommentSingle","value":";; The first two linters here can only function on static module"}, - {"type":"Error","value":"\n"}, + {"type":"TextWhitespace","value":"\n"}, {"type":"CommentSingle","value":";; use. For instance, this code can be checked because they use static"}, - {"type":"Error","value":"\n"}, + {"type":"TextWhitespace","value":"\n"}, {"type":"CommentSingle","value":";; field access on a local directly bound to a require call:"}, - {"type":"Error","value":"\n\n"}, + {"type":"TextWhitespace","value":"\n\n"}, {"type":"CommentSingle","value":";; (local m (require :mymodule))"}, - {"type":"Error","value":"\n"}, + {"type":"TextWhitespace","value":"\n"}, {"type":"CommentSingle","value":";; (print m.field) ; fails if mymodule lacks a :field field"}, - {"type":"Error","value":"\n"}, + {"type":"TextWhitespace","value":"\n"}, {"type":"CommentSingle","value":";; (print (m.function 1 2 3)) ; fails unless mymodule.function takes 3 args"}, - {"type":"Error","value":"\n\n"}, + {"type":"TextWhitespace","value":"\n\n"}, {"type":"CommentSingle","value":";; However, these cannot:"}, - {"type":"Error","value":"\n\n"}, + {"type":"TextWhitespace","value":"\n\n"}, {"type":"CommentSingle","value":";; (local m (do (require :mymodule)) ; m is not directly bound"}, - {"type":"Error","value":"\n"}, + {"type":"TextWhitespace","value":"\n"}, {"type":"CommentSingle","value":";; (print (. m field)) ; not a static field reference"}, - {"type":"Error","value":"\n"}, + {"type":"TextWhitespace","value":"\n"}, {"type":"CommentSingle","value":";; (let [f m.function]"}, - {"type":"Error","value":"\n"}, + {"type":"TextWhitespace","value":"\n"}, {"type":"CommentSingle","value":";; (print (f 1 2 3)) ; intermediate local, not a static field call on m"}, - {"type":"Error","value":"\n\n"}, + {"type":"TextWhitespace","value":"\n\n"}, {"type":"CommentSingle","value":";; Still, pretty neat, huh?"}, - {"type":"Error","value":"\n\n"}, + {"type":"TextWhitespace","value":"\n\n"}, {"type":"CommentSingle","value":";; This file is provided as an example and is not part of Fennel's public API."}, - {"type":"Error","value":"\n\n"}, + {"type":"TextWhitespace","value":"\n\n"}, {"type":"Punctuation","value":"("}, {"type":"KeywordDeclaration","value":"fn "}, {"type":"NameVariable","value":"save-require-meta"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"["}, {"type":"NameVariable","value":"from"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"to"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"scope"}, {"type":"Punctuation","value":"]"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"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.\""}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"when "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"and "}, {"type":"Punctuation","value":"("}, {"type":"NameFunction","value":"sym?"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"to"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"not "}, {"type":"Punctuation","value":"("}, {"type":"NameFunction","value":"multi-sym?"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"to"}, {"type":"Punctuation","value":"))"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"NameFunction","value":"list?"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"from"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"NameFunction","value":"sym?"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":". "}, {"type":"NameVariable","value":"from"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralNumberInteger","value":"1"}, {"type":"Punctuation","value":"))"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"= "}, {"type":"LiteralStringSymbol","value":":require"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"NameBuiltin","value":"tostring "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":". "}, {"type":"NameVariable","value":"from"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralNumberInteger","value":"1"}, {"type":"Punctuation","value":")))"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"= "}, {"type":"LiteralStringSymbol","value":":string"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"NameBuiltin","value":"type "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":". "}, {"type":"NameVariable","value":"from"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralNumberInteger","value":"2"}, {"type":"Punctuation","value":"))))"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"let "}, {"type":"Punctuation","value":"["}, {"type":"NameVariable","value":"meta"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":". "}, {"type":"NameVariable","value":"scope.symmeta"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"NameBuiltin","value":"tostring "}, {"type":"NameVariable","value":"to"}, {"type":"Punctuation","value":"))]"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"set "}, {"type":"NameVariable","value":"meta.required"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"NameBuiltin","value":"tostring "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":". "}, {"type":"NameVariable","value":"from"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralNumberInteger","value":"2"}, {"type":"Punctuation","value":"))))))"}, - {"type":"Error","value":"\n\n"}, + {"type":"TextWhitespace","value":"\n\n"}, {"type":"Punctuation","value":"("}, {"type":"KeywordDeclaration","value":"fn "}, {"type":"NameVariable","value":"check-module-fields"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"["}, {"type":"NameVariable","value":"symbol"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"scope"}, {"type":"Punctuation","value":"]"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"LiteralString","value":"\"When referring to a field in a local that's a module, make sure it exists.\""}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"let "}, {"type":"Punctuation","value":"[["}, {"type":"NameVariable","value":"module-local"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"field"}, {"type":"Punctuation","value":"]"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"or "}, {"type":"Punctuation","value":"("}, {"type":"NameFunction","value":"multi-sym?"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"symbol"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"[])"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"NameVariable","value":"module-name"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"-?\u003e "}, {"type":"NameVariable","value":"scope.symmeta"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":". "}, {"type":"Punctuation","value":"("}, {"type":"NameBuiltin","value":"tostring "}, {"type":"NameVariable","value":"module-local"}, {"type":"Punctuation","value":"))"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":". "}, {"type":"LiteralStringSymbol","value":":required"}, {"type":"Punctuation","value":"))"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"NameBuiltin","value":"module "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"and "}, {"type":"NameVariable","value":"module-name"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"NameBuiltin","value":"require "}, {"type":"NameVariable","value":"module-name"}, {"type":"Punctuation","value":"))]"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"NameFunction","value":"assert-compile"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"or "}, {"type":"Punctuation","value":"("}, @@ -196,7 +196,7 @@ {"type":"NameBuiltin","value":"module "}, {"type":"NameVariable","value":"nil"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"not= "}, {"type":"Punctuation","value":"("}, @@ -204,39 +204,39 @@ {"type":"NameBuiltin","value":"module "}, {"type":"NameVariable","value":"field"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"nil"}, {"type":"Punctuation","value":"))"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"NameBuiltin","value":"string.format "}, {"type":"LiteralString","value":"\"Missing field %s in module %s\""}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"or "}, {"type":"NameVariable","value":"field"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralStringSymbol","value":":?"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"or "}, {"type":"NameVariable","value":"module-name"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralStringSymbol","value":":?"}, {"type":"Punctuation","value":"))"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"symbol"}, {"type":"Punctuation","value":")))"}, - {"type":"Error","value":"\n\n"}, + {"type":"TextWhitespace","value":"\n\n"}, {"type":"Punctuation","value":"("}, {"type":"KeywordDeclaration","value":"fn "}, {"type":"NameVariable","value":"arity-check?"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"["}, {"type":"NameVariable","value":"module"}, {"type":"Punctuation","value":"]"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"-?\u003e "}, {"type":"NameBuiltin","value":"module getmetatable "}, @@ -244,121 +244,121 @@ {"type":"Keyword","value":". "}, {"type":"LiteralStringSymbol","value":":arity-check?"}, {"type":"Punctuation","value":")))"}, - {"type":"Error","value":"\n\n"}, + {"type":"TextWhitespace","value":"\n\n"}, {"type":"Punctuation","value":"("}, {"type":"KeywordDeclaration","value":"fn "}, {"type":"NameVariable","value":"arity-check-call"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"[["}, {"type":"NameVariable","value":"f"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Operator","value":"\u0026"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"args"}, {"type":"Punctuation","value":"]"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"scope"}, {"type":"Punctuation","value":"]"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"LiteralString","value":"\"Perform static arity checks on static function calls in a module.\""}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"let "}, {"type":"Punctuation","value":"["}, {"type":"NameVariable","value":"arity"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Operator","value":"#"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"args"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"NameVariable","value":"last-arg"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":". "}, {"type":"NameVariable","value":"args"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"arity"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"["}, {"type":"NameVariable","value":"f-local"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"field"}, {"type":"Punctuation","value":"]"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"or "}, {"type":"Punctuation","value":"("}, {"type":"NameFunction","value":"multi-sym?"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"f"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"[])"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"NameVariable","value":"module-name"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"-?\u003e "}, {"type":"NameVariable","value":"scope.symmeta"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":". "}, {"type":"Punctuation","value":"("}, {"type":"NameBuiltin","value":"tostring "}, {"type":"NameVariable","value":"f-local"}, {"type":"Punctuation","value":"))"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":". "}, {"type":"LiteralStringSymbol","value":":required"}, {"type":"Punctuation","value":"))"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"NameBuiltin","value":"module "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"and "}, {"type":"NameVariable","value":"module-name"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"NameBuiltin","value":"require "}, {"type":"NameVariable","value":"module-name"}, {"type":"Punctuation","value":"))]"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"when "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"and "}, {"type":"Punctuation","value":"("}, {"type":"NameFunction","value":"arity-check?"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"module"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"_G.debug"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"_G.debug.getinfo"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"not "}, {"type":"Punctuation","value":"("}, {"type":"NameFunction","value":"varg?"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"last-arg"}, {"type":"Punctuation","value":"))"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"not "}, {"type":"Punctuation","value":"("}, {"type":"NameFunction","value":"list?"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"last-arg"}, {"type":"Punctuation","value":")))"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"NameFunction","value":"assert-compile"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"= "}, {"type":"Punctuation","value":"("}, @@ -368,205 +368,205 @@ {"type":"NameBuiltin","value":"module "}, {"type":"NameVariable","value":"field"}, {"type":"Punctuation","value":"))"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralStringSymbol","value":":function"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"NameBuiltin","value":"string.format "}, {"type":"LiteralString","value":"\"Missing function %s in module %s\""}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"or "}, {"type":"NameVariable","value":"field"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralStringSymbol","value":":?"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"module-name"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"f"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"match "}, {"type":"Punctuation","value":"("}, {"type":"NameFunction","value":"_G.debug.getinfo"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":". "}, {"type":"NameBuiltin","value":"module "}, {"type":"NameVariable","value":"field"}, {"type":"Punctuation","value":"))"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"{"}, {"type":"Keyword","value":": "}, {"type":"NameVariable","value":"nparams"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralStringSymbol","value":":what"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralString","value":"\"Lua\""}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralStringSymbol","value":":isvararg"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"true"}, {"type":"Punctuation","value":"}"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"NameFunction","value":"assert-compile"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"\u003c= "}, {"type":"NameVariable","value":"nparams"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Operator","value":"#"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"args"}, {"type":"Punctuation","value":"))"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":": "}, {"type":"LiteralString","value":"\"Called %s.%s with %s arguments, expected %s+\""}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"LiteralStringSymbol","value":":format"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"f-local"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"field"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"arity"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"nparams"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"f"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"{"}, {"type":"Keyword","value":": "}, {"type":"NameVariable","value":"nparams"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralStringSymbol","value":":what"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralString","value":"\"Lua\""}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralStringSymbol","value":":isvararg"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"false"}, {"type":"Punctuation","value":"}"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"NameFunction","value":"assert-compile"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"= "}, {"type":"NameVariable","value":"nparams"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Operator","value":"#"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"args"}, {"type":"Punctuation","value":"))"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":": "}, {"type":"LiteralString","value":"\"Called %s.%s with %s arguments, expected %s\""}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"LiteralStringSymbol","value":":format"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"f-local"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"field"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"arity"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"nparams"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"f"}, {"type":"Punctuation","value":")))))"}, - {"type":"Error","value":"\n\n"}, + {"type":"TextWhitespace","value":"\n\n"}, {"type":"Punctuation","value":"("}, {"type":"KeywordDeclaration","value":"fn "}, {"type":"NameVariable","value":"check-unused"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"["}, {"type":"NameVariable","value":"ast"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"scope"}, {"type":"Punctuation","value":"]"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"each "}, {"type":"Punctuation","value":"["}, {"type":"NameVariable","value":"symname"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"NameBuiltin","value":"pairs "}, {"type":"NameVariable","value":"scope.symmeta"}, {"type":"Punctuation","value":")]"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"NameFunction","value":"assert-compile"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"or "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":". "}, {"type":"NameVariable","value":"scope.symmeta"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"symname"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralStringSymbol","value":":used"}, {"type":"Punctuation","value":")"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"NameFunction","value":"symname"}, {"type":"LiteralStringSymbol","value":":find"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralString","value":"\"^_\""}, {"type":"Punctuation","value":"))"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"Punctuation","value":"("}, {"type":"NameBuiltin","value":"string.format "}, {"type":"LiteralString","value":"\"unused local %s\""}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"Punctuation","value":"("}, {"type":"Keyword","value":"or "}, {"type":"NameVariable","value":"symname"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"LiteralStringSymbol","value":":?"}, {"type":"Punctuation","value":"))"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"ast"}, {"type":"Punctuation","value":")))"}, - {"type":"Error","value":"\n\n"}, + {"type":"TextWhitespace","value":"\n\n"}, {"type":"Punctuation","value":"{"}, {"type":"LiteralStringSymbol","value":":destructure"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"save-require-meta"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"LiteralStringSymbol","value":":symbol-to-expression"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"check-module-fields"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"LiteralStringSymbol","value":":call"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"arity-check-call"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"CommentSingle","value":";; Note that this will only check unused args inside functions and let blocks,"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"CommentSingle","value":";; not top-level locals of a chunk."}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"LiteralStringSymbol","value":":fn"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"check-unused"}, - {"type":"Error","value":"\n "}, + {"type":"TextWhitespace","value":"\n "}, {"type":"LiteralStringSymbol","value":":do"}, - {"type":"Error","value":" "}, + {"type":"TextWhitespace","value":" "}, {"type":"NameVariable","value":"check-unused"}, {"type":"Punctuation","value":"}"}, - {"type":"Error","value":"\n"} + {"type":"TextWhitespace","value":"\n"} ]