'## core string functions ##' Comment '\n' Text '\n' Text 'length' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'y' Literal.String 'o' Literal.String 'u' Literal.String ' ' Literal.String 'm' Literal.String 'u' Literal.String 's' Literal.String 't' Literal.String ' ' Literal.String 'i' Literal.String 'm' Literal.String 'p' Literal.String 'l' Literal.String 'e' Literal.String 'm' Literal.String 'e' Literal.String 'n' Literal.String 't' Literal.String ' ' Literal.String 'l' Literal.String 'e' Literal.String 'n' Literal.String 'g' Literal.String 't' Literal.String 'h' Literal.String '(' Literal.String '"' Literal.String ',' Punctuation 'typeof' Name '(' Punctuation 's' Name ')' Punctuation ',' Punctuation '"' Literal.String ')' Literal.String '"' Literal.String ')' Punctuation '\n' Text 'next' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Int' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'y' Literal.String 'o' Literal.String 'u' Literal.String ' ' Literal.String 'm' Literal.String 'u' Literal.String 's' Literal.String 't' Literal.String ' ' Literal.String 'i' Literal.String 'm' Literal.String 'p' Literal.String 'l' Literal.String 'e' Literal.String 'm' Literal.String 'e' Literal.String 'n' Literal.String 't' Literal.String ' ' Literal.String 'n' Literal.String 'e' Literal.String 'x' Literal.String 't' Literal.String '(' Literal.String '"' Literal.String ',' Punctuation 'typeof' Name '(' Punctuation 's' Name ')' Punctuation ',' Punctuation '"' Literal.String ',' Literal.String 'I' Literal.String 'n' Literal.String 't' Literal.String ')' Literal.String '"' Literal.String ')' Punctuation '\n' Text 'next' Name '(' Punctuation 's' Name '::' Operator 'DirectIndexString' Keyword.Type ',' Punctuation ' ' Text 'i' Name '::' Operator 'Int' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text '(' Punctuation 's' Name '[' Punctuation 'i' Name ']' Punctuation ',' Punctuation 'i' Name '+' Operator '1' Literal.Number.Integer ')' Punctuation '\n' Text 'next' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'int' Name '(' Punctuation 'i' Name ')' Punctuation ')' Punctuation '\n' Text '\n' Text '## generic supplied functions ##' Comment '\n' Text '\n' Text 'start' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer '\n' Text 'done' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation 'i' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '(' Punctuation 'i' Name ' ' Text '>' Operator ' ' Text 'length' Name '(' Punctuation 's' Name ')' Punctuation ')' Punctuation '\n' Text 'isempty' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'done' Name '(' Punctuation 's' Name ',' Punctuation 'start' Name '(' Punctuation 's' Name ')' Punctuation ')' Punctuation '\n' Text 'ref' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Int' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '[' Punctuation '1' Literal.Number.Integer ']' Punctuation '\n' Text 'ref' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 's' Name '[' Punctuation 'int' Name '(' Punctuation 'i' Name ')' Punctuation ']' Punctuation '\n' Text 'ref' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'x' Name '::' Operator 'Real' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 's' Name '[' Punctuation 'iround' Name '(' Punctuation 'x' Name ')' Punctuation ']' Punctuation '\n' Text 'ref' Name '{' Punctuation 'T' Name '<:' Operator 'Integer' Keyword.Type '}' Punctuation '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'r' Name '::' Operator 'Range1' Name '{' Punctuation 'T' Name '}' Punctuation ')' Punctuation ' ' Text '=' Operator ' ' Text 's' Name '[' Punctuation 'int' Name '(' Punctuation 'first' Name '(' Punctuation 'r' Name ')' Punctuation ')' Punctuation ':' Operator 'int' Name '(' Punctuation 'last' Name '(' Punctuation 'r' Name ')' Punctuation ')' Punctuation ']' Punctuation '\n' Text '\n' Text 'symbol' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'symbol' Name '(' Punctuation 'cstring' Name '(' Punctuation 's' Name ')' Punctuation ')' Punctuation '\n' Text 'string' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 's' Name '\n' Text '\n' Text 'print' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'for' Keyword ' ' Text 'c' Name '=' Operator 's' Name ';' Punctuation ' ' Text 'print' Name '(' Punctuation 'c' Name ')' Punctuation ';' Punctuation ' ' Text 'end' Keyword '\n' Text 'print' Name '(' Punctuation 'x' Name '.' Operator '.' Operator '.' Operator ')' Punctuation ' ' Text '=' Operator ' ' Text 'for' Keyword ' ' Text 'i' Name '=' Operator 'x' Name ';' Punctuation ' ' Text 'print' Name '(' Punctuation 'i' Name ')' Punctuation ';' Punctuation ' ' Text 'end' Keyword '\n' Text 'println' Name '(' Punctuation 'args' Name '.' Operator '.' Operator '.' Operator ')' Punctuation ' ' Text '=' Operator ' ' Text 'print' Name '(' Punctuation 'args' Name '.' Operator '.' Operator '.' Operator ',' Punctuation ' ' Text "'\\n'" Literal.String.Char ')' Punctuation '\n' Text '\n' Text 'show' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'print_quoted' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text '\n' Text '(' Punctuation '*' Operator ')' Punctuation '(' Punctuation 's' Name '::' Operator 'String' Name '.' Operator '.' Operator '.' Operator ')' Punctuation ' ' Text '=' Operator ' ' Text 'strcat' Name '(' Punctuation 's' Name '.' Operator '.' Operator '.' Operator ')' Punctuation '\n' Text '(' Punctuation '^' Operator ')' Punctuation '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'r' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'repeat' Name '(' Punctuation 's' Name ',' Punctuation 'r' Name ')' Punctuation '\n' Text '\n' Text 'size' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '(' Punctuation 'length' Name '(' Punctuation 's' Name ')' Punctuation ',' Punctuation ')' Punctuation '\n' Text 'size' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'd' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'd' Name '==' Operator '1' Literal.Number.Integer ' ' Text '?' Operator ' ' Text 'length' Name '(' Punctuation 's' Name ')' Punctuation ' ' Text ':' Operator '\n' Text ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'i' Literal.String 'n' Literal.String ' ' Literal.String 's' Literal.String 'i' Literal.String 'z' Literal.String 'e' Literal.String ':' Literal.String ' ' Literal.String 'd' Literal.String 'i' Literal.String 'm' Literal.String 'e' Literal.String 'n' Literal.String 's' Literal.String 'i' Literal.String 'o' Literal.String 'n' Literal.String ' ' Literal.String '"' Literal.String ',' Punctuation 'd' Name ',' Punctuation '"' Literal.String ' ' Literal.String 'o' Literal.String 'u' Literal.String 't' Literal.String ' ' Literal.String 'o' Literal.String 'f' Literal.String ' ' Literal.String 'r' Literal.String 'a' Literal.String 'n' Literal.String 'g' Literal.String 'e' Literal.String '"' Literal.String ')' Punctuation '\n' Text '\n' Text 'strlen' Name '(' Punctuation 's' Name '::' Operator 'DirectIndexString' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'length' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text 'function' Keyword ' ' Text 'strlen' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'start' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'done' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text '0' Literal.Number.Integer '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'n' Name ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer '\n' Text ' ' Text 'while' Keyword ' ' Text 'true' Keyword.Constant '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'done' Name '(' Punctuation 's' Name ',' Punctuation 'j' Name ')' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'n' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'n' Name ' ' Text '+=' Operator ' ' Text '1' Literal.Number.Integer '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'j' Name '\n' Text ' ' Text 'end' Keyword '\n' Text 'end' Keyword '\n' Text '\n' Text 'isvalid' Name '(' Punctuation 's' Name '::' Operator 'DirectIndexString' Keyword.Type ',' Punctuation ' ' Text 'i' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text '(' Punctuation 'start' Name '(' Punctuation 's' Name ')' Punctuation ' ' Text '<=' Operator ' ' Text 'i' Name ' ' Text '<=' Operator ' ' Text 'length' Name '(' Punctuation 's' Name ')' Punctuation ')' Punctuation '\n' Text 'function' Keyword ' ' Text 'isvalid' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'try' Keyword '\n' Text ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'true' Keyword.Constant '\n' Text ' ' Text 'catch' Keyword '\n' Text ' ' Text 'false' Keyword.Constant '\n' Text ' ' Text 'end' Keyword '\n' Text 'end' Keyword '\n' Text '\n' Text 'prevind' Name '(' Punctuation 's' Name '::' Operator 'DirectIndexString' Keyword.Type ',' Punctuation ' ' Text 'i' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'i' Name '-' Operator '1' Literal.Number.Integer '\n' Text 'thisind' Name '(' Punctuation 's' Name '::' Operator 'DirectIndexString' Keyword.Type ',' Punctuation ' ' Text 'i' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'i' Name '\n' Text 'nextind' Name '(' Punctuation 's' Name '::' Operator 'DirectIndexString' Keyword.Type ',' Punctuation ' ' Text 'i' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'i' Name '+' Operator '1' Literal.Number.Integer '\n' Text '\n' Text 'prevind' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'thisind' Name '(' Punctuation 's' Name ',' Punctuation 'thisind' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '-' Operator '1' Literal.Number.Integer ')' Punctuation '\n' Text '\n' Text 'function' Keyword ' ' Text 'thisind' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'for' Keyword ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'i' Name ':' Operator '-' Operator '1' Literal.Number.Integer ':' Operator '1' Literal.Number.Integer '\n' Text ' ' Text 'if' Keyword ' ' Text 'isvalid' Name '(' Punctuation 's' Name ',' Punctuation 'j' Name ')' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'j' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'return' Keyword ' ' Text '0' Literal.Number.Integer ' ' Text '# out of range' Comment '\n' Text 'end' Keyword '\n' Text '\n' Text 'function' Keyword ' ' Text 'nextind' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'for' Keyword ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'i' Name '+' Operator '1' Literal.Number.Integer ':' Operator 'length' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'isvalid' Name '(' Punctuation 's' Name ',' Punctuation 'j' Name ')' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'j' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'length' Name '(' Punctuation 's' Name ')' Punctuation '+' Operator '1' Literal.Number.Integer ' ' Text '# out of range' Comment '\n' Text 'end' Keyword '\n' Text '\n' Text 'ind2chr' Name '(' Punctuation 's' Name '::' Operator 'DirectIndexString' Keyword.Type ',' Punctuation ' ' Text 'i' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'i' Name '\n' Text 'chr2ind' Name '(' Punctuation 's' Name '::' Operator 'DirectIndexString' Keyword.Type ',' Punctuation ' ' Text 'i' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'i' Name '\n' Text '\n' Text 'function' Keyword ' ' Text 'ind2chr' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation '\n' Text ' ' Text 's' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '# throws error if invalid' Comment '\n' Text ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer '\n' Text ' ' Text 'k' Name ' ' Text '=' Operator ' ' Text 'start' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text 'true' Keyword.Constant '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'l' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'k' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '<=' Operator ' ' Text 'k' Name '\n' Text ' ' Text 'return' Keyword ' ' Text 'j' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'j' Name ' ' Text '+=' Operator ' ' Text '1' Literal.Number.Integer '\n' Text ' ' Text 'k' Name ' ' Text '=' Operator ' ' Text 'l' Name '\n' Text ' ' Text 'end' Keyword '\n' Text 'end' Keyword '\n' Text '\n' Text 'function' Keyword ' ' Text 'chr2ind' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '<' Operator ' ' Text '1' Literal.Number.Integer '\n' Text ' ' Text 'return' Keyword ' ' Text 'i' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer '\n' Text ' ' Text 'k' Name ' ' Text '=' Operator ' ' Text 'start' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text 'true' Keyword.Constant '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'l' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'k' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '==' Operator ' ' Text 'j' Name '\n' Text ' ' Text 'return' Keyword ' ' Text 'k' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'j' Name ' ' Text '+=' Operator ' ' Text '1' Literal.Number.Integer '\n' Text ' ' Text 'k' Name ' ' Text '=' Operator ' ' Text 'l' Name '\n' Text ' ' Text 'end' Keyword '\n' Text 'end' Keyword '\n' Text '\n' Text 'function' Keyword ' ' Text 'strchr' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'c' Name '::' Operator 'Char' Keyword.Type ',' Punctuation ' ' Text 'i' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'nextind' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text '!' Operator 'done' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'd' Name ',' Punctuation ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text 'd' Name '\n' Text ' ' Text 'return' Keyword ' ' Text 'i' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'j' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'return' Keyword ' ' Text '0' Literal.Number.Integer '\n' Text 'end' Keyword '\n' Text 'strchr' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'c' Name '::' Operator 'Char' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'strchr' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text 'c' Name ',' Punctuation ' ' Text 'start' Name '(' Punctuation 's' Name ')' Punctuation ')' Punctuation '\n' Text 'contains' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'c' Name '::' Operator 'Char' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text '(' Punctuation 'strchr' Name '(' Punctuation 's' Name ',' Punctuation 'c' Name ')' Punctuation '!=' Operator '0' Literal.Number.Integer ')' Punctuation '\n' Text '\n' Text 'function' Keyword ' ' Text 'chars' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'cx' Name ' ' Text '=' Operator ' ' Text 'Array' Keyword.Type '(' Punctuation 'Char' Keyword.Type ',' Punctuation 'strlen' Name '(' Punctuation 's' Name ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer '\n' Text ' ' Text 'for' Keyword ' ' Text 'c' Name ' ' Text 'in' Keyword.Pseudo ' ' Text 's' Name '\n' Text ' ' Text 'cx' Name '[' Punctuation 'i' Name ' ' Text '+=' Operator ' ' Text '1' Literal.Number.Integer ']' Punctuation ' ' Text '=' Operator ' ' Text 'c' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'return' Keyword ' ' Text 'cx' Name '\n' Text 'end' Keyword '\n' Text '\n' Text 'function' Keyword ' ' Text 'cmp' Name '(' Punctuation 'a' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'b' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'start' Name '(' Punctuation 'a' Name ')' Punctuation '\n' Text ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'start' Name '(' Punctuation 'b' Name ')' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text '!' Operator 'done' Name '(' Punctuation 'a' Name ',' Punctuation 'i' Name ')' Punctuation ' ' Text '&&' Operator ' ' Text '!' Operator 'done' Name '(' Punctuation 'b' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 'a' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'd' Name ',' Punctuation ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 'b' Name ',' Punctuation 'j' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'c' Name ' ' Text '!=' Operator ' ' Text 'd' Name '\n' Text ' ' Text 'return' Keyword ' ' Text 'c' Name ' ' Text '<' Operator ' ' Text 'd' Name ' ' Text '?' Operator ' ' Text '-' Operator '1' Literal.Number.Integer ' ' Text ':' Operator ' ' Text '+' Operator '1' Literal.Number.Integer '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'done' Name '(' Punctuation 'a' Name ',' Punctuation 'i' Name ')' Punctuation ' ' Text '&&' Operator ' ' Text '!' Operator 'done' Name '(' Punctuation 'b' Name ',' Punctuation 'j' Name ')' Punctuation ' ' Text '?' Operator ' ' Text '-' Operator '1' Literal.Number.Integer ' ' Text ':' Operator '\n' Text ' ' Text '!' Operator 'done' Name '(' Punctuation 'a' Name ',' Punctuation 'i' Name ')' Punctuation ' ' Text '&&' Operator ' ' Text 'done' Name '(' Punctuation 'b' Name ',' Punctuation 'j' Name ')' Punctuation ' ' Text '?' Operator ' ' Text '+' Operator '1' Literal.Number.Integer ' ' Text ':' Operator ' ' Text '0' Literal.Number.Integer '\n' Text 'end' Keyword '\n' Text '\n' Text 'isequal' Name '(' Punctuation 'a' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'b' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'cmp' Name '(' Punctuation 'a' Name ',' Punctuation 'b' Name ')' Punctuation ' ' Text '==' Operator ' ' Text '0' Literal.Number.Integer '\n' Text 'isless' Name '(' Punctuation 'a' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'b' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'cmp' Name '(' Punctuation 'a' Name ',' Punctuation 'b' Name ')' Punctuation ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer '\n' Text '\n' Text '# faster comparisons for byte strings' Comment '\n' Text '\n' Text 'cmp' Name '(' Punctuation 'a' Name '::' Operator 'ByteString' Name ',' Punctuation ' ' Text 'b' Name '::' Operator 'ByteString' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'lexcmp' Name '(' Punctuation 'a' Name '.' Operator 'data' Name ',' Punctuation ' ' Text 'b' Name '.' Operator 'data' Name ')' Punctuation '\n' Text 'isequal' Name '(' Punctuation 'a' Name '::' Operator 'ByteString' Name ',' Punctuation ' ' Text 'b' Name '::' Operator 'ByteString' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'length' Name '(' Punctuation 'a' Name ')' Punctuation '==' Operator 'length' Name '(' Punctuation 'b' Name ')' Punctuation ' ' Text '&&' Operator ' ' Text 'cmp' Name '(' Punctuation 'a' Name ',' Punctuation 'b' Name ')' Punctuation '==' Operator '0' Literal.Number.Integer '\n' Text '\n' Text '## character column width function ##' Comment '\n' Text '\n' Text 'charwidth' Name '(' Punctuation 'c' Name '::' Operator 'Char' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'max' Name '(' Punctuation '0' Literal.Number.Integer ',' Punctuation 'int' Name '(' Punctuation 'ccall' Keyword '(' Punctuation ':' Operator 'wcwidth' Name ',' Punctuation ' ' Text 'Int32' Keyword.Type ',' Punctuation ' ' Text '(' Punctuation 'Char' Keyword.Type ',' Punctuation ')' Punctuation ',' Punctuation ' ' Text 'c' Name ')' Punctuation ')' Punctuation ')' Punctuation '\n' Text 'strwidth' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '(' Punctuation 'w' Name '=' Operator '0' Literal.Number.Integer ';' Punctuation ' ' Text 'for' Keyword ' ' Text 'c' Name ' ' Text 'in' Keyword.Pseudo ' ' Text 's' Name ';' Punctuation ' ' Text 'w' Name ' ' Text '+=' Operator ' ' Text 'charwidth' Name '(' Punctuation 'c' Name ')' Punctuation ';' Punctuation ' ' Text 'end' Keyword ';' Punctuation ' ' Text 'w' Name ')' Punctuation '\n' Text 'strwidth' Name '(' Punctuation 's' Name '::' Operator 'ByteString' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'ccall' Keyword '(' Punctuation ':' Operator 'u8_strwidth' Name ',' Punctuation ' ' Text 'Int' Keyword.Type ',' Punctuation ' ' Text '(' Punctuation 'Ptr' Keyword.Type '{' Punctuation 'Uint8' Name '}' Punctuation ',' Punctuation ')' Punctuation ',' Punctuation ' ' Text 's' Name '.' Operator 'data' Name ')' Punctuation '\n' Text '# TODO: implement and use u8_strnwidth that takes a length argument' Comment '\n' Text '\n' Text '## generic string uses only length and next ##' Comment '\n' Text '\n' Text 'type' Keyword ' ' Text 'GenericString' Name ' ' Text '<:' Operator ' ' Text 'String' Name '\n' Text ' ' Text 'string' Name '::' Operator 'String' Name '\n' Text 'end' Keyword '\n' Text '\n' Text 'length' Name '(' Punctuation 's' Name '::' Operator 'GenericString' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'length' Name '(' Punctuation 's' Name '.' Operator 'string' Name ')' Punctuation '\n' Text 'next' Name '(' Punctuation 's' Name '::' Operator 'GenericString' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Int' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name '.' Operator 'string' Name ',' Punctuation ' ' Text 'i' Name ')' Punctuation '\n' Text '\n' Text '## plain old character arrays ##' Comment '\n' Text '\n' Text 'type' Keyword ' ' Text 'CharString' Name ' ' Text '<:' Operator ' ' Text 'String' Name '\n' Text ' ' Text 'chars' Name '::' Operator 'Array' Keyword.Type '{' Punctuation 'Char' Keyword.Type ',' Punctuation '1' Literal.Number.Integer '}' Punctuation '\n' Text '\n' Text ' ' Text 'CharString' Name '(' Punctuation 'a' Name '::' Operator 'Array' Keyword.Type '{' Punctuation 'Char' Keyword.Type ',' Punctuation '1' Literal.Number.Integer '}' Punctuation ')' Punctuation ' ' Text '=' Operator ' ' Text 'new' Name '(' Punctuation 'a' Name ')' Punctuation '\n' Text ' ' Text 'CharString' Name '(' Punctuation 'c' Name '::' Operator 'Char' Keyword.Type '.' Operator '.' Operator '.' Operator ')' Punctuation ' ' Text '=' Operator ' ' Text 'new' Name '(' Punctuation '[' Punctuation ' ' Text 'c' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '|' Operator ' ' Text 'i' Name '=' Operator '1' Literal.Number.Integer ':' Operator 'length' Name '(' Punctuation 'c' Name ')' Punctuation ' ' Text ']' Punctuation ')' Punctuation '\n' Text 'end' Keyword '\n' Text 'CharString' Name '(' Punctuation 'x' Name '.' Operator '.' Operator '.' Operator ')' Punctuation ' ' Text '=' Operator ' ' Text 'CharString' Name '(' Punctuation 'map' Name '(' Punctuation 'char' Name ',' Punctuation 'x' Name ')' Punctuation '.' Operator '.' Operator '.' Operator ')' Punctuation '\n' Text '\n' Text 'next' Name '(' Punctuation 's' Name '::' Operator 'CharString' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Int' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text '(' Punctuation 's' Name '.' Operator 'chars' Name '[' Punctuation 'i' Name ']' Punctuation ',' Punctuation ' ' Text 'i' Name '+' Operator '1' Literal.Number.Integer ')' Punctuation '\n' Text 'length' Name '(' Punctuation 's' Name '::' Operator 'CharString' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'length' Name '(' Punctuation 's' Name '.' Operator 'chars' Name ')' Punctuation '\n' Text 'strlen' Name '(' Punctuation 's' Name '::' Operator 'CharString' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'length' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text '\n' Text 'string' Name '(' Punctuation 'c' Name '::' Operator 'Char' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'CharString' Name '(' Punctuation 'c' Name ')' Punctuation '\n' Text 'string' Name '(' Punctuation 'c' Name '::' Operator 'Char' Keyword.Type ',' Punctuation ' ' Text 'x' Name '::' Operator 'Char' Keyword.Type '.' Operator '.' Operator '.' Operator ')' Punctuation ' ' Text '=' Operator ' ' Text 'CharString' Name '(' Punctuation 'c' Name ',' Punctuation ' ' Text 'x' Name '.' Operator '.' Operator '.' Operator ')' Punctuation '\n' Text '\n' Text '## substrings reference original strings ##' Comment '\n' Text '\n' Text 'type' Keyword ' ' Text 'SubString' Keyword.Type ' ' Text '<:' Operator ' ' Text 'String' Name '\n' Text ' ' Text 'string' Name '::' Operator 'String' Name '\n' Text ' ' Text 'offset' Name '::' Operator 'Int' Keyword.Type '\n' Text ' ' Text 'length' Name '::' Operator 'Int' Keyword.Type '\n' Text '\n' Text ' ' Text 'SubString' Keyword.Type '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Int' Keyword.Type ',' Punctuation ' ' Text 'j' Name '::' Operator 'Int' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'new' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text 'i' Name '-' Operator '1' Literal.Number.Integer ',' Punctuation ' ' Text 'j' Name '-' Operator 'i' Name '+' Operator '1' Literal.Number.Integer ')' Punctuation '\n' Text ' ' Text 'SubString' Keyword.Type '(' Punctuation 's' Name '::' Operator 'SubString' Keyword.Type ',' Punctuation ' ' Text 'i' Name '::' Operator 'Int' Keyword.Type ',' Punctuation ' ' Text 'j' Name '::' Operator 'Int' Keyword.Type ')' Punctuation ' ' Text '=' Operator '\n' Text ' ' Text 'new' Name '(' Punctuation 's' Name '.' Operator 'string' Name ',' Punctuation ' ' Text 'i' Name '-' Operator '1' Literal.Number.Integer '+' Operator 's' Name '.' Operator 'offset' Name ',' Punctuation ' ' Text 'j' Name '-' Operator 'i' Name '+' Operator '1' Literal.Number.Integer ')' Punctuation '\n' Text 'end' Keyword '\n' Text 'SubString' Keyword.Type '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Integer' Keyword.Type ',' Punctuation ' ' Text 'j' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'SubString' Keyword.Type '(' Punctuation 's' Name ',' Punctuation ' ' Text 'int' Name '(' Punctuation 'i' Name ')' Punctuation ',' Punctuation ' ' Text 'int' Name '(' Punctuation 'j' Name ')' Punctuation ')' Punctuation '\n' Text '\n' Text 'function' Keyword ' ' Text 'next' Name '(' Punctuation 's' Name '::' Operator 'SubString' Keyword.Type ',' Punctuation ' ' Text 'i' Name '::' Operator 'Int' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '<' Operator ' ' Text '1' Literal.Number.Integer ' ' Text '||' Operator ' ' Text 'i' Name ' ' Text '>' Operator ' ' Text 's' Name '.' Operator 'length' Name '\n' Text ' ' Text 'error' Name '(' Punctuation '"' Literal.String 's' Literal.String 't' Literal.String 'r' Literal.String 'i' Literal.String 'n' Literal.String 'g' Literal.String ' ' Literal.String 'i' Literal.String 'n' Literal.String 'd' Literal.String 'e' Literal.String 'x' Literal.String ' ' Literal.String 'o' Literal.String 'u' Literal.String 't' Literal.String ' ' Literal.String 'o' Literal.String 'f' Literal.String ' ' Literal.String 'b' Literal.String 'o' Literal.String 'u' Literal.String 'n' Literal.String 'd' Literal.String 's' Literal.String '"' Literal.String ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name '.' Operator 'string' Name ',' Punctuation ' ' Text 'i' Name '+' Operator 's' Name '.' Operator 'offset' Name ')' Punctuation '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'i' Name '-' Operator 's' Name '.' Operator 'offset' Name '\n' Text 'end' Keyword '\n' Text '\n' Text 'length' Name '(' Punctuation 's' Name '::' Operator 'SubString' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 's' Name '.' Operator 'length' Name '\n' Text '# TODO: strlen(s::SubString) = ??' Comment '\n' Text "# default implementation will work but it's slow" Comment '\n' Text '# can this be delegated efficiently somehow?' Comment '\n' Text '# that may require additional string interfaces' Comment '\n' Text '\n' Text 'function' Keyword ' ' Text 'ref' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'r' Name '::' Operator 'Range1' Name '{' Punctuation 'Int' Keyword.Type '}' Punctuation ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'first' Name '(' Punctuation 'r' Name ')' Punctuation ' ' Text '<' Operator ' ' Text '1' Literal.Number.Integer ' ' Text '||' Operator ' ' Text 'length' Name '(' Punctuation 's' Name ')' Punctuation ' ' Text '<' Operator ' ' Text 'last' Name '(' Punctuation 'r' Name ')' Punctuation '\n' Text ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'i' Literal.String 'n' Literal.String ' ' Literal.String 's' Literal.String 'u' Literal.String 'b' Literal.String 's' Literal.String 't' Literal.String 'r' Literal.String 'i' Literal.String 'n' Literal.String 'g' Literal.String ' ' Literal.String 's' Literal.String 'l' Literal.String 'i' Literal.String 'c' Literal.String 'e' Literal.String ':' Literal.String ' ' Literal.String 'i' Literal.String 'n' Literal.String 'd' Literal.String 'e' Literal.String 'x' Literal.String ' ' Literal.String 'o' Literal.String 'u' Literal.String 't' Literal.String ' ' Literal.String 'o' Literal.String 'f' Literal.String ' ' Literal.String 'r' Literal.String 'a' Literal.String 'n' Literal.String 'g' Literal.String 'e' Literal.String '"' Literal.String ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'SubString' Keyword.Type '(' Punctuation 's' Name ',' Punctuation ' ' Text 'first' Name '(' Punctuation 'r' Name ')' Punctuation ',' Punctuation ' ' Text 'last' Name '(' Punctuation 'r' Name ')' Punctuation ')' Punctuation '\n' Text 'end' Keyword '\n' Text '\n' Text '## efficient representation of repeated strings ##' Comment '\n' Text '\n' Text 'type' Keyword ' ' Text 'RepString' Keyword.Type ' ' Text '<:' Operator ' ' Text 'String' Name '\n' Text ' ' Text 'string' Name '::' Operator 'String' Name '\n' Text ' ' Text 'repeat' Name '::' Operator 'Integer' Keyword.Type '\n' Text 'end' Keyword '\n' Text '\n' Text 'length' Name '(' Punctuation 's' Name '::' Operator 'RepString' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'length' Name '(' Punctuation 's' Name '.' Operator 'string' Name ')' Punctuation '*' Operator 's' Name '.' Operator 'repeat' Name '\n' Text 'strlen' Name '(' Punctuation 's' Name '::' Operator 'RepString' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'strlen' Name '(' Punctuation 's' Name '.' Operator 'string' Name ')' Punctuation '*' Operator 's' Name '.' Operator 'repeat' Name '\n' Text '\n' Text 'function' Keyword ' ' Text 'next' Name '(' Punctuation 's' Name '::' Operator 'RepString' Keyword.Type ',' Punctuation ' ' Text 'i' Name '::' Operator 'Int' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '<' Operator ' ' Text '1' Literal.Number.Integer ' ' Text '||' Operator ' ' Text 'i' Name ' ' Text '>' Operator ' ' Text 'length' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'error' Name '(' Punctuation '"' Literal.String 's' Literal.String 't' Literal.String 'r' Literal.String 'i' Literal.String 'n' Literal.String 'g' Literal.String ' ' Literal.String 'i' Literal.String 'n' Literal.String 'd' Literal.String 'e' Literal.String 'x' Literal.String ' ' Literal.String 'o' Literal.String 'u' Literal.String 't' Literal.String ' ' Literal.String 'o' Literal.String 'f' Literal.String ' ' Literal.String 'b' Literal.String 'o' Literal.String 'u' Literal.String 'n' Literal.String 'd' Literal.String 's' Literal.String '"' Literal.String ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'mod1' Name '(' Punctuation 'i' Name ',' Punctuation 'length' Name '(' Punctuation 's' Name '.' Operator 'string' Name ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'k' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name '.' Operator 'string' Name ',' Punctuation ' ' Text 'j' Name ')' Punctuation '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'k' Name '-' Operator 'j' Name '+' Operator 'i' Name '\n' Text 'end' Keyword '\n' Text '\n' Text 'function' Keyword ' ' Text 'repeat' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'r' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'r' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ' ' Text '?' Operator ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'c' Literal.String 'a' Literal.String 'n' Literal.String "'" Literal.String 't' Literal.String ' ' Literal.String 'r' Literal.String 'e' Literal.String 'p' Literal.String 'e' Literal.String 'a' Literal.String 't' Literal.String ' ' Literal.String 'a' Literal.String ' ' Literal.String 's' Literal.String 't' Literal.String 'r' Literal.String 'i' Literal.String 'n' Literal.String 'g' Literal.String ' ' Literal.String '"' Literal.String ',' Punctuation 'r' Name ',' Punctuation '"' Literal.String ' ' Literal.String 't' Literal.String 'i' Literal.String 'm' Literal.String 'e' Literal.String 's' Literal.String '"' Literal.String ')' Punctuation ' ' Text ':' Operator '\n' Text ' ' Text 'r' Name ' ' Text '==' Operator ' ' Text '0' Literal.Number.Integer ' ' Text '?' Operator ' ' Text '"' Literal.String '"' Literal.String ' ' Text ':' Operator '\n' Text ' ' Text 'r' Name ' ' Text '==' Operator ' ' Text '1' Literal.Number.Integer ' ' Text '?' Operator ' ' Text 's' Name ' ' Text ':' Operator '\n' Text ' ' Text 'RepString' Keyword.Type '(' Punctuation 's' Name ',' Punctuation 'r' Name ')' Punctuation '\n' Text 'end' Keyword '\n' Text '\n' Text '## reversed strings without data movement ##' Comment '\n' Text '\n' Text 'type' Keyword ' ' Text 'RevString' Keyword.Type ' ' Text '<:' Operator ' ' Text 'String' Name '\n' Text ' ' Text 'string' Name '::' Operator 'String' Name '\n' Text 'end' Keyword '\n' Text '\n' Text 'length' Name '(' Punctuation 's' Name '::' Operator 'RevString' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'length' Name '(' Punctuation 's' Name '.' Operator 'string' Name ')' Punctuation '\n' Text 'strlen' Name '(' Punctuation 's' Name '::' Operator 'RevString' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'strlen' Name '(' Punctuation 's' Name '.' Operator 'string' Name ')' Punctuation '\n' Text '\n' Text 'start' Name '(' Punctuation 's' Name '::' Operator 'RevString' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text '(' Punctuation 'n' Name '=' Operator 'length' Name '(' Punctuation 's' Name ')' Punctuation ';' Punctuation ' ' Text 'n' Name '-' Operator 'thisind' Name '(' Punctuation 's' Name '.' Operator 'string' Name ',' Punctuation 'n' Name ')' Punctuation '+' Operator '1' Literal.Number.Integer ')' Punctuation '\n' Text 'function' Keyword ' ' Text 'next' Name '(' Punctuation 's' Name '::' Operator 'RevString' Keyword.Type ',' Punctuation ' ' Text 'i' Name '::' Operator 'Int' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'n' Name ' ' Text '=' Operator ' ' Text 'length' Name '(' Punctuation 's' Name ')' Punctuation ';' Punctuation ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'n' Name '-' Operator 'i' Name '+' Operator '1' Literal.Number.Integer '\n' Text ' ' Text '(' Punctuation 's' Name '.' Operator 'string' Name '[' Punctuation 'j' Name ']' Punctuation ',' Punctuation ' ' Text 'n' Name '-' Operator 'thisind' Name '(' Punctuation 's' Name '.' Operator 'string' Name ',' Punctuation 'j' Name '-' Operator '1' Literal.Number.Integer ')' Punctuation '+' Operator '1' Literal.Number.Integer ')' Punctuation '\n' Text 'end' Keyword '\n' Text '\n' Text 'reverse' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'RevString' Keyword.Type '(' Punctuation 's' Name ')' Punctuation '\n' Text 'reverse' Name '(' Punctuation 's' Name '::' Operator 'RevString' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 's' Name '.' Operator 'string' Name '\n' Text '\n' Text '## ropes for efficient concatenation, etc. ##' Comment '\n' Text '\n' Text '# Idea: instead of this standard binary tree structure,' Comment '\n' Text '# how about we keep an array of substrings, with an' Comment '\n' Text '# offset array. We can do binary search on the offset' Comment '\n' Text '# array so we get O(log(n)) indexing time still, but we' Comment '\n' Text '# can compute the offsets lazily and avoid all the' Comment '\n' Text '# futzing around while the string is being constructed.' Comment '\n' Text '\n' Text 'type' Keyword ' ' Text 'RopeString' Keyword.Type ' ' Text '<:' Operator ' ' Text 'String' Name '\n' Text ' ' Text 'head' Name '::' Operator 'String' Name '\n' Text ' ' Text 'tail' Name '::' Operator 'String' Name '\n' Text ' ' Text 'depth' Name '::' Operator 'Int32' Keyword.Type '\n' Text ' ' Text 'length' Name '::' Operator 'Int' Keyword.Type '\n' Text '\n' Text ' ' Text 'RopeString' Keyword.Type '(' Punctuation 'h' Name '::' Operator 'RopeString' Keyword.Type ',' Punctuation ' ' Text 't' Name '::' Operator 'RopeString' Keyword.Type ')' Punctuation ' ' Text '=' Operator '\n' Text ' ' Text 'depth' Name '(' Punctuation 'h' Name '.' Operator 'tail' Name ')' Punctuation ' ' Text '+' Operator ' ' Text 'depth' Name '(' Punctuation 't' Name ')' Punctuation ' ' Text '<' Operator ' ' Text 'depth' Name '(' Punctuation 'h' Name '.' Operator 'head' Name ')' Punctuation ' ' Text '?' Operator '\n' Text ' ' Text 'RopeString' Keyword.Type '(' Punctuation 'h' Name '.' Operator 'head' Name ',' Punctuation ' ' Text 'RopeString' Keyword.Type '(' Punctuation 'h' Name '.' Operator 'tail' Name ',' Punctuation ' ' Text 't' Name ')' Punctuation ')' Punctuation ' ' Text ':' Operator '\n' Text ' ' Text 'new' Name '(' Punctuation 'h' Name ',' Punctuation ' ' Text 't' Name ',' Punctuation ' ' Text 'max' Name '(' Punctuation 'h' Name '.' Operator 'depth' Name ',' Punctuation 't' Name '.' Operator 'depth' Name ')' Punctuation '+' Operator '1' Literal.Number.Integer ',' Punctuation ' ' Text 'length' Name '(' Punctuation 'h' Name ')' Punctuation '+' Operator 'length' Name '(' Punctuation 't' Name ')' Punctuation ')' Punctuation '\n' Text '\n' Text ' ' Text 'RopeString' Keyword.Type '(' Punctuation 'h' Name '::' Operator 'RopeString' Keyword.Type ',' Punctuation ' ' Text 't' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator '\n' Text ' ' Text 'depth' Name '(' Punctuation 'h' Name '.' Operator 'tail' Name ')' Punctuation ' ' Text '<' Operator ' ' Text 'depth' Name '(' Punctuation 'h' Name '.' Operator 'head' Name ')' Punctuation ' ' Text '?' Operator '\n' Text ' ' Text 'RopeString' Keyword.Type '(' Punctuation 'h' Name '.' Operator 'head' Name ',' Punctuation ' ' Text 'RopeString' Keyword.Type '(' Punctuation 'h' Name '.' Operator 'tail' Name ',' Punctuation ' ' Text 't' Name ')' Punctuation ')' Punctuation ' ' Text ':' Operator '\n' Text ' ' Text 'new' Name '(' Punctuation 'h' Name ',' Punctuation ' ' Text 't' Name ',' Punctuation ' ' Text 'h' Name '.' Operator 'depth' Name '+' Operator '1' Literal.Number.Integer ',' Punctuation ' ' Text 'length' Name '(' Punctuation 'h' Name ')' Punctuation '+' Operator 'length' Name '(' Punctuation 't' Name ')' Punctuation ')' Punctuation '\n' Text '\n' Text ' ' Text 'RopeString' Keyword.Type '(' Punctuation 'h' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 't' Name '::' Operator 'RopeString' Keyword.Type ')' Punctuation ' ' Text '=' Operator '\n' Text ' ' Text 'depth' Name '(' Punctuation 't' Name '.' Operator 'head' Name ')' Punctuation ' ' Text '<' Operator ' ' Text 'depth' Name '(' Punctuation 't' Name '.' Operator 'tail' Name ')' Punctuation ' ' Text '?' Operator '\n' Text ' ' Text 'RopeString' Keyword.Type '(' Punctuation 'RopeString' Keyword.Type '(' Punctuation 'h' Name ',' Punctuation ' ' Text 't' Name '.' Operator 'head' Name ')' Punctuation ',' Punctuation ' ' Text 't' Name '.' Operator 'tail' Name ')' Punctuation ' ' Text ':' Operator '\n' Text ' ' Text 'new' Name '(' Punctuation 'h' Name ',' Punctuation ' ' Text 't' Name ',' Punctuation ' ' Text 't' Name '.' Operator 'depth' Name '+' Operator '1' Literal.Number.Integer ',' Punctuation ' ' Text 'length' Name '(' Punctuation 'h' Name ')' Punctuation '+' Operator 'length' Name '(' Punctuation 't' Name ')' Punctuation ')' Punctuation '\n' Text '\n' Text ' ' Text 'RopeString' Keyword.Type '(' Punctuation 'h' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 't' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator '\n' Text ' ' Text 'new' Name '(' Punctuation 'h' Name ',' Punctuation ' ' Text 't' Name ',' Punctuation ' ' Text '1' Literal.Number.Integer ',' Punctuation ' ' Text 'length' Name '(' Punctuation 'h' Name ')' Punctuation '+' Operator 'length' Name '(' Punctuation 't' Name ')' Punctuation ')' Punctuation '\n' Text 'end' Keyword '\n' Text '\n' Text 'depth' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer '\n' Text 'depth' Name '(' Punctuation 's' Name '::' Operator 'RopeString' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 's' Name '.' Operator 'depth' Name '\n' Text '\n' Text 'function' Keyword ' ' Text 'next' Name '(' Punctuation 's' Name '::' Operator 'RopeString' Keyword.Type ',' Punctuation ' ' Text 'i' Name '::' Operator 'Int' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '<=' Operator ' ' Text 'length' Name '(' Punctuation 's' Name '.' Operator 'head' Name ')' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'next' Name '(' Punctuation 's' Name '.' Operator 'head' Name ',' Punctuation ' ' Text 'i' Name ')' Punctuation '\n' Text ' ' Text 'else' Keyword '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name '.' Operator 'tail' Name ',' Punctuation ' ' Text 'i' Name '-' Operator 'length' Name '(' Punctuation 's' Name '.' Operator 'head' Name ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'c' Name ',' Punctuation ' ' Text 'j' Name '+' Operator 'length' Name '(' Punctuation 's' Name '.' Operator 'head' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text 'end' Keyword '\n' Text '\n' Text 'length' Name '(' Punctuation 's' Name '::' Operator 'RopeString' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 's' Name '.' Operator 'length' Name '\n' Text 'strlen' Name '(' Punctuation 's' Name '::' Operator 'RopeString' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'strlen' Name '(' Punctuation 's' Name '.' Operator 'head' Name ')' Punctuation ' ' Text '+' Operator ' ' Text 'strlen' Name '(' Punctuation 's' Name '.' Operator 'tail' Name ')' Punctuation '\n' Text '\n' Text 'strcat' Name '(' Punctuation ')' Punctuation ' ' Text '=' Operator ' ' Text '"' Literal.String '"' Literal.String '\n' Text 'strcat' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 's' Name '\n' Text 'strcat' Name '(' Punctuation 'x' Name '.' Operator '.' Operator '.' Operator ')' Punctuation ' ' Text '=' Operator ' ' Text 'strcat' Name '(' Punctuation 'map' Name '(' Punctuation 'string' Name ',' Punctuation 'x' Name ')' Punctuation '.' Operator '.' Operator '.' Operator ')' Punctuation '\n' Text 'strcat' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 't' Name '::' Operator 'String' Name '.' Operator '.' Operator '.' Operator ')' Punctuation ' ' Text '=' Operator '\n' Text ' ' Text '(' Punctuation 't' Name ' ' Text '=' Operator ' ' Text 'strcat' Name '(' Punctuation 't' Name '.' Operator '.' Operator '.' Operator ')' Punctuation ';' Punctuation ' ' Text 'isempty' Name '(' Punctuation 's' Name ')' Punctuation ' ' Text '?' Operator ' ' Text 't' Name ' ' Text ':' Operator ' ' Text 'isempty' Name '(' Punctuation 't' Name ')' Punctuation ' ' Text '?' Operator ' ' Text 's' Name ' ' Text ':' Operator ' ' Text 'RopeString' Keyword.Type '(' Punctuation 's' Name ',' Punctuation ' ' Text 't' Name ')' Punctuation ')' Punctuation '\n' Text '\n' Text 'print' Name '(' Punctuation 's' Name '::' Operator 'RopeString' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'print' Name '(' Punctuation 's' Name '.' Operator 'head' Name ',' Punctuation ' ' Text 's' Name '.' Operator 'tail' Name ')' Punctuation '\n' Text '\n' Text '## transformed strings ##' Comment '\n' Text '\n' Text 'type' Keyword ' ' Text 'TransformedString' Name ' ' Text '<:' Operator ' ' Text 'String' Name '\n' Text ' ' Text 'transform' Name '::' Operator 'Function' Keyword.Type '\n' Text ' ' Text 'string' Name '::' Operator 'String' Name '\n' Text 'end' Keyword '\n' Text '\n' Text 'length' Name '(' Punctuation 's' Name '::' Operator 'TransformedString' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'length' Name '(' Punctuation 's' Name '.' Operator 'string' Name ')' Punctuation '\n' Text 'strlen' Name '(' Punctuation 's' Name '::' Operator 'TransformedString' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'strlen' Name '(' Punctuation 's' Name '.' Operator 'string' Name ')' Punctuation '\n' Text '\n' Text 'function' Keyword ' ' Text 'next' Name '(' Punctuation 's' Name '::' Operator 'TransformedString' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Int' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name '.' Operator 'string' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'c' Name ' ' Text '=' Operator ' ' Text 's' Name '.' Operator 'transform' Name '(' Punctuation 'c' Name ',' Punctuation ' ' Text 'i' Name ')' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 'c' Name ',' Punctuation ' ' Text 'j' Name '\n' Text 'end' Keyword '\n' Text '\n' Text '## uppercase and lowercase transformations ##' Comment '\n' Text '\n' Text 'uppercase' Name '(' Punctuation 'c' Name '::' Operator 'Char' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'ccall' Keyword '(' Punctuation ':' Operator 'towupper' Name ',' Punctuation ' ' Text 'Char' Keyword.Type ',' Punctuation ' ' Text '(' Punctuation 'Char' Keyword.Type ',' Punctuation ')' Punctuation ',' Punctuation ' ' Text 'c' Name ')' Punctuation '\n' Text 'lowercase' Name '(' Punctuation 'c' Name '::' Operator 'Char' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'ccall' Keyword '(' Punctuation ':' Operator 'towlower' Name ',' Punctuation ' ' Text 'Char' Keyword.Type ',' Punctuation ' ' Text '(' Punctuation 'Char' Keyword.Type ',' Punctuation ')' Punctuation ',' Punctuation ' ' Text 'c' Name ')' Punctuation '\n' Text '\n' Text 'uppercase' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'TransformedString' Name '(' Punctuation '(' Punctuation 'c' Name ',' Punctuation 'i' Name ')' Punctuation '-' Operator '>' Operator 'uppercase' Name '(' Punctuation 'c' Name ')' Punctuation ',' Punctuation ' ' Text 's' Name ')' Punctuation '\n' Text 'lowercase' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'TransformedString' Name '(' Punctuation '(' Punctuation 'c' Name ',' Punctuation 'i' Name ')' Punctuation '-' Operator '>' Operator 'lowercase' Name '(' Punctuation 'c' Name ')' Punctuation ',' Punctuation ' ' Text 's' Name ')' Punctuation '\n' Text '\n' Text 'ucfirst' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'TransformedString' Name '(' Punctuation '(' Punctuation 'c' Name ',' Punctuation 'i' Name ')' Punctuation '-' Operator '>' Operator 'i' Name '==' Operator '1' Literal.Number.Integer ' ' Text '?' Operator ' ' Text 'uppercase' Name '(' Punctuation 'c' Name ')' Punctuation ' ' Text ':' Operator ' ' Text 'c' Name ',' Punctuation ' ' Text 's' Name ')' Punctuation '\n' Text 'lcfirst' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'TransformedString' Name '(' Punctuation '(' Punctuation 'c' Name ',' Punctuation 'i' Name ')' Punctuation '-' Operator '>' Operator 'i' Name '==' Operator '1' Literal.Number.Integer ' ' Text '?' Operator ' ' Text 'lowercase' Name '(' Punctuation 'c' Name ')' Punctuation ' ' Text ':' Operator ' ' Text 'c' Name ',' Punctuation ' ' Text 's' Name ')' Punctuation '\n' Text '\n' Text 'const' Keyword.Declaration ' ' Text 'uc' Name ' ' Text '=' Operator ' ' Text 'uppercase' Name '\n' Text 'const' Keyword.Declaration ' ' Text 'lc' Name ' ' Text '=' Operator ' ' Text 'lowercase' Name '\n' Text '\n' Text '## string map ##' Comment '\n' Text '\n' Text 'function' Keyword ' ' Text 'map' Name '(' Punctuation 'f' Name '::' Operator 'Function' Keyword.Type ',' Punctuation ' ' Text 's' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'out' Name ' ' Text '=' Operator ' ' Text 'memio' Name '(' Punctuation 'length' Name '(' Punctuation 's' Name ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'for' Keyword ' ' Text 'c' Name ' ' Text 'in' Keyword.Pseudo ' ' Text 's' Name '\n' Text ' ' Text 'write' Name '(' Punctuation 'out' Name ',' Punctuation ' ' Text 'f' Name '(' Punctuation 'c' Name ')' Punctuation '::' Operator 'Char' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'takebuf_string' Name '(' Punctuation 'out' Name ')' Punctuation '\n' Text 'end' Keyword '\n' Text '\n' Text '## conversion of general objects to strings ##' Comment '\n' Text '\n' Text 'string' Name '(' Punctuation 'x' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'print_to_string' Name '(' Punctuation 'show' Name ',' Punctuation ' ' Text 'x' Name ')' Punctuation '\n' Text 'cstring' Name '(' Punctuation 'x' Name '.' Operator '.' Operator '.' Operator ')' Punctuation ' ' Text '=' Operator ' ' Text 'print_to_string' Name '(' Punctuation 'print' Name ',' Punctuation ' ' Text 'x' Name '.' Operator '.' Operator '.' Operator ')' Punctuation '\n' Text '\n' Text 'function' Keyword ' ' Text 'cstring' Name '(' Punctuation 'p' Name '::' Operator 'Ptr' Keyword.Type '{' Punctuation 'Uint8' Name '}' Punctuation ')' Punctuation '\n' Text ' ' Text 'p' Name ' ' Text '==' Operator ' ' Text 'C_NULL' Name.Builtin ' ' Text '?' Operator ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'c' Literal.String 'a' Literal.String 'n' Literal.String 'n' Literal.String 'o' Literal.String 't' Literal.String ' ' Literal.String 'c' Literal.String 'o' Literal.String 'n' Literal.String 'v' Literal.String 'e' Literal.String 'r' Literal.String 't' Literal.String ' ' Literal.String 'N' Literal.String 'U' Literal.String 'L' Literal.String 'L' Literal.String ' ' Literal.String 't' Literal.String 'o' Literal.String ' ' Literal.String 's' Literal.String 't' Literal.String 'r' Literal.String 'i' Literal.String 'n' Literal.String 'g' Literal.String '"' Literal.String ')' Punctuation ' ' Text ':' Operator '\n' Text ' ' Text 'ccall' Keyword '(' Punctuation ':' Operator 'jl_cstr_to_string' Name ',' Punctuation ' ' Text 'Any' Keyword.Type ',' Punctuation ' ' Text '(' Punctuation 'Ptr' Keyword.Type '{' Punctuation 'Uint8' Name '}' Punctuation ',' Punctuation ')' Punctuation ',' Punctuation ' ' Text 'p' Name ')' Punctuation '::' Operator 'ByteString' Name '\n' Text 'end' Keyword '\n' Text '\n' Text '## string promotion rules ##' Comment '\n' Text '\n' Text 'promote_rule' Name '(' Punctuation '::' Operator 'Type' Keyword.Type '{' Punctuation 'UTF8String' Keyword.Type '}' Punctuation ' ' Text ',' Punctuation ' ' Text '::' Operator 'Type' Keyword.Type '{' Punctuation 'ASCIIString' Keyword.Type '}' Punctuation ')' Punctuation ' ' Text '=' Operator ' ' Text 'UTF8String' Keyword.Type '\n' Text 'promote_rule' Name '(' Punctuation '::' Operator 'Type' Keyword.Type '{' Punctuation 'UTF8String' Keyword.Type '}' Punctuation ' ' Text ',' Punctuation ' ' Text '::' Operator 'Type' Keyword.Type '{' Punctuation 'CharString' Name '}' Punctuation ' ' Text ')' Punctuation ' ' Text '=' Operator ' ' Text 'UTF8String' Keyword.Type '\n' Text 'promote_rule' Name '(' Punctuation '::' Operator 'Type' Keyword.Type '{' Punctuation 'ASCIIString' Keyword.Type '}' Punctuation ',' Punctuation ' ' Text '::' Operator 'Type' Keyword.Type '{' Punctuation 'CharString' Name '}' Punctuation ' ' Text ')' Punctuation ' ' Text '=' Operator ' ' Text 'UTF8String' Keyword.Type '\n' Text '\n' Text '## printing literal quoted string data ##' Comment '\n' Text '\n' Text '# TODO: this is really the inverse of print_unbackslashed' Comment '\n' Text '\n' Text 'function' Keyword ' ' Text 'print_quoted_literal' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'print' Name '(' Punctuation '\'"\'' Literal.String.Char ')' Punctuation '\n' Text ' ' Text 'for' Keyword ' ' Text 'c' Name ' ' Text '=' Operator ' ' Text 's' Name ';' Punctuation ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text '\'"\'' Literal.String.Char ' ' Text '?' Operator ' ' Text 'print' Name '(' Punctuation '"' Literal.String '\\\\' Literal.String.Escape '\\"' Literal.String.Escape '"' Literal.String ')' Punctuation ' ' Text ':' Operator ' ' Text 'print' Name '(' Punctuation 'c' Name ')' Punctuation ';' Punctuation ' ' Text 'end' Keyword '\n' Text ' ' Text 'print' Name '(' Punctuation '\'"\'' Literal.String.Char ')' Punctuation '\n' Text 'end' Keyword '\n' Text '\n' Text '## string escaping & unescaping ##' Comment '\n' Text '\n' Text 'escape_nul' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Int' Keyword.Type ')' Punctuation ' ' Text '=' Operator '\n' Text ' ' Text '!' Operator 'done' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation ' ' Text '&&' Operator ' ' Text "'0'" Literal.String.Char ' ' Text '<=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ' ' Text '<=' Operator ' ' Text "'7'" Literal.String.Char ' ' Text '?' Operator ' ' Text 'L' Name '"' Literal.String '\\x00' Literal.String.Escape '"' Literal.String ' ' Text ':' Operator ' ' Text 'L' Name '"' Literal.String '\\0' Literal.String.Escape '"' Literal.String '\n' Text '\n' Text 'is_hex_digit' Name '(' Punctuation 'c' Name '::' Operator 'Char' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text "'0'" Literal.String.Char '<=' Operator 'c' Name '<=' Operator "'9'" Literal.String.Char ' ' Text '||' Operator ' ' Text "'a'" Literal.String.Char '<=' Operator 'c' Name '<=' Operator "'f'" Literal.String.Char ' ' Text '||' Operator ' ' Text "'A'" Literal.String.Char '<=' Operator 'c' Name '<=' Operator "'F'" Literal.String.Char '\n' Text 'need_full_hex' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'i' Name '::' Operator 'Int' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text '!' Operator 'done' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation ' ' Text '&&' Operator ' ' Text 'is_hex_digit' Name '(' Punctuation 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ')' Punctuation '\n' Text '\n' Text 'function' Keyword ' ' Text 'print_escaped' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'esc' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'start' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text '!' Operator 'done' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'\\0'" Literal.String.Char ' ' Text '?' Operator ' ' Text 'print' Name '(' Punctuation 'escape_nul' Name '(' Punctuation 's' Name ',' Punctuation 'j' Name ')' Punctuation ')' Punctuation ' ' Text ':' Operator '\n' Text ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'\\e'" Literal.String.Char ' ' Text '?' Operator ' ' Text 'print' Name '(' Punctuation 'L' Name '"' Literal.String '\\' Literal.String 'e' Literal.String '"' Literal.String ')' Punctuation ' ' Text ':' Operator '\n' Text ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'\\\\'" Literal.String.Char ' ' Text '?' Operator ' ' Text 'print' Name '(' Punctuation '"' Literal.String '\\\\' Literal.String.Escape '\\\\' Literal.String.Escape '"' Literal.String ')' Punctuation ' ' Text ':' Operator '\n' Text ' ' Text 'contains' Name '(' Punctuation 'esc' Name ',' Punctuation 'c' Name ')' Punctuation ' ' Text '?' Operator ' ' Text 'print' Name '(' Punctuation "'\\\\'" Literal.String.Char ',' Punctuation ' ' Text 'c' Name ')' Punctuation ' ' Text ':' Operator '\n' Text ' ' Text 'iswprint' Name '(' Punctuation 'c' Name ')' Punctuation ' ' Text '?' Operator ' ' Text 'print' Name '(' Punctuation 'c' Name ')' Punctuation ' ' Text ':' Operator '\n' Text ' ' Text '7' Literal.Number.Integer ' ' Text '<=' Operator ' ' Text 'c' Name ' ' Text '<=' Operator ' ' Text '13' Literal.Number.Integer ' ' Text '?' Operator ' ' Text 'print' Name '(' Punctuation "'\\\\'" Literal.String.Char ',' Punctuation ' ' Text '"' Literal.String 'a' Literal.String 'b' Literal.String 't' Literal.String 'n' Literal.String 'v' Literal.String 'f' Literal.String 'r' Literal.String '"' Literal.String '[' Punctuation 'c' Name '-' Operator '6' Literal.Number.Integer ']' Punctuation ')' Punctuation ' ' Text ':' Operator '\n' Text ' ' Text 'c' Name ' ' Text '<=' Operator ' ' Text "'\\x7f'" Literal.String.Char ' ' Text '?' Operator ' ' Text 'print' Name '(' Punctuation 'L' Name '"' Literal.String '\\' Literal.String 'x' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'hex' Name '(' Punctuation 'c' Name ',' Punctuation ' ' Text '2' Literal.Number.Integer ')' Punctuation ')' Punctuation ' ' Text ':' Operator '\n' Text ' ' Text 'c' Name ' ' Text '<=' Operator ' ' Text "'\\uffff'" Literal.String.Char ' ' Text '?' Operator ' ' Text 'print' Name '(' Punctuation 'L' Name '"' Literal.String '\\' Literal.String 'u' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'hex' Name '(' Punctuation 'c' Name ',' Punctuation ' ' Text 'need_full_hex' Name '(' Punctuation 's' Name ',' Punctuation 'j' Name ')' Punctuation ' ' Text '?' Operator ' ' Text '4' Literal.Number.Integer ' ' Text ':' Operator ' ' Text '2' Literal.Number.Integer ')' Punctuation ')' Punctuation ' ' Text ':' Operator '\n' Text ' ' Text 'print' Name '(' Punctuation 'L' Name '"' Literal.String '\\' Literal.String 'U' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'hex' Name '(' Punctuation 'c' Name ',' Punctuation ' ' Text 'need_full_hex' Name '(' Punctuation 's' Name ',' Punctuation 'j' Name ')' Punctuation ' ' Text '?' Operator ' ' Text '8' Literal.Number.Integer ' ' Text ':' Operator ' ' Text '4' Literal.Number.Integer ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'j' Name '\n' Text ' ' Text 'end' Keyword '\n' Text 'end' Keyword '\n' Text '\n' Text 'escape_string' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'print_to_string' Name '(' Punctuation 'length' Name '(' Punctuation 's' Name ')' Punctuation ',' Punctuation ' ' Text 'print_escaped' Name ',' Punctuation ' ' Text 's' Name ',' Punctuation ' ' Text '"' Literal.String '\\"' Literal.String.Escape '"' Literal.String ')' Punctuation '\n' Text 'print_quoted' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '(' Punctuation 'print' Name '(' Punctuation '\'"\'' Literal.String.Char ')' Punctuation ';' Punctuation ' ' Text 'print_escaped' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text '"' Literal.String '\\"' Literal.String.Escape '\\$' Literal.String.Escape '"' Literal.String ')' Punctuation ';' Punctuation ' ' Text 'print' Name '(' Punctuation '\'"\'' Literal.String.Char ')' Punctuation ')' Punctuation '\n' Text '#" # work around syntax highlighting problem' Comment '\n' Text 'quote_string' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'print_to_string' Name '(' Punctuation 'length' Name '(' Punctuation 's' Name ')' Punctuation '+' Operator '2' Literal.Number.Integer ',' Punctuation ' ' Text 'print_quoted' Name ',' Punctuation ' ' Text 's' Name ')' Punctuation '\n' Text '\n' Text '# bare minimum unescaping function unescapes only given characters' Comment '\n' Text '\n' Text 'function' Keyword ' ' Text 'print_unescaped_chars' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'esc' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator 'contains' Name '(' Punctuation 'esc' Name ',' Punctuation "'\\\\'" Literal.String.Char ')' Punctuation '\n' Text ' ' Text 'esc' Name ' ' Text '=' Operator ' ' Text 'strcat' Name '(' Punctuation '"' Literal.String '\\\\' Literal.String.Escape '"' Literal.String ',' Punctuation ' ' Text 'esc' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'start' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text '!' Operator 'done' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'\\\\'" Literal.String.Char ' ' Text '&&' Operator ' ' Text '!' Operator 'done' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation ' ' Text '&&' Operator ' ' Text 'contains' Name '(' Punctuation 'esc' Name ',' Punctuation 's' Name '[' Punctuation 'i' Name ']' Punctuation ')' Punctuation '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'print' Name '(' Punctuation 'c' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text 'end' Keyword '\n' Text '\n' Text 'unescape_chars' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'esc' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator '\n' Text ' ' Text 'print_to_string' Name '(' Punctuation 'length' Name '(' Punctuation 's' Name ')' Punctuation ',' Punctuation ' ' Text 'print_unescaped_chars' Name ',' Punctuation ' ' Text 's' Name ',' Punctuation ' ' Text 'esc' Name ')' Punctuation '\n' Text '\n' Text '# general unescaping of traditional C and Unicode escape sequences' Comment '\n' Text '\n' Text 'function' Keyword ' ' Text 'print_unescaped' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'start' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text '!' Operator 'done' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator 'done' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation ' ' Text '&&' Operator ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'\\\\'" Literal.String.Char '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'x'" Literal.String.Char ' ' Text '||' Operator ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'u'" Literal.String.Char ' ' Text '||' Operator ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'U'" Literal.String.Char '\n' Text ' ' Text 'n' Name ' ' Text '=' Operator ' ' Text 'k' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer '\n' Text ' ' Text 'm' Name ' ' Text '=' Operator ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'x'" Literal.String.Char ' ' Text '?' Operator ' ' Text '2' Literal.Number.Integer ' ' Text ':' Operator '\n' Text ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'u'" Literal.String.Char ' ' Text '?' Operator ' ' Text '4' Literal.Number.Integer ' ' Text ':' Operator ' ' Text '8' Literal.Number.Integer '\n' Text ' ' Text 'while' Keyword ' ' Text '(' Punctuation 'k' Name '+=' Operator '1' Literal.Number.Integer ')' Punctuation ' ' Text '<=' Operator ' ' Text 'm' Name ' ' Text '&&' Operator ' ' Text '!' Operator 'done' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'n' Name ' ' Text '=' Operator ' ' Text "'0'" Literal.String.Char ' ' Text '<=' Operator ' ' Text 'c' Name ' ' Text '<=' Operator ' ' Text "'9'" Literal.String.Char ' ' Text '?' Operator ' ' Text 'n' Name '<<' Operator '4' Literal.Number.Integer ' ' Text '+' Operator ' ' Text 'c' Name '-' Operator "'0'" Literal.String.Char ' ' Text ':' Operator '\n' Text ' ' Text "'a'" Literal.String.Char ' ' Text '<=' Operator ' ' Text 'c' Name ' ' Text '<=' Operator ' ' Text "'f'" Literal.String.Char ' ' Text '?' Operator ' ' Text 'n' Name '<<' Operator '4' Literal.Number.Integer ' ' Text '+' Operator ' ' Text 'c' Name '-' Operator "'a'" Literal.String.Char '+' Operator '10' Literal.Number.Integer ' ' Text ':' Operator '\n' Text ' ' Text "'A'" Literal.String.Char ' ' Text '<=' Operator ' ' Text 'c' Name ' ' Text '<=' Operator ' ' Text "'F'" Literal.String.Char ' ' Text '?' Operator ' ' Text 'n' Name '<<' Operator '4' Literal.Number.Integer ' ' Text '+' Operator ' ' Text 'c' Name '-' Operator "'A'" Literal.String.Char '+' Operator '10' Literal.Number.Integer ' ' Text ':' Operator ' ' Text 'break' Keyword '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'j' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'if' Keyword ' ' Text 'k' Name ' ' Text '==' Operator ' ' Text '1' Literal.Number.Integer '\n' Text ' ' Text 'error' Name '(' Punctuation '"' Literal.String '\\\\' Literal.String.Escape 'x' Literal.String ' ' Literal.String 'u' Literal.String 's' Literal.String 'e' Literal.String 'd' Literal.String ' ' Literal.String 'w' Literal.String 'i' Literal.String 't' Literal.String 'h' Literal.String ' ' Literal.String 'n' Literal.String 'o' Literal.String ' ' Literal.String 'f' Literal.String 'o' Literal.String 'l' Literal.String 'l' Literal.String 'o' Literal.String 'w' Literal.String 'i' Literal.String 'n' Literal.String 'g' Literal.String ' ' Literal.String 'h' Literal.String 'e' Literal.String 'x' Literal.String ' ' Literal.String 'd' Literal.String 'i' Literal.String 'g' Literal.String 'i' Literal.String 't' Literal.String 's' Literal.String '"' Literal.String ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'if' Keyword ' ' Text 'm' Name ' ' Text '==' Operator ' ' Text '2' Literal.Number.Integer ' ' Text '# \\x escape sequence' Comment '\n' Text ' ' Text 'write' Name '(' Punctuation 'uint8' Name '(' Punctuation 'n' Name ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'else' Keyword '\n' Text ' ' Text 'print' Name '(' Punctuation 'char' Name '(' Punctuation 'n' Name ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'elseif' Keyword ' ' Text "'0'" Literal.String.Char ' ' Text '<=' Operator ' ' Text 'c' Name ' ' Text '<=' Operator ' ' Text "'7'" Literal.String.Char '\n' Text ' ' Text 'k' Name ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer '\n' Text ' ' Text 'n' Name ' ' Text '=' Operator ' ' Text 'c' Name '-' Operator "'0'" Literal.String.Char '\n' Text ' ' Text 'while' Keyword ' ' Text '(' Punctuation 'k' Name '+=' Operator '1' Literal.Number.Integer ')' Punctuation ' ' Text '<=' Operator ' ' Text '3' Literal.Number.Integer ' ' Text '&&' Operator ' ' Text '!' Operator 'done' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'n' Name ' ' Text '=' Operator ' ' Text "'0'" Literal.String.Char ' ' Text '<=' Operator ' ' Text 'c' Name ' ' Text '<=' Operator ' ' Text "'7'" Literal.String.Char ' ' Text '?' Operator ' ' Text 'n' Name '<<' Operator '3' Literal.Number.Integer ' ' Text '+' Operator ' ' Text 'c' Name '-' Operator "'0'" Literal.String.Char ' ' Text ':' Operator ' ' Text 'break' Keyword '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'j' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'if' Keyword ' ' Text 'n' Name ' ' Text '>' Operator ' ' Text '255' Literal.Number.Integer '\n' Text ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'o' Literal.String 'c' Literal.String 't' Literal.String 'a' Literal.String 'l' Literal.String ' ' Literal.String 'e' Literal.String 's' Literal.String 'c' Literal.String 'a' Literal.String 'p' Literal.String 'e' Literal.String ' ' Literal.String 's' Literal.String 'e' Literal.String 'q' Literal.String 'u' Literal.String 'e' Literal.String 'n' Literal.String 'c' Literal.String 'e' Literal.String ' ' Literal.String 'o' Literal.String 'u' Literal.String 't' Literal.String ' ' Literal.String 'o' Literal.String 'f' Literal.String ' ' Literal.String 'r' Literal.String 'a' Literal.String 'n' Literal.String 'g' Literal.String 'e' Literal.String '"' Literal.String ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'write' Name '(' Punctuation 'uint8' Name '(' Punctuation 'n' Name ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'else' Keyword '\n' Text ' ' Text 'print' Name '(' Punctuation 'c' Name ' ' Text '==' Operator ' ' Text "'a'" Literal.String.Char ' ' Text '?' Operator ' ' Text "'\\a'" Literal.String.Char ' ' Text ':' Operator '\n' Text ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'b'" Literal.String.Char ' ' Text '?' Operator ' ' Text "'\\b'" Literal.String.Char ' ' Text ':' Operator '\n' Text ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'t'" Literal.String.Char ' ' Text '?' Operator ' ' Text "'\\t'" Literal.String.Char ' ' Text ':' Operator '\n' Text ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'n'" Literal.String.Char ' ' Text '?' Operator ' ' Text "'\\n'" Literal.String.Char ' ' Text ':' Operator '\n' Text ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'v'" Literal.String.Char ' ' Text '?' Operator ' ' Text "'\\v'" Literal.String.Char ' ' Text ':' Operator '\n' Text ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'f'" Literal.String.Char ' ' Text '?' Operator ' ' Text "'\\f'" Literal.String.Char ' ' Text ':' Operator '\n' Text ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'r'" Literal.String.Char ' ' Text '?' Operator ' ' Text "'\\r'" Literal.String.Char ' ' Text ':' Operator '\n' Text ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'e'" Literal.String.Char ' ' Text '?' Operator ' ' Text "'\\e'" Literal.String.Char ' ' Text ':' Operator ' ' Text 'c' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'else' Keyword '\n' Text ' ' Text 'print' Name '(' Punctuation 'c' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text 'end' Keyword '\n' Text '\n' Text 'unescape_string' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'print_to_string' Name '(' Punctuation 'length' Name '(' Punctuation 's' Name ')' Punctuation ',' Punctuation ' ' Text 'print_unescaped' Name ',' Punctuation ' ' Text 's' Name ')' Punctuation '\n' Text '\n' Text '## checking UTF-8 & ACSII validity ##' Comment '\n' Text '\n' Text 'byte_string_classify' Name '(' Punctuation 's' Name '::' Operator 'ByteString' Name ')' Punctuation ' ' Text '=' Operator '\n' Text ' ' Text 'ccall' Keyword '(' Punctuation ':' Operator 'u8_isvalid' Name ',' Punctuation ' ' Text 'Int32' Keyword.Type ',' Punctuation ' ' Text '(' Punctuation 'Ptr' Keyword.Type '{' Punctuation 'Uint8' Name '}' Punctuation ',' Punctuation ' ' Text 'Int' Keyword.Type ')' Punctuation ',' Punctuation ' ' Text 's' Name '.' Operator 'data' Name ',' Punctuation ' ' Text 'length' Name '(' Punctuation 's' Name ')' Punctuation ')' Punctuation '\n' Text ' ' Text '# 0: neither valid ASCII nor UTF-8' Comment '\n' Text ' ' Text '# 1: valid ASCII' Comment '\n' Text ' ' Text '# 2: valid UTF-8' Comment '\n' Text '\n' Text 'is_valid_ascii' Name '(' Punctuation 's' Name '::' Operator 'ByteString' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'byte_string_classify' Name '(' Punctuation 's' Name ')' Punctuation ' ' Text '==' Operator ' ' Text '1' Literal.Number.Integer '\n' Text 'is_valid_utf8' Name ' ' Text '(' Punctuation 's' Name '::' Operator 'ByteString' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'byte_string_classify' Name '(' Punctuation 's' Name ')' Punctuation ' ' Text '!=' Operator ' ' Text '0' Literal.Number.Integer '\n' Text '\n' Text 'check_ascii' Name '(' Punctuation 's' Name '::' Operator 'ByteString' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'is_valid_ascii' Name '(' Punctuation 's' Name ')' Punctuation ' ' Text '?' Operator ' ' Text 's' Name ' ' Text ':' Operator ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'i' Literal.String 'n' Literal.String 'v' Literal.String 'a' Literal.String 'l' Literal.String 'i' Literal.String 'd' Literal.String ' ' Literal.String 'A' Literal.String 'S' Literal.String 'C' Literal.String 'I' Literal.String 'I' Literal.String ' ' Literal.String 's' Literal.String 'e' Literal.String 'q' Literal.String 'u' Literal.String 'e' Literal.String 'n' Literal.String 'c' Literal.String 'e' Literal.String '"' Literal.String ')' Punctuation '\n' Text 'check_utf8' Name ' ' Text '(' Punctuation 's' Name '::' Operator 'ByteString' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'is_valid_utf8' Name '(' Punctuation 's' Name ')' Punctuation ' ' Text '?' Operator ' ' Text 's' Name ' ' Text ':' Operator ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'i' Literal.String 'n' Literal.String 'v' Literal.String 'a' Literal.String 'l' Literal.String 'i' Literal.String 'd' Literal.String ' ' Literal.String 'U' Literal.String 'T' Literal.String 'F' Literal.String '-' Literal.String '8' Literal.String ' ' Literal.String 's' Literal.String 'e' Literal.String 'q' Literal.String 'u' Literal.String 'e' Literal.String 'n' Literal.String 'c' Literal.String 'e' Literal.String '"' Literal.String ')' Punctuation '\n' Text '\n' Text '## string interpolation parsing ##' Comment '\n' Text '\n' Text 'function' Keyword ' ' Text '_jl_interp_parse' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'unescape' Name '::' Operator 'Function' Keyword.Type ',' Punctuation ' ' Text 'printer' Name '::' Operator 'Function' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'sx' Name ' ' Text '=' Operator ' ' Text '{' Punctuation '}' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'start' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text '!' Operator 'done' Name '(' Punctuation 's' Name ',' Punctuation 'j' Name ')' Punctuation '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'k' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'j' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'$'" Literal.String.Char '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator 'isempty' Name '(' Punctuation 's' Name '[' Punctuation 'i' Name ':' Operator 'j' Name '-' Operator '1' Literal.Number.Integer ']' Punctuation ')' Punctuation '\n' Text ' ' Text 'push' Name '(' Punctuation 'sx' Name ',' Punctuation ' ' Text 'unescape' Name '(' Punctuation 's' Name '[' Punctuation 'i' Name ':' Operator 'j' Name '-' Operator '1' Literal.Number.Integer ']' Punctuation ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'ex' Name ',' Punctuation ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'parseatom' Name '(' Punctuation 's' Name ',' Punctuation 'k' Name ')' Punctuation '\n' Text ' ' Text 'push' Name '(' Punctuation 'sx' Name ',' Punctuation ' ' Text 'ex' Name ')' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'j' Name '\n' Text ' ' Text 'elseif' Keyword ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'\\\\'" Literal.String.Char ' ' Text '&&' Operator ' ' Text '!' Operator 'done' Name '(' Punctuation 's' Name ',' Punctuation 'k' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 's' Name '[' Punctuation 'k' Name ']' Punctuation ' ' Text '==' Operator ' ' Text "'$'" Literal.String.Char '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator 'isempty' Name '(' Punctuation 's' Name '[' Punctuation 'i' Name ':' Operator 'j' Name '-' Operator '1' Literal.Number.Integer ']' Punctuation ')' Punctuation '\n' Text ' ' Text 'push' Name '(' Punctuation 'sx' Name ',' Punctuation ' ' Text 'unescape' Name '(' Punctuation 's' Name '[' Punctuation 'i' Name ':' Operator 'j' Name '-' Operator '1' Literal.Number.Integer ']' Punctuation ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'k' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'k' Name ')' Punctuation '\n' Text ' ' Text 'else' Keyword '\n' Text ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'k' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator 'isempty' Name '(' Punctuation 's' Name '[' Punctuation 'i' Name ':' Operator ']' Punctuation ')' Punctuation '\n' Text ' ' Text 'push' Name '(' Punctuation 'sx' Name ',' Punctuation ' ' Text 'unescape' Name '(' Punctuation 's' Name '[' Punctuation 'i' Name ':' Operator 'j' Name '-' Operator '1' Literal.Number.Integer ']' Punctuation ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'length' Name '(' Punctuation 'sx' Name ')' Punctuation ' ' Text '==' Operator ' ' Text '1' Literal.Number.Integer ' ' Text '&&' Operator ' ' Text 'isa' Keyword.Pseudo '(' Punctuation 'sx' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ',' Punctuation 'ByteString' Name ')' Punctuation ' ' Text '?' Operator ' ' Text 'sx' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ' ' Text ':' Operator '\n' Text ' ' Text 'expr' Name '(' Punctuation ':' Operator 'call' Name ',' Punctuation ' ' Text ':' Operator 'print_to_string' Name ',' Punctuation ' ' Text 'printer' Name ',' Punctuation ' ' Text 'sx' Name '.' Operator '.' Operator '.' Operator ')' Punctuation '\n' Text 'end' Keyword '\n' Text '\n' Text '_jl_interp_parse' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'u' Name '::' Operator 'Function' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text '_jl_interp_parse' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text 'u' Name ',' Punctuation ' ' Text 'print' Name ')' Punctuation '\n' Text '_jl_interp_parse' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '_jl_interp_parse' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text 'x' Name '-' Operator '>' Operator 'check_utf8' Name '(' Punctuation 'unescape_string' Name '(' Punctuation 'x' Name ')' Punctuation ')' Punctuation ')' Punctuation '\n' Text '\n' Text 'function' Keyword ' ' Text '_jl_interp_parse_bytes' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'writer' Name '(' Punctuation 'x' Name '.' Operator '.' Operator '.' Operator ')' Punctuation ' ' Text '=' Operator ' ' Text 'for' Keyword ' ' Text 'w' Name '=' Operator 'x' Name ';' Punctuation ' ' Text 'write' Name '(' Punctuation 'w' Name ')' Punctuation ';' Punctuation ' ' Text 'end' Keyword '\n' Text ' ' Text '_jl_interp_parse' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text 'unescape_string' Name ',' Punctuation ' ' Text 'writer' Name ')' Punctuation '\n' Text 'end' Keyword '\n' Text '\n' Text '## core string macros ##' Comment '\n' Text '\n' Text 'macro' Keyword ' ' Text 'str' Name '(' Punctuation 's' Name ')' Punctuation ';' Punctuation ' ' Text '_jl_interp_parse' Name '(' Punctuation 's' Name ')' Punctuation ';' Punctuation ' ' Text 'end' Keyword '\n' Text 'macro' Keyword ' ' Text 'S_str' Name '(' Punctuation 's' Name ')' Punctuation ';' Punctuation ' ' Text '_jl_interp_parse' Name '(' Punctuation 's' Name ')' Punctuation ';' Punctuation ' ' Text 'end' Keyword '\n' Text 'macro' Keyword ' ' Text 'I_str' Name '(' Punctuation 's' Name ')' Punctuation ';' Punctuation ' ' Text '_jl_interp_parse' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text 'x' Name '-' Operator '>' Operator 'unescape_chars' Name '(' Punctuation 'x' Name ',' Punctuation '"' Literal.String '\\"' Literal.String.Escape '"' Literal.String ')' Punctuation ')' Punctuation ';' Punctuation ' ' Text 'end' Keyword '\n' Text 'macro' Keyword ' ' Text 'E_str' Name '(' Punctuation 's' Name ')' Punctuation ';' Punctuation ' ' Text 'check_utf8' Name '(' Punctuation 'unescape_string' Name '(' Punctuation 's' Name ')' Punctuation ')' Punctuation ';' Punctuation ' ' Text 'end' Keyword '\n' Text 'macro' Keyword ' ' Text 'B_str' Name '(' Punctuation 's' Name ')' Punctuation ';' Punctuation ' ' Text '_jl_interp_parse_bytes' Name '(' Punctuation 's' Name ')' Punctuation ';' Punctuation ' ' Text 'end' Keyword '\n' Text 'macro' Keyword ' ' Text 'b_str' Name '(' Punctuation 's' Name ')' Punctuation ';' Punctuation ' ' Text 'ex' Name ' ' Text '=' Operator ' ' Text '_jl_interp_parse_bytes' Name '(' Punctuation 's' Name ')' Punctuation ';' Punctuation ' ' Text ':' Operator '(' Punctuation '(' Punctuation '$' Operator 'ex' Name ')' Punctuation '.' Operator 'data' Name ')' Punctuation ';' Punctuation ' ' Text 'end' Keyword '\n' Text '\n' Text '## shell-like command parsing ##' Comment '\n' Text '\n' Text 'function' Keyword ' ' Text '_jl_shell_parse' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'interp' Name '::' Operator 'Bool' Keyword.Type ')' Punctuation '\n' Text '\n' Text ' ' Text 'in_single_quotes' Name ' ' Text '=' Operator ' ' Text 'false' Keyword.Constant '\n' Text ' ' Text 'in_double_quotes' Name ' ' Text '=' Operator ' ' Text 'false' Keyword.Constant '\n' Text '\n' Text ' ' Text 'args' Name ' ' Text '=' Operator ' ' Text '{' Punctuation '}' Punctuation '\n' Text ' ' Text 'arg' Name ' ' Text '=' Operator ' ' Text '{' Punctuation '}' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'start' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'i' Name '\n' Text '\n' Text ' ' Text 'function' Keyword ' ' Text 'update_arg' Name '(' Punctuation 'x' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator 'isa' Keyword.Pseudo '(' Punctuation 'x' Name ',' Punctuation 'String' Name ')' Punctuation ' ' Text '||' Operator ' ' Text '!' Operator 'isempty' Name '(' Punctuation 'x' Name ')' Punctuation '\n' Text ' ' Text 'push' Name '(' Punctuation 'arg' Name ',' Punctuation ' ' Text 'x' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'function' Keyword ' ' Text 'append_arg' Name '(' Punctuation ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'isempty' Name '(' Punctuation 'arg' Name ')' Punctuation ';' Punctuation ' ' Text 'arg' Name ' ' Text '=' Operator ' ' Text '{' Punctuation '"' Literal.String '"' Literal.String ',' Punctuation '}' Punctuation ';' Punctuation ' ' Text 'end' Keyword '\n' Text ' ' Text 'push' Name '(' Punctuation 'args' Name ',' Punctuation ' ' Text 'arg' Name ')' Punctuation '\n' Text ' ' Text 'arg' Name ' ' Text '=' Operator ' ' Text '{' Punctuation '}' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text '\n' Text ' ' Text 'while' Keyword ' ' Text '!' Operator 'done' Name '(' Punctuation 's' Name ',' Punctuation 'j' Name ')' Punctuation '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'k' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'j' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator 'in_single_quotes' Name ' ' Text '&&' Operator ' ' Text '!' Operator 'in_double_quotes' Name ' ' Text '&&' Operator ' ' Text 'iswspace' Name '(' Punctuation 'c' Name ')' Punctuation '\n' Text ' ' Text 'update_arg' Name '(' Punctuation 's' Name '[' Punctuation 'i' Name ':' Operator 'j' Name '-' Operator '1' Literal.Number.Integer ']' Punctuation ')' Punctuation '\n' Text ' ' Text 'append_arg' Name '(' Punctuation ')' Punctuation '\n' Text ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'k' Name '\n' Text ' ' Text 'while' Keyword ' ' Text '!' Operator 'done' Name '(' Punctuation 's' Name ',' Punctuation 'j' Name ')' Punctuation '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'k' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'j' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator 'iswspace' Name '(' Punctuation 'c' Name ')' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'j' Name '\n' Text ' ' Text 'break' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'k' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'elseif' Keyword ' ' Text 'interp' Name ' ' Text '&&' Operator ' ' Text '!' Operator 'in_single_quotes' Name ' ' Text '&&' Operator ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'$'" Literal.String.Char '\n' Text ' ' Text 'update_arg' Name '(' Punctuation 's' Name '[' Punctuation 'i' Name ':' Operator 'j' Name '-' Operator '1' Literal.Number.Integer ']' Punctuation ')' Punctuation ';' Punctuation ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'k' Name ';' Punctuation ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'k' Name '\n' Text ' ' Text 'if' Keyword ' ' Text 'done' Name '(' Punctuation 's' Name ',' Punctuation 'k' Name ')' Punctuation '\n' Text ' ' Text 'error' Name '(' Punctuation '"' Literal.String '\\$' Literal.String.Escape ' ' Literal.String 'r' Literal.String 'i' Literal.String 'g' Literal.String 'h' Literal.String 't' Literal.String ' ' Literal.String 'b' Literal.String 'e' Literal.String 'f' Literal.String 'o' Literal.String 'r' Literal.String 'e' Literal.String ' ' Literal.String 'e' Literal.String 'n' Literal.String 'd' Literal.String ' ' Literal.String 'o' Literal.String 'f' Literal.String ' ' Literal.String 'c' Literal.String 'o' Literal.String 'm' Literal.String 'm' Literal.String 'a' Literal.String 'n' Literal.String 'd' Literal.String '"' Literal.String ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'if' Keyword ' ' Text 'iswspace' Name '(' Punctuation 's' Name '[' Punctuation 'k' Name ']' Punctuation ')' Punctuation '\n' Text ' ' Text 'error' Name '(' Punctuation '"' Literal.String 's' Literal.String 'p' Literal.String 'a' Literal.String 'c' Literal.String 'e' Literal.String ' ' Literal.String 'n' Literal.String 'o' Literal.String 't' Literal.String ' ' Literal.String 'a' Literal.String 'l' Literal.String 'l' Literal.String 'o' Literal.String 'w' Literal.String 'e' Literal.String 'd' Literal.String ' ' Literal.String 'r' Literal.String 'i' Literal.String 'g' Literal.String 'h' Literal.String 't' Literal.String ' ' Literal.String 'a' Literal.String 'f' Literal.String 't' Literal.String 'e' Literal.String 'r' Literal.String ' ' Literal.String '\\$' Literal.String.Escape '"' Literal.String ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'ex' Name ',' Punctuation ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'parseatom' Name '(' Punctuation 's' Name ',' Punctuation 'j' Name ')' Punctuation '\n' Text ' ' Text 'update_arg' Name '(' Punctuation 'ex' Name ')' Punctuation ';' Punctuation ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'j' Name '\n' Text ' ' Text 'else' Keyword '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator 'in_double_quotes' Name ' ' Text '&&' Operator ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'\\''" Literal.String.Char '\n' Text ' ' Text 'in_single_quotes' Name ' ' Text '=' Operator ' ' Text '!' Operator 'in_single_quotes' Name '\n' Text ' ' Text 'update_arg' Name '(' Punctuation 's' Name '[' Punctuation 'i' Name ':' Operator 'j' Name '-' Operator '1' Literal.Number.Integer ']' Punctuation ')' Punctuation ';' Punctuation ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'k' Name '\n' Text ' ' Text 'elseif' Keyword ' ' Text '!' Operator 'in_single_quotes' Name ' ' Text '&&' Operator ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text '\'"\'' Literal.String.Char '\n' Text ' ' Text 'in_double_quotes' Name ' ' Text '=' Operator ' ' Text '!' Operator 'in_double_quotes' Name '\n' Text ' ' Text 'update_arg' Name '(' Punctuation 's' Name '[' Punctuation 'i' Name ':' Operator 'j' Name '-' Operator '1' Literal.Number.Integer ']' Punctuation ')' Punctuation ';' Punctuation ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'k' Name '\n' Text ' ' Text 'elseif' Keyword ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'\\\\'" Literal.String.Char '\n' Text ' ' Text 'if' Keyword ' ' Text 'in_double_quotes' Name '\n' Text ' ' Text 'if' Keyword ' ' Text 'done' Name '(' Punctuation 's' Name ',' Punctuation 'k' Name ')' Punctuation '\n' Text ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'u' Literal.String 'n' Literal.String 't' Literal.String 'e' Literal.String 'r' Literal.String 'm' Literal.String 'i' Literal.String 'n' Literal.String 'a' Literal.String 't' Literal.String 'e' Literal.String 'd' Literal.String ' ' Literal.String 'd' Literal.String 'o' Literal.String 'u' Literal.String 'b' Literal.String 'l' Literal.String 'e' Literal.String ' ' Literal.String 'q' Literal.String 'u' Literal.String 'o' Literal.String 't' Literal.String 'e' Literal.String '"' Literal.String ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'if' Keyword ' ' Text 's' Name '[' Punctuation 'k' Name ']' Punctuation ' ' Text '==' Operator ' ' Text '\'"\'' Literal.String.Char ' ' Text '||' Operator ' ' Text 's' Name '[' Punctuation 'k' Name ']' Punctuation ' ' Text '==' Operator ' ' Text "'$'" Literal.String.Char '\n' Text ' ' Text 'update_arg' Name '(' Punctuation 's' Name '[' Punctuation 'i' Name ':' Operator 'j' Name '-' Operator '1' Literal.Number.Integer ']' Punctuation ')' Punctuation ';' Punctuation ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'k' Name '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'k' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'k' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'elseif' Keyword ' ' Text '!' Operator 'in_single_quotes' Name '\n' Text ' ' Text 'if' Keyword ' ' Text 'done' Name '(' Punctuation 's' Name ',' Punctuation 'k' Name ')' Punctuation '\n' Text ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'd' Literal.String 'a' Literal.String 'n' Literal.String 'g' Literal.String 'l' Literal.String 'i' Literal.String 'n' Literal.String 'g' Literal.String ' ' Literal.String 'b' Literal.String 'a' Literal.String 'c' Literal.String 'k' Literal.String 's' Literal.String 'l' Literal.String 'a' Literal.String 's' Literal.String 'h' Literal.String '"' Literal.String ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'update_arg' Name '(' Punctuation 's' Name '[' Punctuation 'i' Name ':' Operator 'j' Name '-' Operator '1' Literal.Number.Integer ']' Punctuation ')' Punctuation ';' Punctuation ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'k' Name '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'k' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'k' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'k' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text 'in_single_quotes' Name ';' Punctuation ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'u' Literal.String 'n' Literal.String 't' Literal.String 'e' Literal.String 'r' Literal.String 'm' Literal.String 'i' Literal.String 'n' Literal.String 'a' Literal.String 't' Literal.String 'e' Literal.String 'd' Literal.String ' ' Literal.String 's' Literal.String 'i' Literal.String 'n' Literal.String 'g' Literal.String 'l' Literal.String 'e' Literal.String ' ' Literal.String 'q' Literal.String 'u' Literal.String 'o' Literal.String 't' Literal.String 'e' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation ' ' Text 'end' Keyword '\n' Text ' ' Text 'if' Keyword ' ' Text 'in_double_quotes' Name ';' Punctuation ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'u' Literal.String 'n' Literal.String 't' Literal.String 'e' Literal.String 'r' Literal.String 'm' Literal.String 'i' Literal.String 'n' Literal.String 'a' Literal.String 't' Literal.String 'e' Literal.String 'd' Literal.String ' ' Literal.String 'd' Literal.String 'o' Literal.String 'u' Literal.String 'b' Literal.String 'l' Literal.String 'e' Literal.String ' ' Literal.String 'q' Literal.String 'u' Literal.String 'o' Literal.String 't' Literal.String 'e' Literal.String '"' Literal.String ')' Punctuation ';' Punctuation ' ' Text 'end' Keyword '\n' Text '\n' Text ' ' Text 'update_arg' Name '(' Punctuation 's' Name '[' Punctuation 'i' Name ':' Operator ']' Punctuation ')' Punctuation '\n' Text ' ' Text 'append_arg' Name '(' Punctuation ')' Punctuation '\n' Text '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator 'interp' Name '\n' Text ' ' Text 'return' Keyword ' ' Text 'args' Name '\n' Text ' ' Text 'end' Keyword '\n' Text '\n' Text ' ' Text '# construct an expression' Comment '\n' Text ' ' Text 'exprs' Name ' ' Text '=' Operator ' ' Text '{' Punctuation '}' Punctuation '\n' Text ' ' Text 'for' Keyword ' ' Text 'arg' Name ' ' Text 'in' Keyword.Pseudo ' ' Text 'args' Name '\n' Text ' ' Text 'push' Name '(' Punctuation 'exprs' Name ',' Punctuation ' ' Text 'expr' Name '(' Punctuation ':' Operator 'tuple' Name ',' Punctuation ' ' Text 'arg' Name ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'expr' Name '(' Punctuation ':' Operator 'tuple' Name ',' Punctuation 'exprs' Name ')' Punctuation '\n' Text 'end' Keyword '\n' Text '_jl_shell_parse' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '_jl_shell_parse' Name '(' Punctuation 's' Name ',' Punctuation 'true' Keyword.Constant ')' Punctuation '\n' Text '\n' Text 'function' Keyword ' ' Text 'shell_split' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'parsed' Name ' ' Text '=' Operator ' ' Text '_jl_shell_parse' Name '(' Punctuation 's' Name ',' Punctuation 'false' Keyword.Constant ')' Punctuation '\n' Text ' ' Text 'args' Name ' ' Text '=' Operator ' ' Text 'String' Name '[' Punctuation ']' Punctuation '\n' Text ' ' Text 'for' Keyword ' ' Text 'arg' Name ' ' Text 'in' Keyword.Pseudo ' ' Text 'parsed' Name '\n' Text ' ' Text 'push' Name '(' Punctuation 'args' Name ',' Punctuation ' ' Text 'strcat' Name '(' Punctuation 'arg' Name '.' Operator '.' Operator '.' Operator ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'args' Name '\n' Text 'end' Keyword '\n' Text '\n' Text 'function' Keyword ' ' Text 'print_shell_word' Name '(' Punctuation 'word' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'isempty' Name '(' Punctuation 'word' Name ')' Punctuation '\n' Text ' ' Text 'print' Name '(' Punctuation '"' Literal.String "'" Literal.String "'" Literal.String '"' Literal.String ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'has_single' Name ' ' Text '=' Operator ' ' Text 'false' Keyword.Constant '\n' Text ' ' Text 'has_special' Name ' ' Text '=' Operator ' ' Text 'false' Keyword.Constant '\n' Text ' ' Text 'for' Keyword ' ' Text 'c' Name ' ' Text 'in' Keyword.Pseudo ' ' Text 'word' Name '\n' Text ' ' Text 'if' Keyword ' ' Text 'iswspace' Name '(' Punctuation 'c' Name ')' Punctuation ' ' Text '||' Operator ' ' Text 'c' Name '==' Operator "'\\\\'" Literal.String.Char ' ' Text '||' Operator ' ' Text 'c' Name '==' Operator "'\\''" Literal.String.Char ' ' Text '||' Operator ' ' Text 'c' Name '==' Operator '\'"\'' Literal.String.Char ' ' Text '||' Operator ' ' Text 'c' Name '==' Operator "'$'" Literal.String.Char '\n' Text ' ' Text 'has_special' Name ' ' Text '=' Operator ' ' Text 'true' Keyword.Constant '\n' Text ' ' Text 'if' Keyword ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'\\''" Literal.String.Char '\n' Text ' ' Text 'has_single' Name ' ' Text '=' Operator ' ' Text 'true' Keyword.Constant '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator 'has_special' Name '\n' Text ' ' Text 'print' Name '(' Punctuation 'word' Name ')' Punctuation '\n' Text ' ' Text 'elseif' Keyword ' ' Text '!' Operator 'has_single' Name '\n' Text ' ' Text 'print' Name '(' Punctuation "'\\''" Literal.String.Char ',' Punctuation ' ' Text 'word' Name ',' Punctuation ' ' Text "'\\''" Literal.String.Char ')' Punctuation '\n' Text ' ' Text 'else' Keyword '\n' Text ' ' Text 'print' Name '(' Punctuation '\'"\'' Literal.String.Char ')' Punctuation '\n' Text ' ' Text 'for' Keyword ' ' Text 'c' Name ' ' Text 'in' Keyword.Pseudo ' ' Text 'word' Name '\n' Text ' ' Text 'if' Keyword ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text '\'"\'' Literal.String.Char ' ' Text '||' Operator ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'$'" Literal.String.Char '\n' Text ' ' Text 'print' Name '(' Punctuation "'\\\\'" Literal.String.Char ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'print' Name '(' Punctuation 'c' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'print' Name '(' Punctuation '\'"\'' Literal.String.Char ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text 'end' Keyword '\n' Text '\n' Text 'function' Keyword ' ' Text 'print_shell_escaped' Name '(' Punctuation 'cmd' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'args' Name '::' Operator 'String' Name '.' Operator '.' Operator '.' Operator ')' Punctuation '\n' Text ' ' Text 'print_shell_word' Name '(' Punctuation 'cmd' Name ')' Punctuation '\n' Text ' ' Text 'for' Keyword ' ' Text 'arg' Name ' ' Text 'in' Keyword.Pseudo ' ' Text 'args' Name '\n' Text ' ' Text 'print' Name '(' Punctuation "' '" Literal.String.Char ')' Punctuation '\n' Text ' ' Text 'print_shell_word' Name '(' Punctuation 'arg' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text 'end' Keyword '\n' Text '\n' Text 'shell_escape' Name '(' Punctuation 'cmd' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'args' Name '::' Operator 'String' Name '.' Operator '.' Operator '.' Operator ')' Punctuation ' ' Text '=' Operator '\n' Text ' ' Text 'print_to_string' Name '(' Punctuation 'print_shell_escaped' Name ',' Punctuation ' ' Text 'cmd' Name ',' Punctuation ' ' Text 'args' Name '.' Operator '.' Operator '.' Operator ')' Punctuation '\n' Text '\n' Text '## interface to parser ##' Comment '\n' Text '\n' Text 'function' Keyword ' ' Text 'parse' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'pos' Name ',' Punctuation ' ' Text 'greedy' Name ')' Punctuation '\n' Text ' ' Text '# returns (expr, end_pos). expr is () in case of parse error.' Comment '\n' Text ' ' Text 'ex' Name ',' Punctuation ' ' Text 'pos' Name ' ' Text '=' Operator ' ' Text 'ccall' Keyword '(' Punctuation ':' Operator 'jl_parse_string' Name ',' Punctuation ' ' Text 'Any' Keyword.Type ',' Punctuation '\n' Text ' ' Text '(' Punctuation 'Ptr' Keyword.Type '{' Punctuation 'Uint8' Name '}' Punctuation ',' Punctuation ' ' Text 'Int32' Keyword.Type ',' Punctuation ' ' Text 'Int32' Keyword.Type ')' Punctuation ',' Punctuation '\n' Text ' ' Text 'cstring' Name '(' Punctuation 's' Name ')' Punctuation ',' Punctuation ' ' Text 'pos' Name '-' Operator '1' Literal.Number.Integer ',' Punctuation ' ' Text 'greedy' Name ' ' Text '?' Operator ' ' Text '1' Literal.Number.Integer ':' Operator '0' Literal.Number.Integer ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'isa' Keyword.Pseudo '(' Punctuation 'ex' Name ',' Punctuation 'Expr' Keyword.Type ')' Punctuation ' ' Text '&&' Operator ' ' Text 'is' Name '(' Punctuation 'ex' Name '.' Operator 'head' Name ',' Punctuation ':' Operator 'error' Name ')' Punctuation '\n' Text ' ' Text 'throw' Name '(' Punctuation 'ParseError' Keyword.Type '(' Punctuation 'ex' Name '.' Operator 'args' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'if' Keyword ' ' Text 'ex' Name ' ' Text '==' Operator ' ' Text '(' Punctuation ')' Punctuation ';' Punctuation ' ' Text 'throw' Name '(' Punctuation 'ParseError' Keyword.Type '(' Punctuation '"' Literal.String 'e' Literal.String 'n' Literal.String 'd' Literal.String ' ' Literal.String 'o' Literal.String 'f' Literal.String ' ' Literal.String 'i' Literal.String 'n' Literal.String 'p' Literal.String 'u' Literal.String 't' Literal.String '"' Literal.String ')' Punctuation ')' Punctuation ';' Punctuation ' ' Text 'end' Keyword '\n' Text ' ' Text 'ex' Name ',' Punctuation ' ' Text 'pos' Name '+' Operator '1' Literal.Number.Integer ' ' Text '# C is zero-based, Julia is 1-based' Comment '\n' Text 'end' Keyword '\n' Text '\n' Text 'parse' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text '1' Literal.Number.Integer ',' Punctuation ' ' Text 'true' Keyword.Constant ')' Punctuation '\n' Text 'parse' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'pos' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text 'pos' Name ',' Punctuation ' ' Text 'true' Keyword.Constant ')' Punctuation '\n' Text 'parseatom' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text '1' Literal.Number.Integer ',' Punctuation ' ' Text 'false' Keyword.Constant ')' Punctuation '\n' Text 'parseatom' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'pos' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text 'pos' Name ',' Punctuation ' ' Text 'false' Keyword.Constant ')' Punctuation '\n' Text '\n' Text '## miscellaneous string functions ##' Comment '\n' Text '\n' Text 'function' Keyword ' ' Text 'lpad' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'n' Name '::' Operator 'Integer' Keyword.Type ',' Punctuation ' ' Text 'p' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'm' Name ' ' Text '=' Operator ' ' Text 'n' Name ' ' Text '-' Operator ' ' Text 'strlen' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'm' Name ' ' Text '<=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation ' ' Text 'return' Keyword ' ' Text 's' Name ';' Punctuation ' ' Text 'end' Keyword '\n' Text ' ' Text 'l' Name ' ' Text '=' Operator ' ' Text 'strlen' Name '(' Punctuation 'p' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'l' Name '==' Operator '1' Literal.Number.Integer '\n' Text ' ' Text 'return' Keyword ' ' Text 'p' Name '^' Operator 'm' Name ' ' Text '*' Operator ' ' Text 's' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'q' Name ' ' Text '=' Operator ' ' Text 'div' Name '(' Punctuation 'm' Name ',' Punctuation 'l' Name ')' Punctuation '\n' Text ' ' Text 'r' Name ' ' Text '=' Operator ' ' Text 'm' Name ' ' Text '-' Operator ' ' Text 'q' Name '*' Operator 'l' Name '\n' Text ' ' Text 'cstring' Name '(' Punctuation 'p' Name '^' Operator 'q' Name '*' Operator 'p' Name '[' Punctuation '1' Literal.Number.Integer ':' Operator 'chr2ind' Name '(' Punctuation 'p' Name ',' Punctuation 'r' Name ')' Punctuation ']' Punctuation '*' Operator 's' Name ')' Punctuation '\n' Text 'end' Keyword '\n' Text '\n' Text 'function' Keyword ' ' Text 'rpad' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'n' Name '::' Operator 'Integer' Keyword.Type ',' Punctuation ' ' Text 'p' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'm' Name ' ' Text '=' Operator ' ' Text 'n' Name ' ' Text '-' Operator ' ' Text 'strlen' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'm' Name ' ' Text '<=' Operator ' ' Text '0' Literal.Number.Integer ';' Punctuation ' ' Text 'return' Keyword ' ' Text 's' Name ';' Punctuation ' ' Text 'end' Keyword '\n' Text ' ' Text 'l' Name ' ' Text '=' Operator ' ' Text 'strlen' Name '(' Punctuation 'p' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'l' Name '==' Operator '1' Literal.Number.Integer '\n' Text ' ' Text 'return' Keyword ' ' Text 's' Name ' ' Text '*' Operator ' ' Text 'p' Name '^' Operator 'm' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'q' Name ' ' Text '=' Operator ' ' Text 'div' Name '(' Punctuation 'm' Name ',' Punctuation 'l' Name ')' Punctuation '\n' Text ' ' Text 'r' Name ' ' Text '=' Operator ' ' Text 'm' Name ' ' Text '-' Operator ' ' Text 'q' Name '*' Operator 'l' Name '\n' Text ' ' Text 'cstring' Name '(' Punctuation 's' Name '*' Operator 'p' Name '^' Operator 'q' Name '*' Operator 'p' Name '[' Punctuation '1' Literal.Number.Integer ':' Operator 'chr2ind' Name '(' Punctuation 'p' Name ',' Punctuation 'r' Name ')' Punctuation ']' Punctuation ')' Punctuation '\n' Text 'end' Keyword '\n' Text '\n' Text 'lpad' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text 'n' Name '::' Operator 'Integer' Keyword.Type ',' Punctuation ' ' Text 'p' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'lpad' Name '(' Punctuation 'string' Name '(' Punctuation 's' Name ')' Punctuation ',' Punctuation ' ' Text 'n' Name ',' Punctuation ' ' Text 'string' Name '(' Punctuation 'p' Name ')' Punctuation ')' Punctuation '\n' Text 'rpad' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text 'n' Name '::' Operator 'Integer' Keyword.Type ',' Punctuation ' ' Text 'p' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'rpad' Name '(' Punctuation 'string' Name '(' Punctuation 's' Name ')' Punctuation ',' Punctuation ' ' Text 'n' Name ',' Punctuation ' ' Text 'string' Name '(' Punctuation 'p' Name ')' Punctuation ')' Punctuation '\n' Text '\n' Text 'lpad' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text 'n' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'lpad' Name '(' Punctuation 'string' Name '(' Punctuation 's' Name ')' Punctuation ',' Punctuation ' ' Text 'n' Name ',' Punctuation ' ' Text '"' Literal.String ' ' Literal.String '"' Literal.String ')' Punctuation '\n' Text 'rpad' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text 'n' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'rpad' Name '(' Punctuation 'string' Name '(' Punctuation 's' Name ')' Punctuation ',' Punctuation ' ' Text 'n' Name ',' Punctuation ' ' Text '"' Literal.String ' ' Literal.String '"' Literal.String ')' Punctuation '\n' Text '\n' Text 'function' Keyword ' ' Text 'split' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'delims' Name ',' Punctuation ' ' Text 'include_empty' Name '::' Operator 'Bool' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer '\n' Text ' ' Text 'strs' Name ' ' Text '=' Operator ' ' Text 'String' Name '[' Punctuation ']' Punctuation '\n' Text ' ' Text 'len' Name ' ' Text '=' Operator ' ' Text 'length' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text 'true' Keyword.Constant '\n' Text ' ' Text 'tokstart' Name ' ' Text '=' Operator ' ' Text 'tokend' Name ' ' Text '=' Operator ' ' Text 'i' Name '\n' Text ' ' Text 'while' Keyword ' ' Text '!' Operator 'done' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text '(' Punctuation 'c' Name ',' Punctuation 'i' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'contains' Name '(' Punctuation 'delims' Name ',' Punctuation ' ' Text 'c' Name ')' Punctuation '\n' Text ' ' Text 'break' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'tokend' Name ' ' Text '=' Operator ' ' Text 'i' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'tok' Name ' ' Text '=' Operator ' ' Text 's' Name '[' Punctuation 'tokstart' Name ':' Operator '(' Punctuation 'tokend' Name '-' Operator '1' Literal.Number.Integer ')' Punctuation ']' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'include_empty' Name ' ' Text '||' Operator ' ' Text '!' Operator 'isempty' Name '(' Punctuation 'tok' Name ')' Punctuation '\n' Text ' ' Text 'push' Name '(' Punctuation 'strs' Name ',' Punctuation ' ' Text 'tok' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator '(' Punctuation '(' Punctuation 'i' Name ' ' Text '<=' Operator ' ' Text 'len' Name ')' Punctuation ' ' Text '||' Operator ' ' Text '(' Punctuation 'i' Name '==' Operator 'len' Name '+' Operator '1' Literal.Number.Integer ' ' Text '&&' Operator ' ' Text 'tokend!' Name '=' Operator 'i' Name ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'break' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'strs' Name '\n' Text 'end' Keyword '\n' Text '\n' Text 'split' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'split' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text '(' Punctuation "' '" Literal.String.Char ',' Punctuation "'\\t'" Literal.String.Char ',' Punctuation "'\\n'" Literal.String.Char ',' Punctuation "'\\v'" Literal.String.Char ',' Punctuation "'\\f'" Literal.String.Char ',' Punctuation "'\\r'" Literal.String.Char ')' Punctuation ',' Punctuation ' ' Text 'false' Keyword.Constant ')' Punctuation '\n' Text 'split' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'x' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'split' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text 'x' Name ',' Punctuation ' ' Text 'true' Keyword.Constant ')' Punctuation '\n' Text 'split' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'x' Name '::' Operator 'Char' Keyword.Type ',' Punctuation ' ' Text 'incl' Name '::' Operator 'Bool' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'split' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text '(' Punctuation 'x' Name ',' Punctuation ')' Punctuation ',' Punctuation ' ' Text 'incl' Name ')' Punctuation '\n' Text '\n' Text 'function' Keyword ' ' Text 'print_joined' Name '(' Punctuation 'strings' Name ',' Punctuation ' ' Text 'delim' Name ',' Punctuation ' ' Text 'last' Name ')' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'start' Name '(' Punctuation 'strings' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'done' Name '(' Punctuation 'strings' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'return' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'str' Name ',' Punctuation ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 'strings' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'print' Name '(' Punctuation 'str' Name ')' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text '!' Operator 'done' Name '(' Punctuation 'strings' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'str' Name ',' Punctuation ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 'strings' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'print' Name '(' Punctuation 'done' Name '(' Punctuation 'strings' Name ',' Punctuation 'i' Name ')' Punctuation ' ' Text '?' Operator ' ' Text 'last' Name ' ' Text ':' Operator ' ' Text 'delim' Name ')' Punctuation '\n' Text ' ' Text 'print' Name '(' Punctuation 'str' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text 'end' Keyword '\n' Text '\n' Text 'function' Keyword ' ' Text 'print_joined' Name '(' Punctuation 'strings' Name ',' Punctuation ' ' Text 'delim' Name ')' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'start' Name '(' Punctuation 'strings' Name ')' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text '!' Operator 'done' Name '(' Punctuation 'strings' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'str' Name ',' Punctuation ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 'strings' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'print' Name '(' Punctuation 'str' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator 'done' Name '(' Punctuation 'strings' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'print' Name '(' Punctuation 'delim' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text 'end' Keyword '\n' Text 'print_joined' Name '(' Punctuation 'strings' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'print_joined' Name '(' Punctuation 'strings' Name ',' Punctuation ' ' Text '"' Literal.String '"' Literal.String ')' Punctuation '\n' Text '\n' Text 'join' Name '(' Punctuation 'args' Name '.' Operator '.' Operator '.' Operator ')' Punctuation ' ' Text '=' Operator ' ' Text 'print_to_string' Name '(' Punctuation 'print_joined' Name ',' Punctuation ' ' Text 'args' Name '.' Operator '.' Operator '.' Operator ')' Punctuation '\n' Text '\n' Text 'chop' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 's' Name '[' Punctuation '1' Literal.Number.Integer ':' Operator 'thisind' Name '(' Punctuation 's' Name ',' Punctuation 'length' Name '(' Punctuation 's' Name ')' Punctuation ')' Punctuation '-' Operator '1' Literal.Number.Integer ']' Punctuation '\n' Text 'chomp' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '(' Punctuation 'i' Name '=' Operator 'thisind' Name '(' Punctuation 's' Name ',' Punctuation 'length' Name '(' Punctuation 's' Name ')' Punctuation ')' Punctuation ';' Punctuation ' ' Text 's' Name '[' Punctuation 'i' Name ']' Punctuation '==' Operator "'\\n'" Literal.String.Char ' ' Text '?' Operator ' ' Text 's' Name '[' Punctuation '1' Literal.Number.Integer ':' Operator 'i' Name '-' Operator '1' Literal.Number.Integer ']' Punctuation ' ' Text ':' Operator ' ' Text 's' Name ')' Punctuation '\n' Text 'chomp' Name '(' Punctuation 's' Name '::' Operator 'ByteString' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 's' Name '.' Operator 'data' Name '[' Punctuation 'end' Keyword ']' Punctuation '==' Operator '0x0a' Literal.Number.Hex ' ' Text '?' Operator ' ' Text 's' Name '[' Punctuation '1' Literal.Number.Integer ':' Operator 'end' Keyword '-' Operator '1' Literal.Number.Integer ']' Punctuation ' ' Text ':' Operator ' ' Text 's' Name '\n' Text '\n' Text 'function' Keyword ' ' Text 'lstrip' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'start' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text '!' Operator 'done' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator 'iswspace' Name '(' Punctuation 'c' Name ')' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 's' Name '[' Punctuation 'i' Name ':' Operator 'end' Keyword ']' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'j' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text '"' Literal.String '"' Literal.String '\n' Text 'end' Keyword '\n' Text '\n' Text 'function' Keyword ' ' Text 'rstrip' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'r' Name ' ' Text '=' Operator ' ' Text 'reverse' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'start' Name '(' Punctuation 'r' Name ')' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text '!' Operator 'done' Name '(' Punctuation 'r' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'c' Name ',' Punctuation ' ' Text 'j' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 'r' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator 'iswspace' Name '(' Punctuation 'c' Name ')' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text 's' Name '[' Punctuation '1' Literal.Number.Integer ':' Operator 'end' Keyword '-' Operator 'i' Name '+' Operator '1' Literal.Number.Integer ']' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'j' Name '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text '"' Literal.String '"' Literal.String '\n' Text 'end' Keyword '\n' Text '\n' Text 'strip' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'lstrip' Name '(' Punctuation 'rstrip' Name '(' Punctuation 's' Name ')' Punctuation ')' Punctuation '\n' Text '\n' Text '## string to integer functions ##' Comment '\n' Text '\n' Text 'function' Keyword ' ' Text 'parse_int' Name '{' Punctuation 'T' Name '<:' Operator 'Integer' Keyword.Type '}' Punctuation '(' Punctuation '::' Operator 'Type' Keyword.Type '{' Punctuation 'T' Name '}' Punctuation ',' Punctuation ' ' Text 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'base' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator '(' Punctuation '2' Literal.Number.Integer ' ' Text '<=' Operator ' ' Text 'base' Name ' ' Text '<=' Operator ' ' Text '36' Literal.Number.Integer ')' Punctuation ';' Punctuation ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'i' Literal.String 'n' Literal.String 'v' Literal.String 'a' Literal.String 'l' Literal.String 'i' Literal.String 'd' Literal.String ' ' Literal.String 'b' Literal.String 'a' Literal.String 's' Literal.String 'e' Literal.String ':' Literal.String ' ' Literal.String '"' Literal.String ',' Punctuation 'base' Name ')' Punctuation ';' Punctuation ' ' Text 'end' Keyword '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'start' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'done' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'p' Literal.String 'r' Literal.String 'e' Literal.String 'm' Literal.String 'a' Literal.String 't' Literal.String 'u' Literal.String 'r' Literal.String 'e' Literal.String ' ' Literal.String 'e' Literal.String 'n' Literal.String 'd' Literal.String ' ' Literal.String 'o' Literal.String 'f' Literal.String ' ' Literal.String 'i' Literal.String 'n' Literal.String 't' Literal.String 'e' Literal.String 'g' Literal.String 'e' Literal.String 'r' Literal.String ' ' Literal.String '(' Literal.String 'i' Literal.String 'n' Literal.String ' ' Literal.String '"' Literal.String ',' Punctuation 'show_to_string' Name '(' Punctuation 's' Name ')' Punctuation ',' Punctuation '"' Literal.String ')' Literal.String '"' Literal.String ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'c' Name ',' Punctuation 'i' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'sgn' Name ' ' Text '=' Operator ' ' Text 'one' Name '(' Punctuation 'T' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'T' Name ' ' Text '<:' Operator ' ' Text 'Signed' Keyword.Type ' ' Text '&&' Operator ' ' Text 'c' Name ' ' Text '==' Operator ' ' Text "'-'" Literal.String.Char '\n' Text ' ' Text 'sgn' Name ' ' Text '=' Operator ' ' Text '-' Operator 'sgn' Name '\n' Text ' ' Text 'if' Keyword ' ' Text 'done' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'p' Literal.String 'r' Literal.String 'e' Literal.String 'm' Literal.String 'a' Literal.String 't' Literal.String 'u' Literal.String 'r' Literal.String 'e' Literal.String ' ' Literal.String 'e' Literal.String 'n' Literal.String 'd' Literal.String ' ' Literal.String 'o' Literal.String 'f' Literal.String ' ' Literal.String 'i' Literal.String 'n' Literal.String 't' Literal.String 'e' Literal.String 'g' Literal.String 'e' Literal.String 'r' Literal.String ' ' Literal.String '(' Literal.String 'i' Literal.String 'n' Literal.String ' ' Literal.String '"' Literal.String ',' Punctuation 'show_to_string' Name '(' Punctuation 's' Name ')' Punctuation ',' Punctuation '"' Literal.String ')' Literal.String '"' Literal.String ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'c' Name ',' Punctuation 'i' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'base' Name ' ' Text '=' Operator ' ' Text 'convert' Name '(' Punctuation 'T' Name ',' Punctuation 'base' Name ')' Punctuation '\n' Text ' ' Text 'n' Name '::' Operator 'T' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer '\n' Text ' ' Text 'while' Keyword ' ' Text 'true' Keyword.Constant '\n' Text ' ' Text 'd' Name ' ' Text '=' Operator ' ' Text "'0'" Literal.String.Char ' ' Text '<=' Operator ' ' Text 'c' Name ' ' Text '<=' Operator ' ' Text "'9'" Literal.String.Char ' ' Text '?' Operator ' ' Text 'c' Name '-' Operator "'0'" Literal.String.Char ' ' Text ':' Operator '\n' Text ' ' Text "'A'" Literal.String.Char ' ' Text '<=' Operator ' ' Text 'c' Name ' ' Text '<=' Operator ' ' Text "'Z'" Literal.String.Char ' ' Text '?' Operator ' ' Text 'c' Name '-' Operator "'A'" Literal.String.Char '+' Operator '10' Literal.Number.Integer ' ' Text ':' Operator '\n' Text ' ' Text "'a'" Literal.String.Char ' ' Text '<=' Operator ' ' Text 'c' Name ' ' Text '<=' Operator ' ' Text "'z'" Literal.String.Char ' ' Text '?' Operator ' ' Text 'c' Name '-' Operator "'a'" Literal.String.Char '+' Operator '10' Literal.Number.Integer ' ' Text ':' Operator ' ' Text 'typemax' Name '(' Punctuation 'Int' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'd' Name ' ' Text '>=' Operator ' ' Text 'base' Name '\n' Text ' ' Text 'error' Name '(' Punctuation 'show_to_string' Name '(' Punctuation 'c' Name ')' Punctuation ',' Punctuation '"' Literal.String ' ' Literal.String 'i' Literal.String 's' Literal.String ' ' Literal.String 'n' Literal.String 'o' Literal.String 't' Literal.String ' ' Literal.String 'a' Literal.String ' ' Literal.String 'v' Literal.String 'a' Literal.String 'l' Literal.String 'i' Literal.String 'd' Literal.String ' ' Literal.String 'd' Literal.String 'i' Literal.String 'g' Literal.String 'i' Literal.String 't' Literal.String ' ' Literal.String '(' Literal.String 'i' Literal.String 'n' Literal.String ' ' Literal.String '"' Literal.String ',' Punctuation 'show_to_string' Name '(' Punctuation 's' Name ')' Punctuation ',' Punctuation '"' Literal.String ')' Literal.String '"' Literal.String ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text '# TODO: overflow detection?' Comment '\n' Text ' ' Text 'n' Name ' ' Text '=' Operator ' ' Text 'n' Name '*' Operator 'base' Name ' ' Text '+' Operator ' ' Text 'd' Name '\n' Text ' ' Text 'if' Keyword ' ' Text 'done' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'break' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'c' Name ',' Punctuation 'i' Name ' ' Text '=' Operator ' ' Text 'next' Name '(' Punctuation 's' Name ',' Punctuation 'i' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'return' Keyword ' ' Text 'flipsign' Name '(' Punctuation 'n' Name ',' Punctuation 'sgn' Name ')' Punctuation '\n' Text 'end' Keyword '\n' Text '\n' Text 'parse_int' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'base' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'Int' Keyword.Type ',' Punctuation 's' Name ',' Punctuation 'base' Name ')' Punctuation '\n' Text 'parse_int' Name '(' Punctuation 'T' Name '::' Operator 'Type' Keyword.Type ',' Punctuation ' ' Text 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'T' Name ',' Punctuation 's' Name ',' Punctuation '10' Literal.Number.Integer ')' Punctuation '\n' Text 'parse_int' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'Int' Keyword.Type ',' Punctuation 's' Name ',' Punctuation '10' Literal.Number.Integer ')' Punctuation '\n' Text '\n' Text 'parse_bin' Name '(' Punctuation 'T' Name '::' Operator 'Type' Keyword.Type ',' Punctuation ' ' Text 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'T' Name ',' Punctuation 's' Name ',' Punctuation '2' Literal.Number.Integer ')' Punctuation '\n' Text 'parse_oct' Name '(' Punctuation 'T' Name '::' Operator 'Type' Keyword.Type ',' Punctuation ' ' Text 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'T' Name ',' Punctuation 's' Name ',' Punctuation '8' Literal.Number.Integer ')' Punctuation '\n' Text 'parse_hex' Name '(' Punctuation 'T' Name '::' Operator 'Type' Keyword.Type ',' Punctuation ' ' Text 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'T' Name ',' Punctuation 's' Name ',' Punctuation '16' Literal.Number.Integer ')' Punctuation '\n' Text '\n' Text 'parse_bin' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'Int' Keyword.Type ',' Punctuation 's' Name ',' Punctuation '2' Literal.Number.Integer ')' Punctuation '\n' Text 'parse_oct' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'Int' Keyword.Type ',' Punctuation 's' Name ',' Punctuation '8' Literal.Number.Integer ')' Punctuation '\n' Text 'parse_hex' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'Int' Keyword.Type ',' Punctuation 's' Name ',' Punctuation '16' Literal.Number.Integer ')' Punctuation '\n' Text '\n' Text 'integer' Name ' ' Text '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'int' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text 'unsigned' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'uint' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text 'int' Name ' ' Text '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'Int' Keyword.Type ',' Punctuation 's' Name ')' Punctuation '\n' Text 'uint' Name ' ' Text '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'Uint' Name ',' Punctuation 's' Name ')' Punctuation '\n' Text 'int8' Name ' ' Text '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'Int8' Keyword.Type ',' Punctuation 's' Name ')' Punctuation '\n' Text 'uint8' Name ' ' Text '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'Uint8' Name ',' Punctuation 's' Name ')' Punctuation '\n' Text 'int16' Name ' ' Text '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'Int16' Keyword.Type ',' Punctuation 's' Name ')' Punctuation '\n' Text 'uint16' Name ' ' Text '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'Uint16' Name ',' Punctuation 's' Name ')' Punctuation '\n' Text 'int32' Name ' ' Text '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'Int32' Keyword.Type ',' Punctuation 's' Name ')' Punctuation '\n' Text 'uint32' Name ' ' Text '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'Uint32' Name ',' Punctuation 's' Name ')' Punctuation '\n' Text 'int64' Name ' ' Text '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'Int64' Keyword.Type ',' Punctuation 's' Name ')' Punctuation '\n' Text 'uint64' Name ' ' Text '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'parse_int' Name '(' Punctuation 'Uint64' Name ',' Punctuation 's' Name ')' Punctuation '\n' Text '\n' Text '## integer to string functions ##' Comment '\n' Text '\n' Text 'const' Keyword.Declaration ' ' Text '_jl_dig_syms' Name ' ' Text '=' Operator ' ' Text '"' Literal.String '0' Literal.String '1' Literal.String '2' Literal.String '3' Literal.String '4' Literal.String '5' Literal.String '6' Literal.String '7' Literal.String '8' Literal.String '9' Literal.String 'a' Literal.String 'b' Literal.String 'c' Literal.String 'd' Literal.String 'e' Literal.String 'f' Literal.String 'g' Literal.String 'h' Literal.String 'i' Literal.String 'j' Literal.String 'k' Literal.String 'l' Literal.String 'm' Literal.String 'n' Literal.String 'o' Literal.String 'p' Literal.String 'q' Literal.String 'r' Literal.String 's' Literal.String 't' Literal.String 'u' Literal.String 'v' Literal.String 'w' Literal.String 'x' Literal.String 'y' Literal.String 'z' Literal.String '"' Literal.String '.' Operator 'data' Name '\n' Text '\n' Text 'function' Keyword ' ' Text 'int2str' Name '(' Punctuation 'n' Name '::' Operator 'Union' Keyword.Type '(' Punctuation 'Int64' Keyword.Type ',' Punctuation 'Uint64' Name ')' Punctuation ',' Punctuation ' ' Text 'b' Name '::' Operator 'Integer' Keyword.Type ',' Punctuation ' ' Text 'l' Name '::' Operator 'Int' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text 'b' Name ' ' Text '<' Operator ' ' Text '2' Literal.Number.Integer ' ' Text '||' Operator ' ' Text 'b' Name ' ' Text '>' Operator ' ' Text '36' Literal.Number.Integer ';' Punctuation ' ' Text 'error' Name '(' Punctuation '"' Literal.String 'i' Literal.String 'n' Literal.String 't' Literal.String '2' Literal.String 's' Literal.String 't' Literal.String 'r' Literal.String ':' Literal.String ' ' Literal.String 'i' Literal.String 'n' Literal.String 'v' Literal.String 'a' Literal.String 'l' Literal.String 'i' Literal.String 'd' Literal.String ' ' Literal.String 'b' Literal.String 'a' Literal.String 's' Literal.String 'e' Literal.String ' ' Literal.String '"' Literal.String ',' Punctuation ' ' Text 'b' Name ')' Punctuation ';' Punctuation ' ' Text 'end' Keyword '\n' Text ' ' Text 'neg' Name ' ' Text '=' Operator ' ' Text 'n' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer '\n' Text ' ' Text 'n' Name ' ' Text '=' Operator ' ' Text 'unsigned' Name '(' Punctuation 'abs' Name '(' Punctuation 'n' Name ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'b' Name ' ' Text '=' Operator ' ' Text 'convert' Name '(' Punctuation 'typeof' Name '(' Punctuation 'n' Name ')' Punctuation ',' Punctuation ' ' Text 'b' Name ')' Punctuation '\n' Text ' ' Text 'ndig' Name ' ' Text '=' Operator ' ' Text 'ndigits' Name '(' Punctuation 'n' Name ',' Punctuation ' ' Text 'b' Name ')' Punctuation '\n' Text ' ' Text 'sz' Name ' ' Text '=' Operator ' ' Text 'max' Name '(' Punctuation 'convert' Name '(' Punctuation 'Int' Keyword.Type ',' Punctuation ' ' Text 'ndig' Name ')' Punctuation ',' Punctuation ' ' Text 'l' Name ')' Punctuation ' ' Text '+' Operator ' ' Text 'neg' Name '\n' Text ' ' Text 'data' Name ' ' Text '=' Operator ' ' Text 'Array' Keyword.Type '(' Punctuation 'Uint8' Name ',' Punctuation ' ' Text 'sz' Name ')' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'sz' Name '\n' Text ' ' Text 'if' Keyword ' ' Text 'ispow2' Name '(' Punctuation 'b' Name ')' Punctuation '\n' Text ' ' Text 'digmask' Name ' ' Text '=' Operator ' ' Text 'b' Name '-' Operator '1' Literal.Number.Integer '\n' Text ' ' Text 'shift' Name ' ' Text '=' Operator ' ' Text 'trailing_zeros' Name '(' Punctuation 'b' Name ')' Punctuation '\n' Text ' ' Text 'while' Keyword ' ' Text 'i' Name ' ' Text '>' Operator ' ' Text 'neg' Name '\n' Text ' ' Text 'ch' Name ' ' Text '=' Operator ' ' Text 'n' Name ' ' Text '&' Operator ' ' Text 'digmask' Name '\n' Text ' ' Text 'data' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '=' Operator ' ' Text '_jl_dig_syms' Name '[' Punctuation 'int' Name '(' Punctuation 'ch' Name ')' Punctuation '+' Operator '1' Literal.Number.Integer ']' Punctuation '\n' Text ' ' Text 'n' Name ' ' Text '>>=' Operator ' ' Text 'shift' Name '\n' Text ' ' Text 'i' Name ' ' Text '-=' Operator ' ' Text '1' Literal.Number.Integer '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'else' Keyword '\n' Text ' ' Text 'while' Keyword ' ' Text 'i' Name ' ' Text '>' Operator ' ' Text 'neg' Name '\n' Text ' ' Text 'ch' Name ' ' Text '=' Operator ' ' Text 'n' Name ' ' Text '%' Operator ' ' Text 'b' Name '\n' Text ' ' Text 'data' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '=' Operator ' ' Text '_jl_dig_syms' Name '[' Punctuation 'int' Name '(' Punctuation 'ch' Name ')' Punctuation '+' Operator '1' Literal.Number.Integer ']' Punctuation '\n' Text ' ' Text 'n' Name ' ' Text '=' Operator ' ' Text 'div' Name '(' Punctuation 'n' Name ',' Punctuation 'b' Name ')' Punctuation '\n' Text ' ' Text 'i' Name ' ' Text '-=' Operator ' ' Text '1' Literal.Number.Integer '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'if' Keyword ' ' Text 'neg' Name '\n' Text ' ' Text 'data' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ' ' Text '=' Operator ' ' Text "'-'" Literal.String.Char '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'ASCIIString' Keyword.Type '(' Punctuation 'data' Name ')' Punctuation '\n' Text 'end' Keyword '\n' Text 'int2str' Name '(' Punctuation 'n' Name '::' Operator 'Integer' Keyword.Type ',' Punctuation ' ' Text 'b' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'int2str' Name '(' Punctuation 'n' Name ',' Punctuation ' ' Text 'b' Name ',' Punctuation ' ' Text '0' Literal.Number.Integer ')' Punctuation '\n' Text 'int2str' Name '(' Punctuation 'n' Name '::' Operator 'Integer' Keyword.Type ',' Punctuation ' ' Text 'b' Name '::' Operator 'Integer' Keyword.Type ',' Punctuation ' ' Text 'l' Name '::' Operator 'Int' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'int2str' Name '(' Punctuation 'int64' Name '(' Punctuation 'n' Name ')' Punctuation ',' Punctuation ' ' Text 'b' Name ',' Punctuation ' ' Text 'l' Name ')' Punctuation '\n' Text '\n' Text 'string' Name '(' Punctuation 'x' Name '::' Operator 'Signed' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'dec' Name '(' Punctuation 'int64' Name '(' Punctuation 'x' Name ')' Punctuation ')' Punctuation '\n' Text 'cstring' Name '(' Punctuation 'x' Name '::' Operator 'Signed' Keyword.Type ')' Punctuation ' ' Text '=' Operator ' ' Text 'dec' Name '(' Punctuation 'int64' Name '(' Punctuation 'x' Name ')' Punctuation ')' Punctuation '\n' Text '\n' Text '## string to float functions ##' Comment '\n' Text '\n' Text 'function' Keyword ' ' Text 'float64_isvalid' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'out' Name '::' Operator 'Array' Keyword.Type '{' Punctuation 'Float64' Keyword.Type ',' Punctuation '1' Literal.Number.Integer '}' Punctuation ')' Punctuation '\n' Text ' ' Text 's' Name ' ' Text '=' Operator ' ' Text 'cstring' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text '(' Punctuation 'ccall' Keyword '(' Punctuation ':' Operator 'jl_strtod' Name ',' Punctuation ' ' Text 'Int32' Keyword.Type ',' Punctuation ' ' Text '(' Punctuation 'Ptr' Keyword.Type '{' Punctuation 'Uint8' Name '}' Punctuation ',' Punctuation 'Ptr' Keyword.Type '{' Punctuation 'Float64' Keyword.Type '}' Punctuation ')' Punctuation ',' Punctuation ' ' Text 's' Name ',' Punctuation ' ' Text 'out' Name ')' Punctuation '==' Operator '0' Literal.Number.Integer ')' Punctuation '\n' Text 'end' Keyword '\n' Text '\n' Text 'function' Keyword ' ' Text 'float32_isvalid' Name '(' Punctuation 's' Name '::' Operator 'String' Name ',' Punctuation ' ' Text 'out' Name '::' Operator 'Array' Keyword.Type '{' Punctuation 'Float32' Keyword.Type ',' Punctuation '1' Literal.Number.Integer '}' Punctuation ')' Punctuation '\n' Text ' ' Text 's' Name ' ' Text '=' Operator ' ' Text 'cstring' Name '(' Punctuation 's' Name ')' Punctuation '\n' Text ' ' Text 'return' Keyword ' ' Text '(' Punctuation 'ccall' Keyword '(' Punctuation ':' Operator 'jl_strtof' Name ',' Punctuation ' ' Text 'Int32' Keyword.Type ',' Punctuation ' ' Text '(' Punctuation 'Ptr' Keyword.Type '{' Punctuation 'Uint8' Name '}' Punctuation ',' Punctuation 'Ptr' Keyword.Type '{' Punctuation 'Float32' Keyword.Type '}' Punctuation ')' Punctuation ',' Punctuation ' ' Text 's' Name ',' Punctuation ' ' Text 'out' Name ')' Punctuation '==' Operator '0' Literal.Number.Integer ')' Punctuation '\n' Text 'end' Keyword '\n' Text '\n' Text 'begin' Keyword '\n' Text ' ' Text 'local' Keyword.Declaration ' ' Text 'tmp' Name '::' Operator 'Array' Keyword.Type '{' Punctuation 'Float64' Keyword.Type ',' Punctuation '1' Literal.Number.Integer '}' Punctuation ' ' Text '=' Operator ' ' Text 'Array' Keyword.Type '(' Punctuation 'Float64' Keyword.Type ',' Punctuation '1' Literal.Number.Integer ')' Punctuation '\n' Text ' ' Text 'local' Keyword.Declaration ' ' Text 'tmpf' Name '::' Operator 'Array' Keyword.Type '{' Punctuation 'Float32' Keyword.Type ',' Punctuation '1' Literal.Number.Integer '}' Punctuation ' ' Text '=' Operator ' ' Text 'Array' Keyword.Type '(' Punctuation 'Float32' Keyword.Type ',' Punctuation '1' Literal.Number.Integer ')' Punctuation '\n' Text ' ' Text 'global' Keyword.Declaration ' ' Text 'float64' Name ',' Punctuation ' ' Text 'float32' Name '\n' Text ' ' Text 'function' Keyword ' ' Text 'float64' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator 'float64_isvalid' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text 'tmp' Name ')' Punctuation '\n' Text ' ' Text 'throw' Name '(' Punctuation 'ArgumentError' Keyword.Type '(' Punctuation '"' Literal.String 'f' Literal.String 'l' Literal.String 'o' Literal.String 'a' Literal.String 't' Literal.String '6' Literal.String '4' Literal.String '(' Literal.String 'S' Literal.String 't' Literal.String 'r' Literal.String 'i' Literal.String 'n' Literal.String 'g' Literal.String ')' Literal.String ':' Literal.String ' ' Literal.String 'i' Literal.String 'n' Literal.String 'v' Literal.String 'a' Literal.String 'l' Literal.String 'i' Literal.String 'd' Literal.String ' ' Literal.String 'n' Literal.String 'u' Literal.String 'm' Literal.String 'b' Literal.String 'e' Literal.String 'r' Literal.String ' ' Literal.String 'f' Literal.String 'o' Literal.String 'r' Literal.String 'm' Literal.String 'a' Literal.String 't' Literal.String '"' Literal.String ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'return' Keyword ' ' Text 'tmp' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text '\n' Text ' ' Text 'function' Keyword ' ' Text 'float32' Name '(' Punctuation 's' Name '::' Operator 'String' Name ')' Punctuation '\n' Text ' ' Text 'if' Keyword ' ' Text '!' Operator 'float32_isvalid' Name '(' Punctuation 's' Name ',' Punctuation ' ' Text 'tmpf' Name ')' Punctuation '\n' Text ' ' Text 'throw' Name '(' Punctuation 'ArgumentError' Keyword.Type '(' Punctuation '"' Literal.String 'f' Literal.String 'l' Literal.String 'o' Literal.String 'a' Literal.String 't' Literal.String '3' Literal.String '2' Literal.String '(' Literal.String 'S' Literal.String 't' Literal.String 'r' Literal.String 'i' Literal.String 'n' Literal.String 'g' Literal.String ')' Literal.String ':' Literal.String ' ' Literal.String 'i' Literal.String 'n' Literal.String 'v' Literal.String 'a' Literal.String 'l' Literal.String 'i' Literal.String 'd' Literal.String ' ' Literal.String 'n' Literal.String 'u' Literal.String 'm' Literal.String 'b' Literal.String 'e' Literal.String 'r' Literal.String ' ' Literal.String 'f' Literal.String 'o' Literal.String 'r' Literal.String 'm' Literal.String 'a' Literal.String 't' Literal.String '"' Literal.String ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'return' Keyword ' ' Text 'tmpf' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text 'end' Keyword '\n' Text '\n' Text 'float' Name '(' Punctuation 'x' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'float64' Name '(' Punctuation 'x' Name ')' Punctuation '\n' Text 'parse_float' Name '(' Punctuation 'x' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'float64' Name '(' Punctuation 'x' Name ')' Punctuation '\n' Text 'parse_float' Name '(' Punctuation '::' Operator 'Type' Keyword.Type '{' Punctuation 'Float64' Keyword.Type '}' Punctuation ',' Punctuation ' ' Text 'x' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'float64' Name '(' Punctuation 'x' Name ')' Punctuation '\n' Text 'parse_float' Name '(' Punctuation '::' Operator 'Type' Keyword.Type '{' Punctuation 'Float32' Keyword.Type '}' Punctuation ',' Punctuation ' ' Text 'x' Name '::' Operator 'String' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'float32' Name '(' Punctuation 'x' Name ')' Punctuation '\n' Text '\n' Text '# copying a byte string (generally not needed due to "immutability")' Comment '\n' Text '\n' Text 'strcpy' Name '{' Punctuation 'T' Name '<:' Operator 'ByteString' Name '}' Punctuation '(' Punctuation 's' Name '::' Operator 'T' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'T' Name '(' Punctuation 'copy' Name '(' Punctuation 's' Name '.' Operator 'data' Name ')' Punctuation ')' Punctuation '\n' Text '\n' Text '# lexicographically compare byte arrays (used by Latin-1 and UTF-8)' Comment '\n' Text '\n' Text 'function' Keyword ' ' Text 'lexcmp' Name '(' Punctuation 'a' Name '::' Operator 'Array' Keyword.Type '{' Punctuation 'Uint8' Name ',' Punctuation '1' Literal.Number.Integer '}' Punctuation ',' Punctuation ' ' Text 'b' Name '::' Operator 'Array' Keyword.Type '{' Punctuation 'Uint8' Name ',' Punctuation '1' Literal.Number.Integer '}' Punctuation ')' Punctuation '\n' Text ' ' Text 'c' Name ' ' Text '=' Operator ' ' Text 'ccall' Keyword '(' Punctuation ':' Operator 'memcmp' Name ',' Punctuation ' ' Text 'Int32' Keyword.Type ',' Punctuation ' ' Text '(' Punctuation 'Ptr' Keyword.Type '{' Punctuation 'Uint8' Name '}' Punctuation ',' Punctuation ' ' Text 'Ptr' Keyword.Type '{' Punctuation 'Uint8' Name '}' Punctuation ',' Punctuation ' ' Text 'Uint' Name ')' Punctuation ',' Punctuation '\n' Text ' ' Text 'a' Name ',' Punctuation ' ' Text 'b' Name ',' Punctuation ' ' Text 'min' Name '(' Punctuation 'length' Name '(' Punctuation 'a' Name ')' Punctuation ',' Punctuation 'length' Name '(' Punctuation 'b' Name ')' Punctuation ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'c' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ' ' Text '?' Operator ' ' Text '-' Operator '1' Literal.Number.Integer ' ' Text ':' Operator ' ' Text 'c' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text '?' Operator ' ' Text '+' Operator '1' Literal.Number.Integer ' ' Text ':' Operator ' ' Text 'cmp' Name '(' Punctuation 'length' Name '(' Punctuation 'a' Name ')' Punctuation ',' Punctuation 'length' Name '(' Punctuation 'b' Name ')' Punctuation ')' Punctuation '\n' Text 'end' Keyword '\n' Text '\n' Text '# find the index of the first occurrence of a byte value in a byte array' Comment '\n' Text '\n' Text 'function' Keyword ' ' Text 'memchr' Name '(' Punctuation 'a' Name '::' Operator 'Array' Keyword.Type '{' Punctuation 'Uint8' Name ',' Punctuation '1' Literal.Number.Integer '}' Punctuation ',' Punctuation ' ' Text 'b' Name '::' Operator 'Integer' Keyword.Type ')' Punctuation '\n' Text ' ' Text 'p' Name ' ' Text '=' Operator ' ' Text 'pointer' Name '(' Punctuation 'a' Name ')' Punctuation '\n' Text ' ' Text 'q' Name ' ' Text '=' Operator ' ' Text 'ccall' Keyword '(' Punctuation ':' Operator 'memchr' Name ',' Punctuation ' ' Text 'Ptr' Keyword.Type '{' Punctuation 'Uint8' Name '}' Punctuation ',' Punctuation ' ' Text '(' Punctuation 'Ptr' Keyword.Type '{' Punctuation 'Uint8' Name '}' Punctuation ',' Punctuation ' ' Text 'Int32' Keyword.Type ',' Punctuation ' ' Text 'Uint' Name ')' Punctuation ',' Punctuation ' ' Text 'p' Name ',' Punctuation ' ' Text 'b' Name ',' Punctuation ' ' Text 'length' Name '(' Punctuation 'a' Name ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'q' Name ' ' Text '==' Operator ' ' Text 'C_NULL' Name.Builtin ' ' Text '?' Operator ' ' Text '0' Literal.Number.Integer ' ' Text ':' Operator ' ' Text 'q' Name ' ' Text '-' Operator ' ' Text 'p' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer '\n' Text 'end' Keyword '\n' Text '\n' Text '# concatenate byte arrays into a single array' Comment '\n' Text '\n' Text 'memcat' Name '(' Punctuation ')' Punctuation ' ' Text '=' Operator ' ' Text 'Array' Keyword.Type '(' Punctuation 'Uint8' Name ',' Punctuation '0' Literal.Number.Integer ')' Punctuation '\n' Text 'memcat' Name '(' Punctuation 'a' Name '::' Operator 'Array' Keyword.Type '{' Punctuation 'Uint8' Name ',' Punctuation '1' Literal.Number.Integer '}' Punctuation ')' Punctuation ' ' Text '=' Operator ' ' Text 'copy' Name '(' Punctuation 'a' Name ')' Punctuation '\n' Text '\n' Text 'function' Keyword ' ' Text 'memcat' Name '(' Punctuation 'arrays' Name '::' Operator 'Array' Keyword.Type '{' Punctuation 'Uint8' Name ',' Punctuation '1' Literal.Number.Integer '}' Punctuation '.' Operator '.' Operator '.' Operator ')' Punctuation '\n' Text ' ' Text 'n' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer '\n' Text ' ' Text 'for' Keyword ' ' Text 'a' Name ' ' Text 'in' Keyword.Pseudo ' ' Text 'arrays' Name '\n' Text ' ' Text 'n' Name ' ' Text '+=' Operator ' ' Text 'length' Name '(' Punctuation 'a' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'arr' Name ' ' Text '=' Operator ' ' Text 'Array' Keyword.Type '(' Punctuation 'Uint8' Name ',' Punctuation ' ' Text 'n' Name ')' Punctuation '\n' Text ' ' Text 'ptr' Name ' ' Text '=' Operator ' ' Text 'pointer' Name '(' Punctuation 'arr' Name ')' Punctuation '\n' Text ' ' Text 'offset' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer '\n' Text ' ' Text 'for' Keyword ' ' Text 'a' Name ' ' Text 'in' Keyword.Pseudo ' ' Text 'arrays' Name '\n' Text ' ' Text 'ccall' Keyword '(' Punctuation ':' Operator 'memcpy' Name ',' Punctuation ' ' Text 'Ptr' Keyword.Type '{' Punctuation 'Uint8' Name '}' Punctuation ',' Punctuation ' ' Text '(' Punctuation 'Ptr' Keyword.Type '{' Punctuation 'Uint8' Name '}' Punctuation ',' Punctuation ' ' Text 'Ptr' Keyword.Type '{' Punctuation 'Uint8' Name '}' Punctuation ',' Punctuation ' ' Text 'Uint' Name ')' Punctuation ',' Punctuation '\n' Text ' ' Text 'ptr' Name '+' Operator 'offset' Name ',' Punctuation ' ' Text 'a' Name ',' Punctuation ' ' Text 'length' Name '(' Punctuation 'a' Name ')' Punctuation ')' Punctuation '\n' Text ' ' Text 'offset' Name ' ' Text '+=' Operator ' ' Text 'length' Name '(' Punctuation 'a' Name ')' Punctuation '\n' Text ' ' Text 'end' Keyword '\n' Text ' ' Text 'return' Keyword ' ' Text 'arr' Name '\n' Text 'end' Keyword '\n' Text '\n' Text '# concatenate the data fields of byte strings' Comment '\n' Text '\n' Text 'memcat' Name '(' Punctuation 's' Name '::' Operator 'ByteString' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'memcat' Name '(' Punctuation 's' Name '.' Operator 'data' Name ')' Punctuation '\n' Text 'memcat' Name '(' Punctuation 'sx' Name '::' Operator 'ByteString' Name '.' Operator '.' Operator '.' Operator ')' Punctuation ' ' Text '=' Operator ' ' Text 'memcat' Name '(' Punctuation 'map' Name '(' Punctuation 's' Name '-' Operator '>' Operator 's' Name '.' Operator 'data' Name ',' Punctuation ' ' Text 'sx' Name ')' Punctuation '.' Operator '.' Operator '.' Operator ')' Punctuation '\n' Text