';; A pretty-printer that outputs tables in Fennel syntax.' Comment.Single '\n' Text ';; Loosely based on inspect.lua: http://github.com/kikito/inspect.lua' Comment.Single '\n\n' Text '(' Punctuation 'fn ' Keyword 'view-quote' Name.Variable ' ' Text '[' Punctuation 'str' Name.Variable ']' Punctuation ' ' Text '(' Punctuation '.. ' Keyword '"\\""' Literal.String ' ' Text '(' Punctuation ': ' Keyword 'str' Name.Variable ' ' Text ':gsub' Literal.String.Symbol ' ' Text '"\\""' Literal.String ' ' Text '"\\\\\\""' Literal.String ')' Punctuation ' ' Text '"\\""' Literal.String ')' Punctuation ')' Punctuation '\n\n' Text '(' Punctuation 'local ' Keyword 'short-control-char-escapes' Name.Variable '\n ' Text '{' Punctuation '"\\a"' Literal.String ' ' Text '"\\\\a"' Literal.String ' ' Text '"\\b"' Literal.String ' ' Text '"\\\\b"' Literal.String ' ' Text '"\\f"' Literal.String ' ' Text '"\\\\f"' Literal.String ' ' Text '"\\n"' Literal.String ' ' Text '"\\\\n"' Literal.String '\n ' Text '"\\r"' Literal.String ' ' Text '"\\\\r"' Literal.String ' ' Text '"\\t"' Literal.String ' ' Text '"\\\\t"' Literal.String ' ' Text '"\\v"' Literal.String ' ' Text '"\\\\v"' Literal.String '}' Punctuation ')' Punctuation '\n\n' Text '(' Punctuation 'local ' Keyword 'long-control-char-escapes' Name.Variable '\n ' Text '(' Punctuation 'let ' Keyword '[' Punctuation 'long' Name.Variable ' ' Text '{' Punctuation '}' Punctuation ']' Punctuation '\n ' Text '(' Punctuation 'for ' Keyword '[' Punctuation 'i' Name.Variable ' ' Text '0' Literal.Number.Integer ' ' Text '31' Literal.Number.Integer ']' Punctuation '\n ' Text '(' Punctuation 'let ' Keyword '[' Punctuation 'ch' Name.Variable ' ' Text '(' Punctuation 'string.char' Name.Variable ' ' Text 'i' Name.Variable ')' Punctuation ']' Punctuation '\n ' Text '(' Punctuation 'when ' Keyword '(' Punctuation 'not ' Keyword '(' Punctuation '. ' Keyword 'short-control-char-escapes' Name.Variable ' ' Text 'ch' Name.Variable ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'tset ' Keyword 'short-control-char-escapes' Name.Variable ' ' Text 'ch' Name.Variable ' ' Text '(' Punctuation '.. ' Keyword '"\\\\"' Literal.String ' ' Text 'i' Name.Variable ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'tset ' Keyword 'long' Name.Variable ' ' Text 'ch' Name.Variable ' ' Text '(' Punctuation ': ' Keyword '"\\\\%03d"' Literal.String ' ' Text ':format' Literal.String.Symbol ' ' Text 'i' Name.Variable ')' Punctuation ')' Punctuation ')' Punctuation ')' Punctuation ')' Punctuation '\n ' Text 'long' Name.Variable ')' Punctuation ')' Punctuation '\n\n' Text '(' Punctuation 'fn ' Keyword 'escape' Name.Variable ' ' Text '[' Punctuation 'str' Name.Variable ']' Punctuation '\n ' Text '(' Punctuation '-> ' Keyword 'str' Name.Variable '\n ' Text '(' Punctuation ': ' Keyword ':gsub' Literal.String.Symbol ' ' Text '"\\\\"' Literal.String ' ' Text '"\\\\\\\\"' Literal.String ')' Punctuation '\n ' Text '(' Punctuation ': ' Keyword ':gsub' Literal.String.Symbol ' ' Text '"(%c)%f[0-9]"' Literal.String ' ' Text 'long-control-char-escapes' Name.Variable ')' Punctuation '\n ' Text '(' Punctuation ': ' Keyword ':gsub' Literal.String.Symbol ' ' Text '"%c"' Literal.String ' ' Text 'short-control-char-escapes' Name.Variable ')' Punctuation ')' Punctuation ')' Punctuation '\n\n' Text '(' Punctuation 'fn ' Keyword 'sequence-key?' Name.Variable ' ' Text '[' Punctuation 'k' Name.Variable ' ' Text 'len' Name.Variable ']' Punctuation '\n ' Text '(' Punctuation 'and ' Keyword '(' Punctuation '= ' Keyword '(' Punctuation 'type ' Name.Builtin 'k' Name.Variable ')' Punctuation ' ' Text '"number"' Literal.String ')' Punctuation '\n ' Text '(' Punctuation '<= ' Keyword '1' Literal.Number.Integer ' ' Text 'k' Name.Variable ')' Punctuation '\n ' Text '(' Punctuation '<= ' Keyword 'k' Name.Variable ' ' Text 'len' Name.Variable ')' Punctuation '\n ' Text '(' Punctuation '= ' Keyword '(' Punctuation 'math.floor' Name.Variable ' ' Text 'k' Name.Variable ')' Punctuation ' ' Text 'k' Name.Variable ')' Punctuation ')' Punctuation ')' Punctuation '\n\n' Text '(' Punctuation 'local ' Keyword 'type-order' Name.Variable ' ' Text '{' Punctuation ':number' Literal.String.Symbol ' ' Text '1' Literal.Number.Integer ' ' Text ':boolean' Literal.String.Symbol ' ' Text '2' Literal.Number.Integer ' ' Text ':string' Literal.String.Symbol ' ' Text '3' Literal.Number.Integer ' ' Text ':table' Literal.String.Symbol ' ' Text '4' Literal.Number.Integer '\n ' Text ':function' Literal.String.Symbol ' ' Text '5' Literal.Number.Integer ' ' Text ':userdata' Literal.String.Symbol ' ' Text '6' Literal.Number.Integer ' ' Text ':thread' Literal.String.Symbol ' ' Text '7' Literal.Number.Integer '}' Punctuation ')' Punctuation '\n\n' Text '(' Punctuation 'fn ' Keyword 'sort-keys' Name.Variable ' ' Text '[' Punctuation 'a' Name.Variable ' ' Text 'b' Name.Variable ']' Punctuation '\n ' Text '(' Punctuation 'let ' Keyword '[' Punctuation 'ta' Name.Variable ' ' Text '(' Punctuation 'type ' Name.Builtin 'a' Name.Variable ')' Punctuation ' ' Text 'tb' Name.Variable ' ' Text '(' Punctuation 'type ' Name.Builtin 'b' Name.Variable ')' Punctuation ']' Punctuation '\n ' Text '(' Punctuation 'if ' Keyword '(' Punctuation 'and ' Keyword '(' Punctuation '= ' Keyword 'ta' Name.Variable ' ' Text 'tb' Name.Variable ')' Punctuation '\n ' Text '(' Punctuation 'or ' Keyword '(' Punctuation '= ' Keyword 'ta' Name.Variable ' ' Text '"string"' Literal.String ')' Punctuation ' ' Text '(' Punctuation '= ' Keyword 'ta' Name.Variable ' ' Text '"number"' Literal.String ')' Punctuation ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation '< ' Keyword 'a' Name.Variable ' ' Text 'b' Name.Variable ')' Punctuation '\n ' Text '(' Punctuation 'let ' Keyword '[' Punctuation 'dta' Name.Variable ' ' Text '(' Punctuation '. ' Keyword 'type-order' Name.Variable ' ' Text 'a' Name.Variable ')' Punctuation '\n ' Text 'dtb' Name.Variable ' ' Text '(' Punctuation '. ' Keyword 'type-order' Name.Variable ' ' Text 'b' Name.Variable ')' Punctuation ']' Punctuation '\n ' Text '(' Punctuation 'if ' Keyword '(' Punctuation 'and ' Keyword 'dta' Name.Variable ' ' Text 'dtb' Name.Variable ')' Punctuation '\n ' Text '(' Punctuation '< ' Keyword 'dta' Name.Variable ' ' Text 'dtb' Name.Variable ')' Punctuation '\n ' Text 'dta' Name.Variable ' ' Text 'true' Name.Variable '\n ' Text 'dtb' Name.Variable ' ' Text 'false' Name.Variable '\n ' Text ':else' Literal.String.Symbol ' ' Text '(' Punctuation '< ' Keyword 'ta' Name.Variable ' ' Text 'tb' Name.Variable ')' Punctuation ')' Punctuation ')' Punctuation ')' Punctuation ')' Punctuation ')' Punctuation '\n\n' Text '(' Punctuation 'fn ' Keyword 'get-sequence-length' Name.Variable ' ' Text '[' Punctuation 't' Name.Variable ']' Punctuation '\n ' Text '(' Punctuation 'var ' Keyword 'len' Name.Variable ' ' Text '1' Literal.Number.Integer ')' Punctuation '\n ' Text '(' Punctuation 'each ' Keyword '[' Punctuation 'i' Name.Variable ' ' Text '(' Punctuation 'ipairs ' Name.Builtin 't' Name.Variable ')' Punctuation ']' Punctuation ' ' Text '(' Punctuation 'set ' Keyword 'len' Name.Variable ' ' Text 'i' Name.Variable ')' Punctuation ')' Punctuation '\n ' Text 'len' Name.Variable ')' Punctuation '\n\n' Text '(' Punctuation 'fn ' Keyword 'get-nonsequential-keys' Name.Variable ' ' Text '[' Punctuation 't' Name.Variable ']' Punctuation '\n ' Text '(' Punctuation 'let ' Keyword '[' Punctuation 'keys' Name.Variable ' ' Text '{' Punctuation '}' Punctuation '\n ' Text 'sequence-length' Name.Variable ' ' Text '(' Punctuation 'get-sequence-length' Name.Variable ' ' Text 't' Name.Variable ')' Punctuation ']' Punctuation '\n ' Text '(' Punctuation 'each ' Keyword '[' Punctuation 'k' Name.Variable ' ' Text '(' Punctuation 'pairs ' Name.Builtin 't' Name.Variable ')' Punctuation ']' Punctuation '\n ' Text '(' Punctuation 'when ' Keyword '(' Punctuation 'not ' Keyword '(' Punctuation 'sequence-key?' Name.Variable ' ' Text 'k' Name.Variable ' ' Text 'sequence-length' Name.Variable ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'table.insert' Name.Variable ' ' Text 'keys' Name.Variable ' ' Text 'k' Name.Variable ')' Punctuation ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'table.sort' Name.Variable ' ' Text 'keys' Name.Variable ' ' Text 'sort-keys' Name.Variable ')' Punctuation '\n ' Text '(' Punctuation 'values ' Keyword 'keys' Name.Variable ' ' Text 'sequence-length' Name.Variable ')' Punctuation ')' Punctuation ')' Punctuation '\n\n' Text '(' Punctuation 'fn ' Keyword 'count-table-appearances' Name.Variable ' ' Text '[' Punctuation 't' Name.Variable ' ' Text 'appearances' Name.Variable ']' Punctuation '\n ' Text '(' Punctuation 'when ' Keyword '(' Punctuation '= ' Keyword '(' Punctuation 'type ' Name.Builtin 't' Name.Variable ')' Punctuation ' ' Text '"table"' Literal.String ')' Punctuation '\n ' Text '(' Punctuation 'if ' Keyword '(' Punctuation 'not ' Keyword '(' Punctuation '. ' Keyword 'appearances' Name.Variable ' ' Text 't' Name.Variable ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'do ' Keyword '(' Punctuation 'tset ' Keyword 'appearances' Name.Variable ' ' Text 't' Name.Variable ' ' Text '1' Literal.Number.Integer ')' Punctuation '\n ' Text '(' Punctuation 'each ' Keyword '[' Punctuation 'k' Name.Variable ' ' Text 'v' Name.Variable ' ' Text '(' Punctuation 'pairs ' Name.Builtin 't' Name.Variable ')' Punctuation ']' Punctuation '\n ' Text '(' Punctuation 'count-table-appearances' Name.Variable ' ' Text 'k' Name.Variable ' ' Text 'appearances' Name.Variable ')' Punctuation '\n ' Text '(' Punctuation 'count-table-appearances' Name.Variable ' ' Text 'v' Name.Variable ' ' Text 'appearances' Name.Variable ')' Punctuation ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'tset ' Keyword 'appearances' Name.Variable ' ' Text 't' Name.Variable ' ' Text '(' Punctuation '+ ' Keyword '(' Punctuation 'or ' Keyword '(' Punctuation '. ' Keyword 'appearances' Name.Variable ' ' Text 't' Name.Variable ')' Punctuation ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '1' Literal.Number.Integer ')' Punctuation ')' Punctuation ')' Punctuation ')' Punctuation '\n ' Text 'appearances' Name.Variable ')' Punctuation '\n\n\x0c\n\n' Text '(' Punctuation 'var ' Keyword 'put-value' Name.Variable ' ' Text 'nil' Name.Variable ')' Punctuation ' ' Text '; mutual recursion going on; defined below' Comment.Single '\n\n' Text '(' Punctuation 'fn ' Keyword 'puts' Name.Variable ' ' Text '[' Punctuation 'self' Name.Variable ' ' Text '...' Name.Variable ']' Punctuation '\n ' Text '(' Punctuation 'each ' Keyword '[' Punctuation '_' Name.Variable ' ' Text 'v' Name.Variable ' ' Text '(' Punctuation 'ipairs ' Name.Builtin '[' Punctuation '...' Name.Variable ']' Punctuation ')' Punctuation ']' Punctuation '\n ' Text '(' Punctuation 'table.insert' Name.Variable ' ' Text 'self.buffer' Name.Variable ' ' Text 'v' Name.Variable ')' Punctuation ')' Punctuation ')' Punctuation '\n\n' Text '(' Punctuation 'fn ' Keyword 'tabify' Name.Variable ' ' Text '[' Punctuation 'self' Name.Variable ']' Punctuation ' ' Text '(' Punctuation 'puts' Name.Variable ' ' Text 'self' Name.Variable ' ' Text '"\\n"' Literal.String ' ' Text '(' Punctuation ': ' Keyword 'self.indent' Name.Variable ' ' Text ':rep' Literal.String.Symbol ' ' Text 'self.level' Name.Variable ')' Punctuation ')' Punctuation ')' Punctuation '\n\n' Text '(' Punctuation 'fn ' Keyword 'already-visited?' Name.Variable ' ' Text '[' Punctuation 'self' Name.Variable ' ' Text 'v' Name.Variable ']' Punctuation ' ' Text '(' Punctuation 'not= ' Keyword '(' Punctuation '. ' Keyword 'self.ids' Name.Variable ' ' Text 'v' Name.Variable ')' Punctuation ' ' Text 'nil' Name.Variable ')' Punctuation ')' Punctuation '\n\n' Text '(' Punctuation 'fn ' Keyword 'get-id' Name.Variable ' ' Text '[' Punctuation 'self' Name.Variable ' ' Text 'v' Name.Variable ']' Punctuation '\n ' Text '(' Punctuation 'var ' Keyword 'id' Name.Variable ' ' Text '(' Punctuation '. ' Keyword 'self.ids' Name.Variable ' ' Text 'v' Name.Variable ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'when ' Keyword '(' Punctuation 'not ' Keyword 'id' Name.Variable ')' Punctuation '\n ' Text '(' Punctuation 'let ' Keyword '[' Punctuation 'tv' Name.Variable ' ' Text '(' Punctuation 'type ' Name.Builtin 'v' Name.Variable ')' Punctuation ']' Punctuation '\n ' Text '(' Punctuation 'set ' Keyword 'id' Name.Variable ' ' Text '(' Punctuation '+ ' Keyword '(' Punctuation 'or ' Keyword '(' Punctuation '. ' Keyword 'self.max-ids' Name.Variable ' ' Text 'tv' Name.Variable ')' Punctuation ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text '1' Literal.Number.Integer ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'tset ' Keyword 'self.max-ids' Name.Variable ' ' Text 'tv' Name.Variable ' ' Text 'id' Name.Variable ')' Punctuation '\n ' Text '(' Punctuation 'tset ' Keyword 'self.ids' Name.Variable ' ' Text 'v' Name.Variable ' ' Text 'id' Name.Variable ')' Punctuation ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'tostring ' Name.Builtin 'id' Name.Variable ')' Punctuation ')' Punctuation '\n\n' Text '(' Punctuation 'fn ' Keyword 'put-sequential-table' Name.Variable ' ' Text '[' Punctuation 'self' Name.Variable ' ' Text 't' Name.Variable ' ' Text 'len' Name.Variable ']' Punctuation '\n ' Text '(' Punctuation 'puts' Name.Variable ' ' Text 'self' Name.Variable ' ' Text '"["' Literal.String ')' Punctuation '\n ' Text '(' Punctuation 'set ' Keyword 'self.level' Name.Variable ' ' Text '(' Punctuation '+ ' Keyword 'self.level' Name.Variable ' ' Text '1' Literal.Number.Integer ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'for ' Keyword '[' Punctuation 'i' Name.Variable ' ' Text '1' Literal.Number.Integer ' ' Text 'len' Name.Variable ']' Punctuation '\n ' Text '(' Punctuation 'when ' Keyword '(' Punctuation '< ' Keyword '1' Literal.Number.Integer ' ' Text 'i' Name.Variable ' ' Text '(' Punctuation '+ ' Keyword '1' Literal.Number.Integer ' ' Text 'len' Name.Variable ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'puts' Name.Variable ' ' Text 'self' Name.Variable ' ' Text '" "' Literal.String ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'put-value' Name.Variable ' ' Text 'self' Name.Variable ' ' Text '(' Punctuation '. ' Keyword 't' Name.Variable ' ' Text 'i' Name.Variable ')' Punctuation ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'set ' Keyword 'self.level' Name.Variable ' ' Text '(' Punctuation '- ' Keyword 'self.level' Name.Variable ' ' Text '1' Literal.Number.Integer ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'puts' Name.Variable ' ' Text 'self' Name.Variable ' ' Text '"]"' Literal.String ')' Punctuation ')' Punctuation '\n\n' Text '(' Punctuation 'fn ' Keyword 'put-key' Name.Variable ' ' Text '[' Punctuation 'self' Name.Variable ' ' Text 'k' Name.Variable ']' Punctuation '\n ' Text '(' Punctuation 'if ' Keyword '(' Punctuation 'and ' Keyword '(' Punctuation '= ' Keyword '(' Punctuation 'type ' Name.Builtin 'k' Name.Variable ')' Punctuation ' ' Text '"string"' Literal.String ')' Punctuation '\n ' Text '(' Punctuation ': ' Keyword 'k' Name.Variable ' ' Text ':find' Literal.String.Symbol ' ' Text '"^[-%w?\\\\^_!$%&*+./@:|<=>]+$"' Literal.String ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'puts' Name.Variable ' ' Text 'self' Name.Variable ' ' Text '":"' Literal.String ' ' Text 'k' Name.Variable ')' Punctuation '\n ' Text '(' Punctuation 'put-value' Name.Variable ' ' Text 'self' Name.Variable ' ' Text 'k' Name.Variable ')' Punctuation ')' Punctuation ')' Punctuation '\n\n' Text '(' Punctuation 'fn ' Keyword 'put-kv-table' Name.Variable ' ' Text '[' Punctuation 'self' Name.Variable ' ' Text 't' Name.Variable ' ' Text 'ordered-keys' Name.Variable ']' Punctuation '\n ' Text '(' Punctuation 'puts' Name.Variable ' ' Text 'self' Name.Variable ' ' Text '"{"' Literal.String ')' Punctuation '\n ' Text '(' Punctuation 'set ' Keyword 'self.level' Name.Variable ' ' Text '(' Punctuation '+ ' Keyword 'self.level' Name.Variable ' ' Text '1' Literal.Number.Integer ')' Punctuation ')' Punctuation '\n ' Text ';; first, output sorted nonsequential keys' Comment.Single '\n ' Text '(' Punctuation 'each ' Keyword '[' Punctuation 'i' Name.Variable ' ' Text 'k' Name.Variable ' ' Text '(' Punctuation 'ipairs ' Name.Builtin 'ordered-keys' Name.Variable ')' Punctuation ']' Punctuation '\n ' Text '(' Punctuation 'when ' Keyword '(' Punctuation 'or ' Keyword 'self.table-edges' Name.Variable ' ' Text '(' Punctuation 'not= ' Keyword 'i' Name.Variable ' ' Text '1' Literal.Number.Integer ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'tabify' Name.Variable ' ' Text 'self' Name.Variable ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'put-key' Name.Variable ' ' Text 'self' Name.Variable ' ' Text 'k' Name.Variable ')' Punctuation '\n ' Text '(' Punctuation 'puts' Name.Variable ' ' Text 'self' Name.Variable ' ' Text '" "' Literal.String ')' Punctuation '\n ' Text '(' Punctuation 'put-value' Name.Variable ' ' Text 'self' Name.Variable ' ' Text '(' Punctuation '. ' Keyword 't' Name.Variable ' ' Text 'k' Name.Variable ')' Punctuation ')' Punctuation ')' Punctuation '\n ' Text ';; next, output any sequential keys' Comment.Single '\n ' Text '(' Punctuation 'each ' Keyword '[' Punctuation 'i' Name.Variable ' ' Text 'v' Name.Variable ' ' Text '(' Punctuation 'ipairs ' Name.Builtin 't' Name.Variable ')' Punctuation ']' Punctuation '\n ' Text '(' Punctuation 'tabify' Name.Variable ' ' Text 'self' Name.Variable ')' Punctuation '\n ' Text '(' Punctuation 'put-key' Name.Variable ' ' Text 'self' Name.Variable ' ' Text 'i' Name.Variable ')' Punctuation '\n ' Text '(' Punctuation 'puts' Name.Variable ' ' Text 'self' Name.Variable ' ' Text '" "' Literal.String ')' Punctuation '\n ' Text '(' Punctuation 'put-value' Name.Variable ' ' Text 'self' Name.Variable ' ' Text 'v' Name.Variable ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'set ' Keyword 'self.level' Name.Variable ' ' Text '(' Punctuation '- ' Keyword 'self.level' Name.Variable ' ' Text '1' Literal.Number.Integer ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'when ' Keyword 'self.table-edges' Name.Variable '\n ' Text '(' Punctuation 'tabify' Name.Variable ' ' Text 'self' Name.Variable ')' Punctuation ')' Punctuation '\n ' Text '(' Punctuation 'puts' Name.Variable ' ' Text 'self' Name.Variable ' ' Text '"}"' Literal.String ')' Punctuation ')' Punctuation '\n\n' Text '(' Punctuation 'fn ' Keyword 'put-table' Name.Variable ' ' Text '[' Punctuation 'self' Name.Variable ' ' Text 't' Name.Variable ']' Punctuation '\n ' Text '(' Punctuation 'let ' Keyword '[' Punctuation 'metamethod' Name.Variable ' ' Text '(' Punctuation 'and ' Keyword 'self.metamethod?' Name.Variable ' ' Text '(' Punctuation '-?> ' Keyword 't' Name.Variable ' ' Text 'getmetatable ' Name.Builtin '(' Punctuation '. ' Keyword ':__fennelview' Literal.String.Symbol ')' Punctuation ')' Punctuation ')' Punctuation ']' Punctuation '\n ' Text '(' Punctuation 'if ' Keyword '(' Punctuation 'and ' Keyword '(' Punctuation 'already-visited?' Name.Variable ' ' Text 'self' Name.Variable ' ' Text 't' Name.Variable ')' Punctuation ' ' Text 'self.detect-cycles?' Name.Variable ')' Punctuation '\n ' Text '(' Punctuation 'puts' Name.Variable ' ' Text 'self' Name.Variable ' ' Text '"#