diff --git a/scripts/token_abbrevs.py b/scripts/token_abbrevs.py index e8b7f11..bfb54d9 100644 --- a/scripts/token_abbrevs.py +++ b/scripts/token_abbrevs.py @@ -1,24 +1,46 @@ import sys import string +import glob -# Run it as grep token lexers/* | python scripts/token_abbrevs.py - +tokens = {"Highlight"} +abbrevs = {"Highlight": "hl"} def abbr(line): return "".join(c for c in line if c in string.ascii_uppercase).lower() -abbrevs = {} -tokens = {"Highlight"} -for line in sys.stdin: - if " "{v}",') print("}") diff --git a/src/constants.cr b/src/constants.cr index cc3f14e..04e9a6d 100644 --- a/src/constants.cr +++ b/src/constants.cr @@ -1,93 +1,100 @@ module Tartrazine Abbreviations = { - "Background" => "b", - "Highlight" => "h", + "Highlight" => "hl", + "NameTag" => "nt", + "NameBuiltin" => "nb", + "NameVariable" => "nv", + "Comment" => "c", + "Keyword" => "k", + "Error" => "e", "Text" => "t", "CommentSingle" => "cs", + "CommentMultiline" => "cm", "CommentSpecial" => "cs", - "NameVariable" => "nv", - "Keyword" => "k", - "NameFunction" => "nf", - "Punctuation" => "p", + "LiteralString" => "ls", + "LiteralStringSymbol" => "lss", "Operator" => "o", "LiteralNumberInteger" => "lni", - "NameBuiltin" => "nb", - "Name" => "n", - "OperatorWord" => "ow", - "LiteralStringSingle" => "lss", - "Literal" => "l", - "NameClass" => "nc", - "CommentMultiline" => "cm", - "LiteralStringRegex" => "lsr", - "KeywordDeclaration" => "kd", - "KeywordConstant" => "kc", - "NameOther" => "no", - "LiteralNumberFloat" => "lnf", - "LiteralNumberHex" => "lnh", - "LiteralStringDouble" => "lsd", - "KeywordType" => "kt", - "NameNamespace" => "nn", - "NameAttribute" => "na", - "KeywordReserved" => "kr", - "CommentPreproc" => "cp", - "KeywordNamespace" => "kn", - "NameConstant" => "nc", - "NameLabel" => "nl", - "LiteralString" => "ls", - "LiteralStringChar" => "lsc", - "TextWhitespace" => "tw", - "LiteralStringEscape" => "lse", "LiteralNumber" => "ln", - "Other" => "o", - "LiteralStringBoolean" => "lsb", - "NameProperty" => "np", - "Comment" => "c", - "NameTag" => "nt", - "LiteralStringOther" => "lso", - "NameVariableGlobal" => "nvg", - "NameBuiltinPseudo" => "nbp", + "LiteralNumberFloat" => "lnf", + "LiteralStringChar" => "lsc", + "LiteralOther" => "lo", + "NameFunction" => "nf", "LiteralNumberBin" => "lnb", + "LiteralNumberOct" => "lno", + "LiteralNumberHex" => "lnh", + "Punctuation" => "p", + "CommentPreproc" => "cp", + "NameConstant" => "nc", + "NameVariableGlobal" => "nvg", + "LiteralStringOther" => "lso", + "LiteralStringHeredoc" => "lsh", + "LiteralStringInterpol" => "lsi", + "LiteralStringEscape" => "lse", + "OperatorWord" => "ow", + "KeywordDeclaration" => "kd", + "KeywordNamespace" => "kn", + "NamePseudo" => "np", + "NameAttribute" => "na", + "Name" => "n", + "NameClass" => "nc", + "NameEntity" => "ne", + "LiteralStringDouble" => "lsd", + "LiteralStringSingle" => "lss", + "TextWhitespace" => "tw", + "LiteralStringDoc" => "lsd", + "KeywordReserved" => "kr", + "KeywordConstant" => "kc", "KeywordPseudo" => "kp", + "KeywordType" => "kt", + "NameDecorator" => "nd", + "NameLabel" => "nl", + "NameNamespace" => "nn", + "NameOperator" => "no", "CommentPreprocFile" => "cpf", "LiteralStringAffix" => "lsa", - "LiteralStringDelimiter" => "lsd", - "LiteralNumberOct" => "lno", - "Error" => "e", - "Generic" => "g", - "LiteralNumberIntegerLong" => "lnil", - "NameDecorator" => "nd", - "LiteralStringInterpol" => "lsi", + "NameOther" => "no", "LiteralStringBacktick" => "lsb", - "GenericPrompt" => "gp", - "GenericOutput" => "go", - "LiteralStringName" => "lsn", - "LiteralStringHeredoc" => "lsh", - "LiteralStringSymbol" => "lss", - "NameVariableInstance" => "nvi", - "LiteralOther" => "lo", - "NameVariableClass" => "nvc", - "NameOperator" => "no", - "None" => "n", - "LiteralStringDoc" => "lsd", - "NameException" => "ne", + "LiteralStringRegex" => "lsr", + "NameProperty" => "np", + "Other" => "o", + "Generic" => "g", + "GenericEmph" => "ge", + "GenericError" => "ge", + "LiteralNumberIntegerLong" => "lnil", "GenericSubheading" => "gs", + "GenericHeading" => "gh", + "TextPunctuation" => "tp", + "CommentHashbang" => "ch", + "NameVariableAnonymous" => "nva", + "NameBuiltinPseudo" => "nbp", + "Literal" => "l", + "LiteralStringDelimiter" => "lsd", + "NameException" => "ne", + "NameFunctionMagic" => "nfm", + "NameVariableMagic" => "nvm", + "NameVariableInstance" => "nvi", + "LiteralDate" => "ld", "GenericStrong" => "gs", "GenericDeleted" => "gd", - "GenericInserted" => "gi", - "GenericHeading" => "gh", - "NameEntity" => "ne", - "NamePseudo" => "np", - "CommentHashbang" => "ch", - "TextPunctuation" => "tp", - "NameVariableAnonymous" => "nva", - "NameVariableMagic" => "nvm", - "NameFunctionMagic" => "nfm", - "GenericEmph" => "ge", "GenericUnderline" => "gu", - "LiteralStringAtom" => "lsa", - "LiteralDate" => "ld", - "GenericError" => "ge", - "TextSymbol" => "ts", + "LiteralStringName" => "lsn", "NameKeyword" => "nk", + "GenericInserted" => "gi", + "None" => "n", + "NameVariableClass" => "nvc", + "LiteralStringBoolean" => "lsb", + "LiteralStringAtom" => "lsa", + "TextSymbol" => "ts", + "GenericPrompt" => "gp", + "GenericOutput" => "go", + "Background" => "b", + "CodeLine" => "cl", + "LineTableTD" => "lttd", + "LineTable" => "lt", + "LineHighlight" => "lh", + "LineNumbersTable" => "lnt", + "LineNumbers" => "ln", + "GenericTraceback" => "gt", } end