diff --git a/packages/CSTParser/docs/make.jl b/packages/CSTParser/docs/make.jl index a500114..09ca8ce 100644 --- a/packages/CSTParser/docs/make.jl +++ b/packages/CSTParser/docs/make.jl @@ -7,16 +7,16 @@ makedocs(; repo="https://github.com/julia-vscode/CSTParser.jl/blob/{commit}{path}#L{line}", sitename="CSTParser.jl", format=Documenter.HTML(; - prettyurls=prettyurls = get(ENV, "CI", nothing) == "true", + prettyurls=prettyurls = get(ENV, "CI", nothing) == "true" # canonical="https://www.julia-vscode.org/CSTParser.jl", # assets=String[], ), pages=[ "Home" => "index.md", "Syntax Reference" => "syntax.md", - ], + ] ) deploydocs(; - repo="github.com/julia-vscode/CSTParser.jl", + repo="github.com/julia-vscode/CSTParser.jl" ) diff --git a/packages/CSTParser/src/CSTParser.jl b/packages/CSTParser/src/CSTParser.jl index d8792dd..a212baf 100644 --- a/packages/CSTParser/src/CSTParser.jl +++ b/packages/CSTParser/src/CSTParser.jl @@ -3,7 +3,7 @@ module CSTParser using Tokenize import Tokenize.Tokens import Tokenize.Tokens: RawToken, AbstractToken, iskeyword, isliteral, isoperator, untokenize -import Tokenize.Lexers: Lexer, peekchar, iswhitespace, readchar, emit, emit_error, accept_batch, eof +import Tokenize.Lexers: Lexer, peekchar, iswhitespace, readchar, emit, emit_error, accept_batch, eof include("packagedef.jl") diff --git a/packages/CSTParser/src/components/internals.jl b/packages/CSTParser/src/components/internals.jl index 9cb9c5c..42cd07d 100644 --- a/packages/CSTParser/src/components/internals.jl +++ b/packages/CSTParser/src/components/internals.jl @@ -31,7 +31,7 @@ Parses an iterator, allowing for the preceding keyword `outer`. Returns an error expression if an invalid expression is parsed (anything other than `=`, `in`, `∈`). """ -function parse_iterator(ps::ParseState, outer = parse_outer(ps)) +function parse_iterator(ps::ParseState, outer=parse_outer(ps)) arg = @closer ps :range @closer ps :ws @nocloser ps :wsop parse_expression(ps) if !is_range(arg) arg = mErrorToken(ps, arg, InvalidIterator) @@ -135,7 +135,7 @@ function parse_call(ps::ParseState, ret::EXPR, ismacro=false) end # args = ismacro ? EXPR[ret, EXPR(:NOTHING, 0, 0)] : EXPR[ret] trivia = EXPR[EXPR(next(ps))] - @closeparen ps @default ps parse_comma_sep(ps, args, trivia, !ismacro, insert_params_at = ismacro ? 3 : 2) + @closeparen ps @default ps parse_comma_sep(ps, args, trivia, !ismacro, insert_params_at=ismacro ? 3 : 2) accept_rparen(ps, trivia) ret = EXPR(ismacro ? :macrocall : syntaxcall ? ret : :call, args, trivia) end @@ -146,7 +146,7 @@ end Parses a comma separated list, optionally allowing for conversion of assignment (`=`) expressions to `Kw`. """ -function parse_comma_sep(ps::ParseState, args::Vector{EXPR}, trivia::Vector{EXPR}, kw = true, block = false, istuple = false; insert_params_at = 2) +function parse_comma_sep(ps::ParseState, args::Vector{EXPR}, trivia::Vector{EXPR}, kw=true, block=false, istuple=false; insert_params_at=2) prevpos = position(ps) @nocloser ps :inwhere @nocloser ps :newline @closer ps :comma while !closer(ps) a = parse_expression(ps) @@ -205,11 +205,11 @@ end Parses parameter arguments for a function call (e.g. following a semicolon). """ -function parse_parameters(ps::ParseState, args::Vector{EXPR}, args1::Vector{EXPR} = EXPR[], insert_params_at = 2; usekw = true) +function parse_parameters(ps::ParseState, args::Vector{EXPR}, args1::Vector{EXPR}=EXPR[], insert_params_at=2; usekw=true) trivia = EXPR[] isfirst = isempty(args1) prevpos = position(ps) - @nocloser ps :inwhere @nocloser ps :newline @closer ps :comma while !isfirst || (@nocloser ps :semicolon !closer(ps)) + @nocloser ps :inwhere @nocloser ps :newline @closer ps :comma while !isfirst || (@nocloser ps :semicolon !closer(ps)) a = isfirst ? parse_expression(ps) : first(args1) if usekw && _do_kw_convert(ps, a) a = _kw_convert(a) @@ -347,7 +347,7 @@ end function get_appropriate_child_to_expand(x) if headof(x) === :generator && !(headof(x.args[1]) in (:generator, :flatten)) return x, x.args[1] - elseif headof(x) === :flatten && headof(x.args[1]) === :generator && headof(x.args[1].args[1]) === :generator + elseif headof(x) === :flatten && headof(x.args[1]) === :generator && headof(x.args[1].args[1]) === :generator x.args[1], x.args[1].args[1] else get_appropriate_child_to_expand(x.args[1]) @@ -365,7 +365,7 @@ function parse_nonstd_identifier(ps) end end -function parse_importexport_item(ps, is_colon = false) +function parse_importexport_item(ps, is_colon=false) if kindof(ps.nt) === Tokens.AT_SIGN parse_macroname(next(ps)) elseif kindof(ps.nt) === Tokens.LPAREN @@ -377,7 +377,7 @@ function parse_importexport_item(ps, is_colon = false) parse_unary(ps, INSTANCE(next(ps))) elseif !is_colon && isoperator(ps.nt) next(ps) - EXPR(:OPERATOR, ps.nt.startbyte - ps.t.startbyte, 1 + ps.t.endbyte - ps.t.startbyte, val(ps.t, ps)) + EXPR(:OPERATOR, ps.nt.startbyte - ps.t.startbyte, 1 + ps.t.endbyte - ps.t.startbyte, val(ps.t, ps)) elseif is_nonstd_identifier(ps) parse_nonstd_identifier(ps) else diff --git a/packages/CSTParser/src/components/keywords.jl b/packages/CSTParser/src/components/keywords.jl index 284c1dc..bd4ecd9 100644 --- a/packages/CSTParser/src/components/keywords.jl +++ b/packages/CSTParser/src/components/keywords.jl @@ -94,7 +94,7 @@ function parse_const(ps::ParseState) nt = ps.nt arg = parse_expression(ps) allow_no_assignment = has_flag(ps, ParserFlags.AllowConstWithoutAssignment) || - has_flag(ps, ParserFlags.InQuote) && (kindof(nt) === Tokens.GLOBAL || kindof(lt) === Tokens.GLOBAL) + has_flag(ps, ParserFlags.InQuote) && (kindof(nt) === Tokens.GLOBAL || kindof(lt) === Tokens.GLOBAL) if !allow_no_assignment && !(isassignment(unwrapbracket(arg)) || (headof(arg) === :global && length(arg.args) > 0 && isassignment(unwrapbracket(arg.args[1])))) arg = mErrorToken(ps, arg, ExpectedAssignment) end @@ -102,7 +102,7 @@ function parse_const(ps::ParseState) return ret end -function parse_local_global(ps::ParseState, islocal = true) +function parse_local_global(ps::ParseState, islocal=true) kw = EXPR(ps) if ps.nt.kind === Tokens.CONST arg1 = parse_const(next(ps)) @@ -358,7 +358,7 @@ end Parse an `if` block. """ -function parse_if(ps::ParseState, nested = false) +function parse_if(ps::ParseState, nested=false) args = EXPR[] trivia = EXPR[EXPR(ps)] @@ -428,7 +428,7 @@ function parse_try(ps::ParseState) args[3] = EXPR(:block, 0, 0, "") end else_trivia = EXPR(next(ps)) - else_arg = EXPR(:block, parse_block(ps, EXPR[], (Tokens.FINALLY,Tokens.END))) + else_arg = EXPR(:block, parse_block(ps, EXPR[], (Tokens.FINALLY, Tokens.END))) end has_finally = false diff --git a/packages/CSTParser/src/components/lists.jl b/packages/CSTParser/src/components/lists.jl index dcd1741..37140e0 100644 --- a/packages/CSTParser/src/components/lists.jl +++ b/packages/CSTParser/src/components/lists.jl @@ -46,7 +46,7 @@ function parse_tuple(ps::ParseState, ret::EXPR) end # XXX: Avert thine eyes. -function count_semicolons(ps, check_newline = true) +function count_semicolons(ps, check_newline=true) dims = 0 has_newline = false old_pos = position(ps.l.io) @@ -75,7 +75,7 @@ Having hit '[' return either: + A comprehension + An array (vcat of hcats) """ -function parse_array(ps::ParseState, isref = false) +function parse_array(ps::ParseState, isref=false) args = EXPR[] trivia = EXPR[EXPR(ps)] # [] or [;;;] @@ -100,7 +100,7 @@ function parse_array(ps::ParseState, isref = false) end end -binding_power(ps, nl = true) = +binding_power(ps, nl=true) = if kindof(ps.ws) == SemiColonWS -count_semicolons(ps, nl) elseif kindof(ps.ws) == NewLineWS @@ -149,7 +149,7 @@ function parse_array_outer(ps::ParseState, trivia, isref) args = EXPR[] push!(args, a) push!(trivia, accept_comma(ps)) - @closesquare ps parse_comma_sep(ps, args, trivia, isref, insert_params_at = 1) + @closesquare ps parse_comma_sep(ps, args, trivia, isref, insert_params_at=1) return EXPR(:vect, args, trivia) elseif kindof(ps.nt) === Tokens.ENDMARKER push!(args, a) @@ -309,7 +309,7 @@ function parse_barray(ps::ParseState) accept_rbrace(ps, trivia) ret = EXPR(:braces, args, trivia) else - first_arg = @nocloser ps :newline @closebrace ps @closer ps :ws @closer ps :wsop @closer ps :comma parse_expression(ps) + first_arg = @nocloser ps :newline @closebrace ps @closer ps :ws @closer ps :wsop @closer ps :comma parse_expression(ps) if kindof(ps.nt) === Tokens.RBRACE push!(args, first_arg) if kindof(ps.ws) == SemiColonWS @@ -320,7 +320,7 @@ function parse_barray(ps::ParseState) elseif iscomma(ps.nt) push!(args, first_arg) accept_comma(ps, trivia) - @closebrace ps parse_comma_sep(ps, args, trivia, true, insert_params_at = 1) + @closebrace ps parse_comma_sep(ps, args, trivia, true, insert_params_at=1) accept_rbrace(ps, trivia) return EXPR(:braces, args, trivia) elseif kindof(ps.ws) == NewLineWS @@ -328,7 +328,7 @@ function parse_barray(ps::ParseState) push!(ret, first_arg) prevpos = position(ps) while kindof(ps.nt) != Tokens.RBRACE && kindof(ps.nt) !== Tokens.ENDMARKER - a = @closebrace ps parse_expression(ps) + a = @closebrace ps parse_expression(ps) push!(ret, a) prevpos = loop_check(ps, prevpos) end diff --git a/packages/CSTParser/src/components/operators.jl b/packages/CSTParser/src/components/operators.jl index e0e6b06..4093355 100644 --- a/packages/CSTParser/src/components/operators.jl +++ b/packages/CSTParser/src/components/operators.jl @@ -1,41 +1,41 @@ -precedence(op::Int) = op < Tokens.end_assignments ? AssignmentOp : - op < Tokens.end_pairarrow ? 2 : - op < Tokens.end_conditional ? ConditionalOp : - op < Tokens.end_arrow ? ArrowOp : - op < Tokens.end_lazyor ? LazyOrOp : - op < Tokens.end_lazyand ? LazyAndOp : - op < Tokens.end_comparison ? ComparisonOp : - op < Tokens.end_pipe ? PipeOp : - op < Tokens.end_colon ? ColonOp : - op < Tokens.end_plus ? PlusOp : - op < Tokens.end_bitshifts ? BitShiftOp : - op < Tokens.end_times ? TimesOp : - op < Tokens.end_rational ? RationalOp : - op < Tokens.end_power ? PowerOp : - op < Tokens.end_decl ? DeclarationOp : - op < Tokens.end_where ? WhereOp : DotOp +precedence(op::Int) = op < Tokens.end_assignments ? AssignmentOp : + op < Tokens.end_pairarrow ? 2 : + op < Tokens.end_conditional ? ConditionalOp : + op < Tokens.end_arrow ? ArrowOp : + op < Tokens.end_lazyor ? LazyOrOp : + op < Tokens.end_lazyand ? LazyAndOp : + op < Tokens.end_comparison ? ComparisonOp : + op < Tokens.end_pipe ? PipeOp : + op < Tokens.end_colon ? ColonOp : + op < Tokens.end_plus ? PlusOp : + op < Tokens.end_bitshifts ? BitShiftOp : + op < Tokens.end_times ? TimesOp : + op < Tokens.end_rational ? RationalOp : + op < Tokens.end_power ? PowerOp : + op < Tokens.end_decl ? DeclarationOp : + op < Tokens.end_where ? WhereOp : DotOp precedence(kind::Tokens.Kind) = kind === Tokens.DDDOT ? DddotOp : - kind < Tokens.begin_assignments ? 0 : - kind < Tokens.end_assignments ? AssignmentOp : - kind < Tokens.end_pairarrow ? 2 : - kind < Tokens.end_conditional ? ConditionalOp : - kind < Tokens.end_arrow ? ArrowOp : - kind < Tokens.end_lazyor ? LazyOrOp : - kind < Tokens.end_lazyand ? LazyAndOp : - kind < Tokens.end_comparison ? ComparisonOp : - kind < Tokens.end_pipe ? PipeOp : - kind < Tokens.end_colon ? ColonOp : - kind < Tokens.end_plus ? PlusOp : - kind < Tokens.end_bitshifts ? BitShiftOp : - kind < Tokens.end_times ? TimesOp : - kind < Tokens.end_rational ? RationalOp : - kind < Tokens.end_power ? PowerOp : - kind < Tokens.end_decl ? DeclarationOp : - kind < Tokens.end_where ? WhereOp : - kind < Tokens.end_dot ? DotOp : - kind === Tokens.ANON_FUNC ? AnonFuncOp : - kind === Tokens.PRIME ? PrimeOp : 20 + kind < Tokens.begin_assignments ? 0 : + kind < Tokens.end_assignments ? AssignmentOp : + kind < Tokens.end_pairarrow ? 2 : + kind < Tokens.end_conditional ? ConditionalOp : + kind < Tokens.end_arrow ? ArrowOp : + kind < Tokens.end_lazyor ? LazyOrOp : + kind < Tokens.end_lazyand ? LazyAndOp : + kind < Tokens.end_comparison ? ComparisonOp : + kind < Tokens.end_pipe ? PipeOp : + kind < Tokens.end_colon ? ColonOp : + kind < Tokens.end_plus ? PlusOp : + kind < Tokens.end_bitshifts ? BitShiftOp : + kind < Tokens.end_times ? TimesOp : + kind < Tokens.end_rational ? RationalOp : + kind < Tokens.end_power ? PowerOp : + kind < Tokens.end_decl ? DeclarationOp : + kind < Tokens.end_where ? WhereOp : + kind < Tokens.end_dot ? DotOp : + kind === Tokens.ANON_FUNC ? AnonFuncOp : + kind === Tokens.PRIME ? PrimeOp : 20 precedence(x) = 0 precedence(x::AbstractToken) = precedence(kindof(x)) @@ -55,97 +55,97 @@ isunaryop(op::EXPR) = isoperator(op) && ((valof(op) == "<:" || valof(op) == "¬" || valof(op) == "&" || valof(op) == "√" || - valof(op) == "∛" || - valof(op) == "∜" || + valof(op) == "∛" || + valof(op) == "∜" || valof(op) == "::" || valof(op) == "\$" || valof(op) == ":" || valof(op) == "⋆" || valof(op) == "±" || valof(op) == "∓") || - (length(valof(op)) == 2 && valof(op)[1] == '.' && (valof(op)[2] == '+' || - valof(op)[2] == '-' || - valof(op)[2] == '!' || - valof(op)[2] == '~' || - valof(op)[2] == '¬' || - valof(op)[2] == '√' || - valof(op)[2] == '∛' || - valof(op)[2] == '∜' || - valof(op)[2] == '⋆' || - valof(op)[2] == '±' || - valof(op)[2] == '∓'))) + (length(valof(op)) == 2 && valof(op)[1] == '.' && (valof(op)[2] == '+' || + valof(op)[2] == '-' || + valof(op)[2] == '!' || + valof(op)[2] == '~' || + valof(op)[2] == '¬' || + valof(op)[2] == '√' || + valof(op)[2] == '∛' || + valof(op)[2] == '∜' || + valof(op)[2] == '⋆' || + valof(op)[2] == '±' || + valof(op)[2] == '∓'))) isunaryop(t::AbstractToken) = isunaryop(kindof(t)) @static if VERSION < v"1.2.0" isunaryop(kind::Tokens.Kind) = kind === Tokens.ISSUBTYPE || - kind === Tokens.ISSUPERTYPE || - kind === Tokens.PLUS || - kind === Tokens.MINUS || - kind === Tokens.NOT || - kind === Tokens.APPROX || - kind === Tokens.NOT_SIGN || - kind === Tokens.AND || - kind === Tokens.SQUARE_ROOT || - kind === Tokens.CUBE_ROOT || - kind === Tokens.QUAD_ROOT || - kind === Tokens.DECLARATION || - kind === Tokens.EX_OR || - kind === Tokens.COLON + kind === Tokens.ISSUPERTYPE || + kind === Tokens.PLUS || + kind === Tokens.MINUS || + kind === Tokens.NOT || + kind === Tokens.APPROX || + kind === Tokens.NOT_SIGN || + kind === Tokens.AND || + kind === Tokens.SQUARE_ROOT || + kind === Tokens.CUBE_ROOT || + kind === Tokens.QUAD_ROOT || + kind === Tokens.DECLARATION || + kind === Tokens.EX_OR || + kind === Tokens.COLON else isunaryop(kind::Tokens.Kind) = kind === Tokens.ISSUBTYPE || - kind === Tokens.ISSUPERTYPE || - kind === Tokens.PLUS || - kind === Tokens.MINUS || - kind === Tokens.NOT || - kind === Tokens.APPROX || - kind === Tokens.NOT_SIGN || - kind === Tokens.AND || - kind === Tokens.SQUARE_ROOT || - kind === Tokens.CUBE_ROOT || - kind === Tokens.QUAD_ROOT || - kind === Tokens.DECLARATION || - kind === Tokens.EX_OR || - kind === Tokens.COLON || - kind === Tokens.STAR_OPERATOR + kind === Tokens.ISSUPERTYPE || + kind === Tokens.PLUS || + kind === Tokens.MINUS || + kind === Tokens.NOT || + kind === Tokens.APPROX || + kind === Tokens.NOT_SIGN || + kind === Tokens.AND || + kind === Tokens.SQUARE_ROOT || + kind === Tokens.CUBE_ROOT || + kind === Tokens.QUAD_ROOT || + kind === Tokens.DECLARATION || + kind === Tokens.EX_OR || + kind === Tokens.COLON || + kind === Tokens.STAR_OPERATOR end isunaryandbinaryop(t) = false isunaryandbinaryop(t::AbstractToken) = isunaryandbinaryop(kindof(t)) @static if VERSION < v"1.2.0" isunaryandbinaryop(kind::Tokens.Kind) = kind === Tokens.PLUS || - kind === Tokens.MINUS || - kind === Tokens.EX_OR || - kind === Tokens.ISSUBTYPE || - kind === Tokens.ISSUPERTYPE || - kind === Tokens.AND || - kind === Tokens.APPROX || - kind === Tokens.DECLARATION || - kind === Tokens.COLON + kind === Tokens.MINUS || + kind === Tokens.EX_OR || + kind === Tokens.ISSUBTYPE || + kind === Tokens.ISSUPERTYPE || + kind === Tokens.AND || + kind === Tokens.APPROX || + kind === Tokens.DECLARATION || + kind === Tokens.COLON else isunaryandbinaryop(kind::Tokens.Kind) = kind === Tokens.PLUS || - kind === Tokens.MINUS || - kind === Tokens.EX_OR || - kind === Tokens.ISSUBTYPE || - kind === Tokens.ISSUPERTYPE || - kind === Tokens.AND || - kind === Tokens.APPROX || - kind === Tokens.DECLARATION || - kind === Tokens.COLON || - kind === Tokens.STAR_OPERATOR + kind === Tokens.MINUS || + kind === Tokens.EX_OR || + kind === Tokens.ISSUBTYPE || + kind === Tokens.ISSUPERTYPE || + kind === Tokens.AND || + kind === Tokens.APPROX || + kind === Tokens.DECLARATION || + kind === Tokens.COLON || + kind === Tokens.STAR_OPERATOR end isbinaryop(op) = false isbinaryop(op::EXPR) = isoperator(op) && !(valof(op) == "√" || - valof(op) == "∛" || - valof(op) == "∜" || - valof(op) == "!" || - valof(op) == "¬") + valof(op) == "∛" || + valof(op) == "∜" || + valof(op) == "!" || + valof(op) == "¬") isbinaryop(t::AbstractToken) = isbinaryop(kindof(t)) isbinaryop(kind::Tokens.Kind) = isoperator(kind) && - !(kind === Tokens.SQUARE_ROOT || - kind === Tokens.CUBE_ROOT || - kind === Tokens.QUAD_ROOT || - kind === Tokens.NOT || - kind === Tokens.NOT_SIGN) + !(kind === Tokens.SQUARE_ROOT || + kind === Tokens.CUBE_ROOT || + kind === Tokens.QUAD_ROOT || + kind === Tokens.NOT || + kind === Tokens.NOT_SIGN) function non_dotted_op(t::AbstractToken) k = kindof(t) @@ -176,20 +176,20 @@ function issyntaxcall(op::EXPR) return true end assign_prec(v) && !(v == "~" || v == ".~" || v == "=>") || - v == "-->" || - v == "||" || - v == ".||" || - v == "&&" || - v == ".&&" || - v == "<:" || - v == ">:" || - v == ":" || - v == "::" || - v == "." || - v == "..." || - v == "'" || - v == "where" || - v == "->" + v == "-->" || + v == "||" || + v == ".||" || + v == "&&" || + v == ".&&" || + v == "<:" || + v == ">:" || + v == ":" || + v == "::" || + v == "." || + v == "..." || + v == "'" || + v == "where" || + v == "->" end @@ -217,8 +217,8 @@ function parse_unary(ps::ParseState, op::EXPR) ret = EXPR(literalmap(kindof(ps.t)), op.fullspan + arg.fullspan, (op.fullspan + arg.span), string(is_plus(op) ? "+" : "-", val(ps.t, ps))) else prec = valof(op) == "::" ? DeclarationOp : - valof(op) == "&" ? DeclarationOp : - valof(op) == "\$" ? 20 : PowerOp + valof(op) == "&" ? DeclarationOp : + valof(op) == "\$" ? 20 : PowerOp arg = @closer ps :unary @precedence ps prec parse_expression(ps) if issyntaxunarycall(op) ret = EXPR(op, EXPR[arg], nothing) @@ -242,7 +242,7 @@ function parse_unary_colon(ps::ParseState, op::EXPR) end ret = EXPR(:quotenode, EXPR[id], EXPR[op]) elseif Tokens.begin_literal < kindof(ps.nt) < Tokens.CHAR || - isoperator(kindof(ps.nt)) || isidentifier(ps.nt) || kindof(ps.nt) === Tokens.TRUE || kindof(ps.nt) === Tokens.FALSE + isoperator(kindof(ps.nt)) || isidentifier(ps.nt) || kindof(ps.nt) === Tokens.TRUE || kindof(ps.nt) === Tokens.FALSE ret = EXPR(:quotenode, EXPR[INSTANCE(next(ps))], EXPR[op]) elseif closer(ps) ret = op @@ -364,7 +364,7 @@ function parse_operator_where(ps::ParseState, ret::EXPR, op::EXPR, setscope=true if headof(nextarg) === :braces pushfirst!(nextarg.args, ret) pushfirst!(nextarg.trivia, op) - ret = EXPR(:where, nextarg.args,nextarg.trivia) + ret = EXPR(:where, nextarg.args, nextarg.trivia) else ret = EXPR(:where, EXPR[ret, nextarg], EXPR[op]) end @@ -448,8 +448,8 @@ function parse_operator(ps::ParseState, ret::EXPR, op::EXPR) P = RationalOp end if headof(ret) === :call && (is_plus(ret.args[1]) || is_star(ret.args[1])) && - valof(ret.args[1]) == valof(op) && ret.args[1].span > 0 && - !(hastrivia(ret) && headof(ret[end]) === :RPAREN) + valof(ret.args[1]) == valof(op) && ret.args[1].span > 0 && + !(hastrivia(ret) && headof(ret[end]) === :RPAREN) # a + b -> a + b + c nextarg = @precedence ps P - LtoR(P) parse_expression(ps) !hastrivia(ret) && (ret.trivia = EXPR[]) @@ -472,14 +472,14 @@ function parse_operator(ps::ParseState, ret::EXPR, op::EXPR) ret = EXPR(op, EXPR[ret], nothing) elseif is_prime(op) if isidentifier(ret) || isliteral(ret) || - headof(ret) in ( - :call, :tuple, :brackets, :ref, :vect, :vcat, :hcat, :ncat, :typed_vcat, - :typed_hcat, :typed_ncat, :comprehension, :typed_comprehension, :curly, - :braces, :braces_cat - ) || - headof(ret) === :do || - is_dot(headof(ret)) || - is_prime(headof(ret)) + headof(ret) in ( + :call, :tuple, :brackets, :ref, :vect, :vcat, :hcat, :ncat, :typed_vcat, + :typed_hcat, :typed_ncat, :comprehension, :typed_comprehension, :curly, + :braces, :braces_cat + ) || + headof(ret) === :do || + is_dot(headof(ret)) || + is_prime(headof(ret)) if valof(op) == "'" ret = EXPR(op, EXPR[ret], nothing) else diff --git a/packages/CSTParser/src/components/strings.jl b/packages/CSTParser/src/components/strings.jl index ad6fe7d..37ceb44 100644 --- a/packages/CSTParser/src/components/strings.jl +++ b/packages/CSTParser/src/components/strings.jl @@ -81,13 +81,13 @@ function parse_string_or_cmd(ps::ParseState, prefixed=false) t_str = val(ps.t, ps) if istrip && length(t_str) == 6 if iscmd - return wrapwithcmdmacro(EXPR(:TRIPLESTRING , sfullspan, sspan, "")) + return wrapwithcmdmacro(EXPR(:TRIPLESTRING, sfullspan, sspan, "")) else return EXPR(:TRIPLESTRING, sfullspan, sspan, "") end elseif length(t_str) == 2 if iscmd - return wrapwithcmdmacro(EXPR(:STRING , sfullspan, sspan, "")) + return wrapwithcmdmacro(EXPR(:STRING, sfullspan, sspan, "")) else return EXPR(:STRING, sfullspan, sspan, "") end @@ -246,8 +246,8 @@ function parse_string_or_cmd(ps::ParseState, prefixed=false) end if iscmd str = istrip ? - t_str[nextind(t_str, 1, 3):prevind(t_str, sizeof(t_str), 3)] : - t_str[nextind(t_str, 1, 1):prevind(t_str, sizeof(t_str))] + t_str[nextind(t_str, 1, 3):prevind(t_str, sizeof(t_str), 3)] : + t_str[nextind(t_str, 1, 1):prevind(t_str, sizeof(t_str))] # remove common prefix: if lcp !== nothing str = replace(str, "\n$lcp" => "\n") @@ -277,7 +277,7 @@ function parse_string_or_cmd(ps::ParseState, prefixed=false) end # Drop leading newline if !isempty(ret.args) && isliteral(ret.args[1]) && headof(ret.args[1]) in single_string_T && - !isempty(valof(ret.args[1])) && valof(ret.args[1])[1] == '\n' && shoulddropleadingnewline + !isempty(valof(ret.args[1])) && valof(ret.args[1])[1] == '\n' && shoulddropleadingnewline ret.args[1] = dropleadingnewline(ret.args[1]) end end diff --git a/packages/CSTParser/src/conversion.jl b/packages/CSTParser/src/conversion.jl index 54428f6..c14ad8c 100644 --- a/packages/CSTParser/src/conversion.jl +++ b/packages/CSTParser/src/conversion.jl @@ -12,11 +12,11 @@ end function utf8proc_map_custom(str::String, options) norm_func = @cfunction julia_normalization_map Int32 (Int32, Ptr{Nothing}) nwords = ccall(:utf8proc_decompose_custom, Int, (Ptr{UInt8}, Int, Ptr{UInt8}, Int, Cint, Ptr{Nothing}, Ptr{Nothing}), - str, sizeof(str), C_NULL, 0, options, norm_func, C_NULL) + str, sizeof(str), C_NULL, 0, options, norm_func, C_NULL) nwords < 0 && Base.Unicode.utf8proc_error(nwords) buffer = Base.StringVector(nwords * 4) nwords = ccall(:utf8proc_decompose_custom, Int, (Ptr{UInt8}, Int, Ptr{UInt8}, Int, Cint, Ptr{Nothing}, Ptr{Nothing}), - str, sizeof(str), buffer, nwords, options, norm_func, C_NULL) + str, sizeof(str), buffer, nwords, options, norm_func, C_NULL) nwords < 0 && Base.Unicode.utf8proc_error(nwords) nbytes = ccall(:utf8proc_reencode, Int, (Ptr{UInt8}, Int, Cint), buffer, nwords, options) nbytes < 0 && Base.Unicode.utf8proc_error(nbytes) @@ -33,10 +33,10 @@ function sized_uint_literal(s::AbstractString, b::Integer) # We know integers are all ASCII, so we can use sizeof to compute # the length of ths string more quickly l = (sizeof(s) - 2) * b - l <= 8 && return Base.parse(UInt8, s) - l <= 16 && return Base.parse(UInt16, s) - l <= 32 && return Base.parse(UInt32, s) - l <= 64 && return Base.parse(UInt64, s) + l <= 8 && return Base.parse(UInt8, s) + l <= 16 && return Base.parse(UInt16, s) + l <= 32 && return Base.parse(UInt32, s) + l <= 64 && return Base.parse(UInt64, s) # l <= 128 && return Base.parse(UInt128, s) if l <= 128 @static if VERSION >= v"1.1" @@ -51,8 +51,8 @@ end function sized_uint_oct_literal(s::AbstractString) s[3] == 0 && return sized_uint_literal(s, 3) len = sizeof(s) - (len < 5 || (len == 5 && s <= "0o377")) && return Base.parse(UInt8, s) - (len < 8 || (len == 8 && s <= "0o177777")) && return Base.parse(UInt16, s) + (len < 5 || (len == 5 && s <= "0o377")) && return Base.parse(UInt8, s) + (len < 8 || (len == 8 && s <= "0o177777")) && return Base.parse(UInt16, s) (len < 13 || (len == 13 && s <= "0o37777777777")) && return Base.parse(UInt32, s) (len < 24 || (len == 24 && s <= "0o1777777777777777777777")) && return Base.parse(UInt64, s) # (len < 45 || (len == 45 && s <= "0o3777777777777777777777777777777777777777777")) && return Base.parse(UInt128, s) @@ -181,9 +181,9 @@ function to_codeobject(x::EXPR) elseif x.head === :quotenode # quote nodes in import/using are unwrapped by the Julia parser if x.parent isa EXPR && - x.parent.parent isa EXPR && - is_dot(x.parent.head) && - x.parent.parent.head in (:import, :using) + x.parent.parent isa EXPR && + is_dot(x.parent.head) && + x.parent.parent.head in (:import, :using) to_codeobject(x.args[1]) else QuoteNode(to_codeobject(x.args[1])) diff --git a/packages/CSTParser/src/display.jl b/packages/CSTParser/src/display.jl index 40c9023..952a974 100644 --- a/packages/CSTParser/src/display.jl +++ b/packages/CSTParser/src/display.jl @@ -1,21 +1,21 @@ -function Base.show(io::IO, x::EXPR, offset = 0, d = 0, er = false) +function Base.show(io::IO, x::EXPR, offset=0, d=0, er=false) T = headof(x) - c = T === :errortoken || er ? :red : :normal + c = T === :errortoken || er ? :red : :normal # Print span as 1-based range of the source string. This presentation is # simple to understand when strings are presented to CSTParser.parse(). print(io, lpad(offset + 1, 3), ":", rpad(offset + x.fullspan, 3), " ") if isidentifier(x) - printstyled(io, " "^d, headof(x) == :NONSTDIDENTIFIER ? valof(x.args[2]) : valof(x), color = :yellow) + printstyled(io, " "^d, headof(x) == :NONSTDIDENTIFIER ? valof(x.args[2]) : valof(x), color=:yellow) x.meta !== nothing && show(io, x.meta) print(io) elseif isoperator(x) - printstyled(io, " "^d, "OP: ", valof(x), color = c) + printstyled(io, " "^d, "OP: ", valof(x), color=c) elseif iskeyword(x) - printstyled(io, " "^d, headof(x), color = :magenta) + printstyled(io, " "^d, headof(x), color=:magenta) elseif ispunctuation(x) - printstyled(io, " "^d, punctuationprinting[headof(x)], color = c) + printstyled(io, " "^d, punctuationprinting[headof(x)], color=c) elseif isliteral(x) - printstyled(io, " "^d, "$(headof(x)): ", valof(x) === nothing ? "nothing" : valof(x), color = c) + printstyled(io, " "^d, "$(headof(x)): ", valof(x) === nothing ? "nothing" : valof(x), color=c) else printstyled(io, " "^d, T, color=c) if x.meta !== nothing diff --git a/packages/CSTParser/src/interface.jl b/packages/CSTParser/src/interface.jl index 3d132f8..392933c 100644 --- a/packages/CSTParser/src/interface.jl +++ b/packages/CSTParser/src/interface.jl @@ -3,8 +3,8 @@ isidentifier(x::EXPR) = headof(x) === :IDENTIFIER || headof(x) === :NONSTDIDENTI isoperator(x::EXPR) = headof(x) === :OPERATOR isnonstdid(x::EXPR) = headof(x) === :NONSTDIDENTIFIER iskeyword(x::EXPR) = headof(x) in (:ABSTRACT, :BAREMODULE, :BEGIN, :BREAK, :CATCH, :CONST, :CONTINUE, :DO, :ELSE, :ELSEIF, :END, :EXPORT, :FINALLY, :FOR, :FUNCTION, :GLOBAL, :IF, :IMPORT, :importall, :LET, :LOCAL, :MACRO, :MODULE, :MUTABLE, :NEW, :OUTER, :PRIMITIVE, :QUOTE, :RETURN, :STRUCT, :TRY, :TYPE, :USING, :WHILE) -isliteral(x::EXPR) = isstringliteral(x) || iscmd(x) || ischar(x) || headof(x) in (:INTEGER, :BININT, :HEXINT, :OCTINT, :FLOAT, :NOTHING, :TRUE, :FALSE) -ispunctuation(x::EXPR) = is_comma(x) || is_lparen(x) || is_rparen(x) || is_lsquare(x) || is_rsquare(x) || is_lbrace(x) || is_rbrace(x) || headof(x) === :ATSIGN || headof(x) === :DOT +isliteral(x::EXPR) = isstringliteral(x) || iscmd(x) || ischar(x) || headof(x) in (:INTEGER, :BININT, :HEXINT, :OCTINT, :FLOAT, :NOTHING, :TRUE, :FALSE) +ispunctuation(x::EXPR) = is_comma(x) || is_lparen(x) || is_rparen(x) || is_lsquare(x) || is_rsquare(x) || is_lbrace(x) || is_rbrace(x) || headof(x) === :ATSIGN || headof(x) === :DOT isstringliteral(x) = headof(x) === :STRING || headof(x) === :TRIPLESTRING isstring(x) = headof(x) === :string || isstringliteral(x) iscmd(x) = headof(x) === :CMD || headof(x) === :TRIPLECMD @@ -19,10 +19,10 @@ is_id_or_macroname(x::EXPR) = isidentifier(x) || ismacroname(x) # expressions iscall(x::EXPR) = headof(x) === :call isunarycall(x::EXPR) = (headof(x) === :call && length(x) == 2 && (isoperator(x.args[1]) || isoperator(x.args[2]))) -isunarysyntax(x::EXPR) = (isoperator(x.head) && length(x.args) == 1) +isunarysyntax(x::EXPR) = (isoperator(x.head) && length(x.args) == 1) isbinarycall(x::EXPR) = headof(x) === :call && length(x) == 3 && isoperator(x.args[1]) isbinarycall(x::EXPR, op) = headof(x) === :call && length(x) == 3 && isoperator(x.args[1]) && valof(x.args[1]) == op -isbinarysyntax(x::EXPR) = (isoperator(x.head) && length(x.args) == 2) +isbinarysyntax(x::EXPR) = (isoperator(x.head) && length(x.args) == 2) ischainedcall(x::EXPR) = headof(x) === :call && isoperator(x.args[1]) && (valof(x.args[1]) == "+" || valof(x.args[1]) == "*") && hastrivia(x) && isoperator(first(x.trivia)) iswhere(x::EXPR) = headof(x) === :where istuple(x::EXPR) = headof(x) === :tuple diff --git a/packages/CSTParser/src/iterate.jl b/packages/CSTParser/src/iterate.jl index c9ebd97..6e98fb8 100644 --- a/packages/CSTParser/src/iterate.jl +++ b/packages/CSTParser/src/iterate.jl @@ -80,7 +80,7 @@ function _getindex(x::EXPR, i) elseif iseven(i) x.trivia[div(i, 2)] else - x.args[div(i + 1, 2) + 1] + x.args[div(i + 1, 2)+1] end elseif length(x.args) > 1 && headof(x.args[2]) === :parameters if i == length(x) @@ -88,7 +88,7 @@ function _getindex(x::EXPR, i) elseif i == 1 x.args[1] elseif isodd(i) - x.args[div(i + 1, 2) + 1] + x.args[div(i + 1, 2)+1] else x.trivia[div(i, 2)] end @@ -155,7 +155,7 @@ function _getindex(x::EXPR, i) else x.args[2] end - elseif length(x) == 2 && (valof(headof(x)) == "\$" || valof(headof(x)) == "::" || valof(headof(x)) == "<:" || valof(headof(x)) == ">:" || valof(headof(x)) == "&") + elseif length(x) == 2 && (valof(headof(x)) == "\$" || valof(headof(x)) == "::" || valof(headof(x)) == "<:" || valof(headof(x)) == ">:" || valof(headof(x)) == "&") if i == 1 x.head else @@ -177,7 +177,7 @@ function _getindex(x::EXPR, i) elseif i == length(x) last(x.trivia) elseif isodd(i) - x.args[div(i+1, 2) - 1] + x.args[div(i + 1, 2)-1] else x.trivia[div(i, 2)] end @@ -187,7 +187,7 @@ function _getindex(x::EXPR, i) end end Base.iterate(x::EXPR) = length(x) == 0 ? nothing : (x[1], 1) -Base.iterate(x::EXPR, s) = s < length(x) ? (x[s + 1], s + 1) : nothing +Base.iterate(x::EXPR, s) = s < length(x) ? (x[s+1], s + 1) : nothing Base.firstindex(x::EXPR) = 1 Base.lastindex(x::EXPR) = x.args === nothing ? 0 : length(x) @@ -263,7 +263,7 @@ function _global(x, i) elseif isodd(i) x.args[div(i - 1, 2)] else - x.trivia[div(i - 2, 2) + 2] + x.trivia[div(i - 2, 2)+2] end else if hastrivia(x) && (headof(first(x.trivia)) === :GLOBAL || headof(first(x.trivia)) === :LOCAL) @@ -301,7 +301,7 @@ function _struct(x, i) if i == 1 x.trivia[1] elseif 1 < i < 5 - x.args[i - 1] + x.args[i-1] elseif i == 5 x.trivia[2] end @@ -309,7 +309,7 @@ function _struct(x, i) if i < 3 x.trivia[i] elseif 2 < i < 6 - x.args[i - 2] + x.args[i-2] elseif i == 6 x.trivia[3] end @@ -322,7 +322,7 @@ function _block(x, i) if i == 1 x.trivia[1] elseif 1 < i < length(x) - x.args[i - 1] + x.args[i-1] elseif i == length(x) x.trivia[2] end @@ -365,7 +365,8 @@ end function _function(x, i) if length(x.args) == 1 tat(x, i) - else length(x.args) == 2 + else + length(x.args) == 2 taat(x, i) end end @@ -379,7 +380,7 @@ function _braces(x, i) elseif i == length(x) - 1 x.args[1] elseif iseven(i) - x.args[div(i, 2) + 1] + x.args[div(i, 2)+1] else x.trivia[div(i + 1, 2)] end @@ -401,7 +402,7 @@ function _curly(x, i) if i == length(x) - 1 x.args[2] elseif isodd(i) - x.args[div(i + 1, 2) + 1] + x.args[div(i + 1, 2)+1] else x.trivia[div(i, 2)] end @@ -426,7 +427,7 @@ function _colon_in_using(x, i) elseif isodd(i) x.args[div(i + 1, 2)] else - x.trivia[div(i, 2) - 1] + x.trivia[div(i, 2)-1] end end @@ -446,13 +447,13 @@ function _dot(x, i) x.args[i] elseif iseven(ndots) if isodd(i) - x.args[ndots + div(i - ndots + 1, 2)] + x.args[ndots+div(i - ndots + 1, 2)] else x.trivia[div(i - ndots, 2)] end else if iseven(i) - x.args[ndots + div(i - ndots + 1, 2)] + x.args[ndots+div(i - ndots + 1, 2)] else x.trivia[div(i - ndots, 2)] end @@ -499,7 +500,7 @@ function _call(x, i) if iseven(i) x.trivia[div(i - 2, 2)] else - x.args[div(i - 3, 2) + 3] + x.args[div(i - 3, 2)+3] end end end @@ -532,7 +533,7 @@ function _tuple(x, i) elseif isodd(i) x.trivia[div(i + 1, 2)] else - x.args[div(i, 2) + 1] + x.args[div(i, 2)+1] end else if isempty(x.args) @@ -574,17 +575,17 @@ function _if(x, i) if length(x) == 4 # if c expr end taat(x, i) elseif length(x) == 5 # if c expr elseif... end - if i == 1 - x.trivia[1] - elseif i == 2 - x.args[1] - elseif i == 3 - x.args[2] - elseif i == 4 - x.args[3] - elseif i == 5 - x.trivia[2] - end + if i == 1 + x.trivia[1] + elseif i == 2 + x.args[1] + elseif i == 3 + x.args[2] + elseif i == 4 + x.args[3] + elseif i == 5 + x.trivia[2] + end elseif length(x) == 6 # if c expr else expr end if i == 1 x.trivia[1] @@ -619,14 +620,14 @@ function _elseif(x, i) if i == 1 x.trivia[1] else - x.args[i - 1] + x.args[i-1] end end end function _string(x, i) # TODO: this is mega slow - ai, ti = 1,1 + ai, ti = 1, 1 arg = isstringliteral(x.args[1])# && sizeof(valof(x.args[1])) !== x.args[1].fullspan isinterpolant = !arg bracket = false @@ -660,7 +661,7 @@ function _string(x, i) end else if is_exor(x.trivia[ti]) || (x.trivia[ti].head === :errortoken && x.trivia[ti].args[1].head === :OPERATOR && valof(x.trivia[ti].args[1]) == "\$") - if ti < length(x.trivia) && is_lparen(x.trivia[ti + 1]) + if ti < length(x.trivia) && is_lparen(x.trivia[ti+1]) # else isinterpolant = true @@ -696,13 +697,13 @@ function _macrocall(x, i) elseif isodd(i) x.trivia[div(i, 2)] else - x.args[div(i + 1, 2) + 2] + x.args[div(i + 1, 2)+2] end else if isodd(i) x.trivia[div(i, 2)] else - x.args[div(i + 1, 2) + 1] + x.args[div(i + 1, 2)+1] end end end @@ -717,11 +718,11 @@ function _vcat(x, i) x.trivia[1] elseif i == length(x) x.trivia[2] - elseif (i-1) > length(x.args) + elseif (i - 1) > length(x.args) # TODO Remove once we have figured out what is causing this bug error("Illegal indexing into CSTParser. x.head: '$(x.head)', x.trivia: '$(x.trivia)', x.args: '$(x.args)'.") else - x.args[i - 1] + x.args[i-1] end end @@ -733,7 +734,7 @@ function _typed_vcat(x, i) elseif i == length(x) x.trivia[2] else - x.args[i - 1] + x.args[i-1] end end @@ -758,7 +759,7 @@ function _filter(x, i) elseif iseven(i) x.trivia[div(i, 2)] else - x.args[div(i + 1, 2) + 1] + x.args[div(i + 1, 2)+1] end end @@ -839,7 +840,7 @@ function _where(x, i) elseif isodd(i) x.trivia[div(i + 1, 2)] else - x.args[div(i, 2) + 1] + x.args[div(i, 2)+1] end else oddt_evena(x, i) @@ -852,7 +853,7 @@ function _flatten(x, i) lhs[i] end -function _flatten_lhs(x, ret = []) +function _flatten_lhs(x, ret=[]) if x.args[1].head === :generator || x.args[1].head === :flatten if headof(x) !== :flatten for i = 2:length(x) diff --git a/packages/CSTParser/src/lexer.jl b/packages/CSTParser/src/lexer.jl index 458bf1b..6ca8659 100644 --- a/packages/CSTParser/src/lexer.jl +++ b/packages/CSTParser/src/lexer.jl @@ -58,8 +58,8 @@ function ParseState(str::Union{IOBuffer,String}, loc::Int) end module ParserFlags - const AllowConstWithoutAssignment = 0x1 - const InQuote = 0x2 +const AllowConstWithoutAssignment = 0x1 +const InQuote = 0x2 end enable!(ps::ParseState, flag::Integer) = ps.flags |= flag @@ -73,10 +73,11 @@ function Base.show(io::IO, ps::ParseState) println(io, "next : ", kindof(ps.nt), " ($(ps.nt))", " ($(wstype(ps.nws)))") end peekchar(ps::ParseState) = peekchar(ps.l) -if !applicable(Base.peek, Tuple{IOBuffer, Char}) +if !applicable(Base.peek, Tuple{IOBuffer,Char}) function _peek(s::IO, ::Type{T}) where T mark(s) - try read(s, T)::T + try + read(s, T)::T finally reset(s) end @@ -87,8 +88,8 @@ else end wstype(t::AbstractToken) = kindof(t) == EmptyWS ? "empty" : - kindof(t) == NewLineWS ? "ws w/ newline" : - kindof(t) == SemiColonWS ? "ws w/ semicolon" : "ws" + kindof(t) == NewLineWS ? "ws w/ newline" : + kindof(t) == SemiColonWS ? "ws w/ semicolon" : "ws" function next(ps::ParseState) # shift old tokens @@ -199,16 +200,16 @@ end isemptyws(t::AbstractToken) = kindof(t) == EmptyWS isnewlinews(t::AbstractToken) = kindof(t) === NewLineWS isendoflinews(t::AbstractToken) = kindof(t) == SemiColonWS || kindof(t) == NewLineWS -@inline val(token::AbstractToken, ps::ParseState) = String(ps.l.io.data[token.startbyte + 1:token.endbyte + 1]) +@inline val(token::AbstractToken, ps::ParseState) = String(ps.l.io.data[token.startbyte+1:token.endbyte+1]) both_symbol_and_op(t::AbstractToken) = kindof(t) === Tokens.WHERE || kindof(t) === Tokens.IN || kindof(t) === Tokens.ISA isprefixableliteral(t::AbstractToken) = (kindof(t) === Tokens.STRING || kindof(t) === Tokens.TRIPLE_STRING || kindof(t) === Tokens.CMD || kindof(t) === Tokens.TRIPLE_CMD) isassignmentop(t::AbstractToken) = Tokens.begin_assignments < kindof(t) < Tokens.end_assignments isidentifier(t::AbstractToken) = kindof(t) === Tokens.IDENTIFIER isliteral(t::AbstractToken) = Tokens.begin_literal < kindof(t) < Tokens.end_literal -isbool(t::AbstractToken) = Tokens.TRUE ≤ kindof(t) ≤ Tokens.FALSE -iscomma(t::AbstractToken) = kindof(t) === Tokens.COMMA -iscolon(t::AbstractToken) = kindof(t) === Tokens.COLON +isbool(t::AbstractToken) = Tokens.TRUE ≤ kindof(t) ≤ Tokens.FALSE +iscomma(t::AbstractToken) = kindof(t) === Tokens.COMMA +iscolon(t::AbstractToken) = kindof(t) === Tokens.COLON iskeyword(t::AbstractToken) = Tokens.iskeyword(kindof(t)) isinstance(t::AbstractToken) = isidentifier(t) || isliteral(t) || isbool(t) || iskeyword(t) ispunctuation(t::AbstractToken) = iscomma(t) || kindof(t) === Tokens.END || Tokens.LSQUARE ≤ kindof(t) ≤ Tokens.RPAREN || kindof(t) === Tokens.AT_SIGN diff --git a/packages/CSTParser/src/packagedef.jl b/packages/CSTParser/src/packagedef.jl index c547b8e..9985825 100644 --- a/packages/CSTParser/src/packagedef.jl +++ b/packages/CSTParser/src/packagedef.jl @@ -33,7 +33,7 @@ Acceptable starting tokens are: + An `@`. """ -function parse_expression(ps::ParseState, esc_on_error = false) +function parse_expression(ps::ParseState, esc_on_error=false) if kindof(ps.nt) === Tokens.ENDMARKER ret = mErrorToken(ps, UnexpectedToken) elseif (esc_on_error && ps.nt.kind == Tokens.ERROR) @@ -142,9 +142,9 @@ function parse_compound(ps::ParseState, ret::EXPR) # prime operator followed by an identifier has an implicit multiplication nextarg = @precedence ps TimesOp parse_expression(ps) ret = EXPR(:call, EXPR[EXPR(:OPERATOR, 0, 0, "*"), ret, nextarg], nothing) -# ############################################################################### -# Everything below here is an error -# ############################################################################### + # ############################################################################### + # Everything below here is an error + # ############################################################################### else ps.errored = true if kindof(ps.nt) in (Tokens.RPAREN, Tokens.RSQUARE, Tokens.RBRACE) @@ -172,7 +172,7 @@ Parses an expression starting with a `(`. function parse_paren(ps::ParseState) args = EXPR[] trivia = EXPR[EXPR(ps)] - @closeparen ps @default ps @nocloser ps :inwhere parse_comma_sep(ps, args, trivia, false, true, true, insert_params_at = 1) + @closeparen ps @default ps @nocloser ps :inwhere parse_comma_sep(ps, args, trivia, false, true, true, insert_params_at=1) if length(args) == 1 && length(trivia) == 1 && ((kindof(ps.ws) !== SemiColonWS || headof(args[1]) === :block) && headof(args[1]) !== :parameters) accept_rparen(ps, trivia) ret = EXPR(:brackets, args, trivia) @@ -291,10 +291,10 @@ end function _continue_doc_parse(ps::ParseState, x::EXPR) kindof(ps.nt) !== Tokens.ENDMARKER && - headof(x) === :macrocall && - valof(x.args[1]) == "@doc" && - length(x.args) < 4 && - ps.t.endpos[1] + 1 == ps.nt.startpos[1] + headof(x) === :macrocall && + valof(x.args[1]) == "@doc" && + length(x.args) < 4 && + ps.t.endpos[1] + 1 == ps.nt.startpos[1] end include("precompile.jl") diff --git a/packages/CSTParser/src/recovery.jl b/packages/CSTParser/src/recovery.jl index 42db18f..d54e6ae 100644 --- a/packages/CSTParser/src/recovery.jl +++ b/packages/CSTParser/src/recovery.jl @@ -53,8 +53,8 @@ end function requires_no_ws(x, ps) if !(kindof(ps.nt) === Tokens.RPAREN || - kindof(ps.nt) === Tokens.RBRACE || - kindof(ps.nt) === Tokens.RSQUARE || kindof(ps.nt) === Tokens.END) && x.span != x.fullspan + kindof(ps.nt) === Tokens.RBRACE || + kindof(ps.nt) === Tokens.RSQUARE || kindof(ps.nt) === Tokens.END) && x.span != x.fullspan return mErrorToken(ps, x, UnexpectedWhiteSpace) else return x diff --git a/packages/CSTParser/src/spec.jl b/packages/CSTParser/src/spec.jl index f7350b3..44e562c 100644 --- a/packages/CSTParser/src/spec.jl +++ b/packages/CSTParser/src/spec.jl @@ -1,29 +1,29 @@ # Operator hierarchy -const AssignmentOp = 1 +const AssignmentOp = 1 const ConditionalOp = 2 -const ArrowOp = 3 -const LazyOrOp = 4 -const LazyAndOp = 5 -const ComparisonOp = 6 -const PipeOp = 7 -const ColonOp = 8 -const PlusOp = 9 +const ArrowOp = 3 +const LazyOrOp = 4 +const LazyAndOp = 5 +const ComparisonOp = 6 +const PipeOp = 7 +const ColonOp = 8 +const PlusOp = 9 @static if Base.operator_precedence(:<<) == 12 - const BitShiftOp = 10 - const TimesOp = 11 - const RationalOp = 12 + const BitShiftOp = 10 + const TimesOp = 11 + const RationalOp = 12 else - const TimesOp = 10 - const RationalOp = 11 - const BitShiftOp = 12 + const TimesOp = 10 + const RationalOp = 11 + const BitShiftOp = 12 end -const PowerOp = 13 +const PowerOp = 13 const DeclarationOp = 14 -const WhereOp = 15 -const DotOp = 16 -const PrimeOp = 16 -const DddotOp = 7 -const AnonFuncOp = 14 +const WhereOp = 15 +const DotOp = 16 +const PrimeOp = 16 +const DddotOp = 7 +const AnonFuncOp = 14 @enum(ErrorKind, UnexpectedToken, @@ -118,20 +118,20 @@ function EXPR(head::Union{Symbol,EXPR}, args::Vector{EXPR}, trivia::Union{Vector ex end -function EXPR(head::Union{Symbol,EXPR}, args::Vector{EXPR}, trivia::Union{Vector{EXPR},Nothing} = EXPR[]) +function EXPR(head::Union{Symbol,EXPR}, args::Vector{EXPR}, trivia::Union{Vector{EXPR},Nothing}=EXPR[]) ret = EXPR(head, args, trivia, 0, 0) update_span!(ret) ret end # These methods are for terminal/childless expressions. -@noinline EXPR(head::Union{Symbol,EXPR}, fullspan::Int, span::Int, val = nothing) = EXPR(head, nothing, nothing, fullspan, span, val, nothing, nothing) +@noinline EXPR(head::Union{Symbol,EXPR}, fullspan::Int, span::Int, val=nothing) = EXPR(head, nothing, nothing, fullspan, span, val, nothing, nothing) @noinline EXPR(head::Union{Symbol,EXPR}, ps::ParseState) = EXPR(head, ps.nt.startbyte - ps.t.startbyte, ps.t.endbyte - ps.t.startbyte + 1, val(ps.t, ps)) @noinline EXPR(ps::ParseState) = EXPR(tokenkindtoheadmap(kindof(ps.t)), ps) @noinline function mLITERAL(ps::ParseState) if kindof(ps.t) === Tokens.STRING || kindof(ps.t) === Tokens.TRIPLE_STRING || - kindof(ps.t) === Tokens.CMD || kindof(ps.t) === Tokens.TRIPLE_CMD + kindof(ps.t) === Tokens.CMD || kindof(ps.t) === Tokens.TRIPLE_CMD return parse_string_or_cmd(ps) else v = val(ps.t, ps) @@ -165,7 +165,7 @@ function update_span!(x::EXPR) end if x.head isa EXPR && isoperator(x.head) && (is_dddot(x.head) || is_prime(x.head)) # trailing unary operator - x.span = x.fullspan - x.head.fullspan + x.head.span + x.span = x.fullspan - x.head.fullspan + x.head.span elseif hastrivia(x) && lastchildistrivia(x) x.span = x.fullspan - last(x.trivia).fullspan + last(x.trivia).span elseif !isempty(x.args) diff --git a/packages/CSTParser/src/utils.jl b/packages/CSTParser/src/utils.jl index 699d998..8684aa1 100644 --- a/packages/CSTParser/src/utils.jl +++ b/packages/CSTParser/src/utils.jl @@ -6,49 +6,49 @@ stop. """ function closer(ps::ParseState) kindof(ps.nt) === Tokens.ENDMARKER || - (ps.closer.newline && kindof(ps.ws) == NewLineWS && !iscomma(ps.t)) || - (ps.closer.semicolon && kindof(ps.ws) == SemiColonWS) || - (isoperator(ps.nt) && precedence(ps.nt) <= ps.closer.precedence) || - (kindof(ps.nt) === Tokens.WHERE && ps.closer.precedence == LazyAndOp) || - (ps.closer.inwhere && kindof(ps.nt) === Tokens.WHERE) || - (ps.closer.inwhere && ps.closer.ws && kindof(ps.t) === Tokens.RPAREN && isoperator(ps.nt) && precedence(ps.nt) < DeclarationOp) || - (ps.closer.precedence > WhereOp && ( - (kindof(ps.nt) === Tokens.LPAREN && !(kindof(ps.t) === Tokens.EX_OR)) || - kindof(ps.nt) === Tokens.LBRACE || - kindof(ps.nt) === Tokens.LSQUARE || - (kindof(ps.nt) === Tokens.STRING && isemptyws(ps.ws)) || - ((kindof(ps.nt) === Tokens.RPAREN || kindof(ps.nt) === Tokens.RSQUARE) && isidentifier(ps.nt)) - )) || - (iscomma(ps.nt) && ps.closer.precedence > AssignmentOp) || - kindof(ps.nt) === Tokens.ENDMARKER || - (ps.closer.comma && iscomma(ps.nt)) || - (ps.closer.tuple && (iscomma(ps.nt) || isassignmentop(ps.nt))) || - (kindof(ps.nt) === Tokens.FOR && ps.closer.precedence > -1) || - (ps.closer.block && kindof(ps.nt) === Tokens.END) || - (ps.closer.paren && kindof(ps.nt) === Tokens.RPAREN) || - (ps.closer.brace && kindof(ps.nt) === Tokens.RBRACE) || - (ps.closer.square && kindof(ps.nt) === Tokens.RSQUARE) || - # tilde parsing in vect exprs needs to be special cased because `~` has assignment precedence - (@static VERSION < v"1.4" ? - false : - ((ps.closer.insquare || ps.closer.inmacro) && kindof(ps.nt) === Tokens.APPROX && !isemptyws(ps.ws) && isemptyws(ps.nws)) - ) || - kindof(ps.nt) === Tokens.ELSEIF || - kindof(ps.nt) === Tokens.ELSE || - kindof(ps.nt) === Tokens.CATCH || - kindof(ps.nt) === Tokens.FINALLY || - (ps.closer.ifop && isoperator(ps.nt) && (precedence(ps.nt) <= 0 || kindof(ps.nt) === Tokens.COLON)) || - (ps.closer.range && (kindof(ps.nt) === Tokens.FOR || iscomma(ps.nt) || kindof(ps.nt) === Tokens.IF)) || - (ps.closer.ws && !isemptyws(ps.ws) && - !iscomma(ps.nt) && - !iscomma(ps.t) && - !(!ps.closer.inmacro && kindof(ps.nt) === Tokens.FOR) && - !(kindof(ps.nt) === Tokens.DO) && - !( - (isbinaryop(ps.nt) && !(ps.closer.wsop && isemptyws(ps.nws) && isunaryop(ps.nt) && precedence(ps.nt) > 7)) || - (isunaryop(ps.t) && kindof(ps.ws) == WS && kindof(ps.lt) !== CSTParser.Tokens.COLON) + (ps.closer.newline && kindof(ps.ws) == NewLineWS && !iscomma(ps.t)) || + (ps.closer.semicolon && kindof(ps.ws) == SemiColonWS) || + (isoperator(ps.nt) && precedence(ps.nt) <= ps.closer.precedence) || + (kindof(ps.nt) === Tokens.WHERE && ps.closer.precedence == LazyAndOp) || + (ps.closer.inwhere && kindof(ps.nt) === Tokens.WHERE) || + (ps.closer.inwhere && ps.closer.ws && kindof(ps.t) === Tokens.RPAREN && isoperator(ps.nt) && precedence(ps.nt) < DeclarationOp) || + (ps.closer.precedence > WhereOp && ( + (kindof(ps.nt) === Tokens.LPAREN && !(kindof(ps.t) === Tokens.EX_OR)) || + kindof(ps.nt) === Tokens.LBRACE || + kindof(ps.nt) === Tokens.LSQUARE || + (kindof(ps.nt) === Tokens.STRING && isemptyws(ps.ws)) || + ((kindof(ps.nt) === Tokens.RPAREN || kindof(ps.nt) === Tokens.RSQUARE) && isidentifier(ps.nt)) )) || - (ps.closer.unary && (kindof(ps.t) in (Tokens.INTEGER, Tokens.FLOAT, Tokens.RPAREN, Tokens.RSQUARE, Tokens.RBRACE) && isidentifier(ps.nt))) + (iscomma(ps.nt) && ps.closer.precedence > AssignmentOp) || + kindof(ps.nt) === Tokens.ENDMARKER || + (ps.closer.comma && iscomma(ps.nt)) || + (ps.closer.tuple && (iscomma(ps.nt) || isassignmentop(ps.nt))) || + (kindof(ps.nt) === Tokens.FOR && ps.closer.precedence > -1) || + (ps.closer.block && kindof(ps.nt) === Tokens.END) || + (ps.closer.paren && kindof(ps.nt) === Tokens.RPAREN) || + (ps.closer.brace && kindof(ps.nt) === Tokens.RBRACE) || + (ps.closer.square && kindof(ps.nt) === Tokens.RSQUARE) || + # tilde parsing in vect exprs needs to be special cased because `~` has assignment precedence + (@static VERSION < v"1.4" ? + false : + ((ps.closer.insquare || ps.closer.inmacro) && kindof(ps.nt) === Tokens.APPROX && !isemptyws(ps.ws) && isemptyws(ps.nws)) + ) || + kindof(ps.nt) === Tokens.ELSEIF || + kindof(ps.nt) === Tokens.ELSE || + kindof(ps.nt) === Tokens.CATCH || + kindof(ps.nt) === Tokens.FINALLY || + (ps.closer.ifop && isoperator(ps.nt) && (precedence(ps.nt) <= 0 || kindof(ps.nt) === Tokens.COLON)) || + (ps.closer.range && (kindof(ps.nt) === Tokens.FOR || iscomma(ps.nt) || kindof(ps.nt) === Tokens.IF)) || + (ps.closer.ws && !isemptyws(ps.ws) && + !iscomma(ps.nt) && + !iscomma(ps.t) && + !(!ps.closer.inmacro && kindof(ps.nt) === Tokens.FOR) && + !(kindof(ps.nt) === Tokens.DO) && + !( + (isbinaryop(ps.nt) && !(ps.closer.wsop && isemptyws(ps.nws) && isunaryop(ps.nt) && precedence(ps.nt) > 7)) || + (isunaryop(ps.t) && kindof(ps.ws) == WS && kindof(ps.lt) !== CSTParser.Tokens.COLON) + )) || + (ps.closer.unary && (kindof(ps.t) in (Tokens.INTEGER, Tokens.FLOAT, Tokens.RPAREN, Tokens.RSQUARE, Tokens.RBRACE) && isidentifier(ps.nt))) end """ @@ -207,10 +207,10 @@ end isajuxtaposition(ps::ParseState, ret::EXPR) = ((isnumber(ret) && (isidentifier(ps.nt) || kindof(ps.nt) === Tokens.LPAREN || kindof(ps.nt) === Tokens.CMD || kindof(ps.nt) === Tokens.STRING || kindof(ps.nt) === Tokens.TRIPLE_STRING)) || - ((is_prime(ret.head) && isidentifier(ps.nt)) || - ((kindof(ps.t) === Tokens.RPAREN || kindof(ps.t) === Tokens.RSQUARE) && (isidentifier(ps.nt) || kindof(ps.nt) === Tokens.CMD)) || - ((kindof(ps.t) === Tokens.STRING || kindof(ps.t) === Tokens.TRIPLE_STRING) && (kindof(ps.nt) === Tokens.STRING || kindof(ps.nt) === Tokens.TRIPLE_STRING)))) || ((kindof(ps.t) in (Tokens.INTEGER, Tokens.FLOAT) || kindof(ps.t) in (Tokens.RPAREN, Tokens.RSQUARE, Tokens.RBRACE)) && isidentifier(ps.nt)) || - (isnumber(ret) && ps.closer.inref && (ps.nt.kind === Tokens.END || ps.nt.kind === Tokens.BEGIN)) + ((is_prime(ret.head) && isidentifier(ps.nt)) || + ((kindof(ps.t) === Tokens.RPAREN || kindof(ps.t) === Tokens.RSQUARE) && (isidentifier(ps.nt) || kindof(ps.nt) === Tokens.CMD)) || + ((kindof(ps.t) === Tokens.STRING || kindof(ps.t) === Tokens.TRIPLE_STRING) && (kindof(ps.nt) === Tokens.STRING || kindof(ps.nt) === Tokens.TRIPLE_STRING)))) || ((kindof(ps.t) in (Tokens.INTEGER, Tokens.FLOAT) || kindof(ps.t) in (Tokens.RPAREN, Tokens.RSQUARE, Tokens.RBRACE)) && isidentifier(ps.nt)) || + (isnumber(ret) && ps.closer.inref && (ps.nt.kind === Tokens.END || ps.nt.kind === Tokens.BEGIN)) """ has_error(ps::ParseState) @@ -277,8 +277,8 @@ Reversed version of firstdiff but returns two indices, one for each string. """ function revfirstdiff(s0::AbstractString, s1::AbstractString) minlength = min(sizeof(s0), sizeof(s1)) - @inbounds for i in 0:minlength - 1 - if codeunits(s0)[end - i] !== codeunits(s1)[end - i] + @inbounds for i in 0:minlength-1 + if codeunits(s0)[end-i] !== codeunits(s1)[end-i] return sizeof(s0) - i, sizeof(s1) - i# This could return a non-commencing byte of a multi-byte unicode sequence. end end @@ -305,20 +305,20 @@ end comp(x, y) = x == y function comp(x::CSTParser.EXPR, y::CSTParser.EXPR) comp(x.head, y.head) && - x.span == y.span && - x.fullspan == y.fullspan && - x.val == y.val && - length(x) == length(y) && - all(comp(x[i], y[i]) for i = 1:length(x)) + x.span == y.span && + x.fullspan == y.fullspan && + x.val == y.val && + length(x) == length(y) && + all(comp(x[i], y[i]) for i = 1:length(x)) end -function minimal_reparse(s0, s1, x0 = CSTParser.parse(s0, true), x1 = CSTParser.parse(s1, true); inds = false) +function minimal_reparse(s0, s1, x0=CSTParser.parse(s0, true), x1=CSTParser.parse(s1, true); inds=false) if has_error(x0) return inds ? (1:0, 1:length(x1.args), 1:0) : x1 # Error while re-parsing, so lets return the whole expression instead of patching end if sizeof(s0) !== x0.fullspan - error("minimal reparse - original input text length doesn't match the full span of the provided CST.") + error("minimal reparse - original input text length doesn't match the full span of the provided CST.") # return inds ? (1:0, 1:length(x1.args), 1:0) : x1 end @@ -328,7 +328,7 @@ function minimal_reparse(s0, s1, x0 = CSTParser.parse(s0, true), x1 = CSTParser. if sizeof(s1) !== x1.fullspan error("minimal reparse - new input text length doesn't match the full span of the provided CST.") - # return inds ? (1:0, 1:length(x1.args), 1:0) : x1 + # return inds ? (1:0, 1:length(x1.args), 1:0) : x1 end isempty(x0.args) && return inds ? (1:0, 1:length(x1.args), 1:0) : x1 # Original CST was empty x1.fullspan == 0 && return inds ? (1:0, 1:0, 1:0) : x1 # New CST is empty @@ -351,30 +351,30 @@ function minimal_reparse(s0, s1, x0 = CSTParser.parse(s0, true), x1 = CSTParser. # we can re-use x0.args[r1] # assume we'll just use x1.args from here on - r2 = (last(r1) + 1):length(x1.args) + r2 = (last(r1)+1):length(x1.args) r3 = 0:-1 # though we now check whether there is a sequence at the end of x0.args and # x1.args that match offset = sizeof(s1) - for i = 0:min(length(x0.args) - last(r1), length(x0.args), length(x1.args)) - 1 - if !quick_comp(x0.args[end - i], x1.args[end - i]) || - offset <= i1 || - length(x0.args) - i == last(r1) + 1 || - offset - x1.args[end-i].fullspan <= i2 <= offset - - r2 = first(r2):length(x1.args) - i - r3 = length(x0.args) .+ ((-i + 1):0) + for i = 0:min(length(x0.args) - last(r1), length(x0.args), length(x1.args))-1 + if !quick_comp(x0.args[end-i], x1.args[end-i]) || + offset <= i1 || + length(x0.args) - i == last(r1) + 1 || + offset - x1.args[end-i].fullspan <= i2 <= offset + + r2 = first(r2):length(x1.args)-i + r3 = length(x0.args) .+ ((-i+1):0) break end - offset -= x1.args[end - i].fullspan + offset -= x1.args[end-i].fullspan end inds && return r1, r2, r3 x2 = CSTParser.EXPR(x0.head, CSTParser.EXPR[ - x0.args[r1] - x1.args[r2] - x0.args[r3] - ], nothing) + x0.args[r1] + x1.args[r2] + x0.args[r3] + ], nothing) return x2 end @@ -397,7 +397,7 @@ check_span(x, neq = []) Recursively checks whether the span of an expression equals the sum of the span of its components. Returns a vector of failing expressions. """ -function check_span(x::EXPR, neq = []) +function check_span(x::EXPR, neq=[]) (ispunctuation(x) || isidentifier(x) || iskeyword(x) || isoperator(x) || isliteral(x) || headof(x) == :string) && return neq s = 0 @@ -425,8 +425,8 @@ end function speed_test() dir = dirname(Base.find_source_file("essentials.jl")) println("speed test : ", @timed(for i = 1:5 - parse(read(joinpath(dir, "essentials.jl"), String), true); - parse(read(joinpath(dir, "abstractarray.jl"), String), true); + parse(read(joinpath(dir, "essentials.jl"), String), true) + parse(read(joinpath(dir, "abstractarray.jl"), String), true) end)[2]) end @@ -481,7 +481,7 @@ function _unescape_string(io, s::AbstractString) k = 1 n = c - '0' while (k += 1) <= 3 && !isempty(a) - c = Base.peek(a) + c = Base.peek(a) n = ('0' <= c <= '7') ? n << 3 + c - '0' : break popfirst!(a) end diff --git a/packages/CSTParser/test/check_base.jl b/packages/CSTParser/test/check_base.jl index 96cdd3d..eaca6fa 100644 --- a/packages/CSTParser/test/check_base.jl +++ b/packages/CSTParser/test/check_base.jl @@ -14,7 +14,7 @@ function norm_ast(a::Any) elseif fa === Symbol("@uint128_str") && long_enough return Base.parse(UInt128, a.args[3]) elseif fa === Symbol("@bigint_str") && long_enough - return Base.parse(BigInt, a.args[3]) + return Base.parse(BigInt, a.args[3]) elseif fa == Symbol("@big_str") && long_enough s = a.args[3] n = tryparse(BigInt, s) @@ -66,7 +66,7 @@ function meta_parse_file(str) return x1, true end - if length(x1.args) > 0 && x1.args[end] === nothing + if length(x1.args) > 0 && x1.args[end] === nothing pop!(x1.args) end x1 = norm_ast(x1) @@ -74,14 +74,15 @@ function meta_parse_file(str) return x1, meta_parse_has_error(x1) end -find_error(x, offset = 0) = if CSTParser.headof(x) === :errortoken - @show offset - else - for a in x - find_error(a, offset) - offset += a.fullspan +find_error(x, offset=0) = + if CSTParser.headof(x) === :errortoken + @show offset + else + for a in x + find_error(a, offset) + offset += a.fullspan + end end -end function cst_parse_file(str) x, ps = CSTParser.parse(CSTParser.ParseState(str), true) @@ -106,14 +107,14 @@ function _compare(x::Expr, y::Expr) return true else if x.head != y.head || length(x.args) != length(y.args) - printstyled(x, bold = true, color = :light_red) + printstyled(x, bold=true, color=:light_red) println() printstyled(y, bold=true, color=:light_green) println() end for i = 1:min(length(x.args), length(y.args)) if !_compare(x.args[i], y.args[i]) - printstyled(x.args[i], bold = true, color = :light_red) + printstyled(x.args[i], bold=true, color=:light_red) println() printstyled(y.args[i], bold=true, color=:light_green) println() @@ -141,15 +142,15 @@ end if cst_err || meta_err if cst_err && !meta_err - @error "CSTParser.parse errored, but Meta.parse didn't." file=file + @error "CSTParser.parse errored, but Meta.parse didn't." file = file elseif !cst_err && meta_err - @error "Meta.parse errored, but CSTParser.parse didn't." file=file + @error "Meta.parse errored, but CSTParser.parse didn't." file = file end else if cst_expr == meta_expr @test true else - @error "parsing difference" file=file + @error "parsing difference" file = file _compare(cst_expr, meta_expr) @test false end diff --git a/packages/CSTParser/test/display.jl b/packages/CSTParser/test/display.jl index fcaec9e..996cef8 100644 --- a/packages/CSTParser/test/display.jl +++ b/packages/CSTParser/test/display.jl @@ -1,5 +1,5 @@ @testset "show" begin x = CSTParser.parse("a + (b*c) - d") @test sprint(show, x) === - " 1:13 call\n 1:2 OP: -\n 3:12 call\n 3:4 OP: +\n 5:6 a\n 7:12 brackets\n 7:9 call\n 7:7 OP: *\n 8:8 b\n 9:9 c\n 13:13 d" + " 1:13 call\n 1:2 OP: -\n 3:12 call\n 3:4 OP: +\n 5:6 a\n 7:12 brackets\n 7:9 call\n 7:7 OP: *\n 8:8 b\n 9:9 c\n 13:13 d" end diff --git a/packages/CSTParser/test/errparse.jl b/packages/CSTParser/test/errparse.jl index ac3fec5..5ba2875 100644 --- a/packages/CSTParser/test/errparse.jl +++ b/packages/CSTParser/test/errparse.jl @@ -2,14 +2,14 @@ # and that iteration functions are still correctly ordered. @testset "invalid jl file parsing" begin - function trav(x, f = x->nothing) + function trav(x, f=x -> nothing) f(x) for a in x trav(a, f) end end - function trav1(x, f = x->nothing) + function trav1(x, f=x -> nothing) f(x) if x.args !== nothing for a in x @@ -18,7 +18,7 @@ end end - function check_err_parse(s, n = length(s)÷100) + function check_err_parse(s, n=length(s) ÷ 100) check_str(s) # parsing works? check_itr_order(s) # iteration produces same text? @@ -72,7 +72,7 @@ segs end - function check_itr_order(s, x = CSTParser.parse(s, true)) + function check_itr_order(s, x=CSTParser.parse(s, true)) length(x) == 0 && return segs = get_segs(x) s0 = join(String(codeunits(s)[seg]) for seg in segs) @@ -103,7 +103,7 @@ all(comp(x[i], y[i]) for i = 1:length(x)) end - function check_reparse(s0, n = length(s0)÷100) + function check_reparse(s0, n=length(s0) ÷ 100) for _ in 1:n x0 = CSTParser.parse(s0, true) CSTParser.has_error(x0) && return @@ -150,7 +150,7 @@ (!isfile(f) || !endswith(f, ".jl")) && continue @info "checking $(nameof(check)) against $f" s = String(read(f)) - if isvalid(s) && length(s) >0 + if isvalid(s) && length(s) > 0 check(s) end end diff --git a/packages/CSTParser/test/iterate.jl b/packages/CSTParser/test/iterate.jl index c894c2f..2d219c7 100644 --- a/packages/CSTParser/test/iterate.jl +++ b/packages/CSTParser/test/iterate.jl @@ -3,7 +3,7 @@ using CSTParser: @cst_str, headof, valof function test_iter_spans(x) n = 0 for i = 1:length(x) - a = x[i] + a = x[i] if !(a isa EXPR) @info i, headof(x), to_codeobject(x) end diff --git a/packages/CSTParser/test/parser.jl b/packages/CSTParser/test/parser.jl index a398895..8f4e810 100644 --- a/packages/CSTParser/test/parser.jl +++ b/packages/CSTParser/test/parser.jl @@ -1,18 +1,18 @@ using Test randop() = rand(["-->", "→", - "||", - "&&", - "<", "==", "<:", ">:", - "<|", "|>", - ":", - "+", "-", - ">>", "<<", - "*", "/", - "//", - "^", "↑", - "::", - ".", "->"]) + "||", + "&&", + "<", "==", "<:", ">:", + "<|", "|>", + ":", + "+", "-", + ">>", "<<", + "*", "/", + "//", + "^", "↑", + "::", + ".", "->"]) test_expr_broken(str) = test_expr(str, false) @@ -57,14 +57,14 @@ end @testset "All tests" begin @test Meta.parse("(1,)") == Expr(:tuple, 1) @testset "Operators" begin - # @testset "Binary Operators" begin - # for iter = 1:25 - # println(iter) - # str = join([["x$(randop())" for i = 1:19];"x"]) - - # @test test_expr(str) - # end - # end + # @testset "Binary Operators" begin + # for iter = 1:25 + # println(iter) + # str = join([["x$(randop())" for i = 1:19];"x"]) + + # @test test_expr(str) + # end + # end @testset "Conditional Operator" begin @test test_expr("a ? b : c") @test test_expr("a ? b : c : d") @@ -74,12 +74,12 @@ end @testset "Dot Operator" begin - @test "a.b" |> test_expr - @test "a.b.c" |> test_expr - @test "(a(b)).c" |> test_expr - @test "(a).(b).(c)" |> test_expr - @test "(a).b.(c)" |> test_expr - @test "(a).b.(c+d)" |> test_expr + @test "a.b" |> test_expr + @test "a.b.c" |> test_expr + @test "(a(b)).c" |> test_expr + @test "(a).(b).(c)" |> test_expr + @test "(a).b.(c)" |> test_expr + @test "(a).b.(c+d)" |> test_expr end @testset "Unary Operator" begin @@ -88,7 +88,7 @@ end @test "!" |> test_expr @test "~" |> test_expr @test "&" |> test_expr - # @test "::" |> test_expr + # @test "::" |> test_expr @test "<:" |> test_expr @test ">:" |> test_expr @test "¬" |> test_expr @@ -628,9 +628,9 @@ end @testset "Try" begin - # @test "try f(1) end" |> test_expr - # @test "try; f(1) end" |> test_expr - # @test "try; f(1); end" |> test_expr + # @test "try f(1) end" |> test_expr + # @test "try; f(1) end" |> test_expr + # @test "try; f(1); end" |> test_expr @test "try; f(1); catch e; e; end" |> test_expr @test "try; f(1); catch e; e end" |> test_expr @test "try; f(1); catch e e; end" |> test_expr @@ -1007,8 +1007,8 @@ end @test "1 .< 2 .< 3" |> test_expr @test "(;)" |> test_expr if VERSION > v"1.5" - @test "@M{a}-b" |> test_expr - @test "@M{a,b}-b" |> test_expr + @test "@M{a}-b" |> test_expr + @test "@M{a,b}-b" |> test_expr end @test "@M[a]-b" |> test_expr end @@ -1068,29 +1068,29 @@ end @test_broken "\$(a) * -\$(b)" |> test_expr_broken end -# test_fsig_decl(str) = (x->x.id).(CSTParser._get_fsig(CSTParser.parse(str)).defs) -# @testset "func-sig variable declarations" begin -# @test test_fsig_decl("f(x) = x") == [:x] -# @test test_fsig_decl("""function f(x) -# x -# end""") == [:x] - -# @test test_fsig_decl("f{T}(x::T) = x") == [:T, :x] -# @test test_fsig_decl("""function f{T}(x::T) -# x -# end""") == [:T, :x] - -# @test test_fsig_decl("f(x::T) where T = x") == [:T, :x] -# @test test_fsig_decl("""function f(x::T) where T -# x -# end""") == [:T, :x] - - -# @test test_fsig_decl("f(x::T{S}) where T where S = x") == [:T, :S, :x] -# @test test_fsig_decl("""function f(x::T{S}) where T where S -# x -# end""") == [:T, :S, :x] -# end + # test_fsig_decl(str) = (x->x.id).(CSTParser._get_fsig(CSTParser.parse(str)).defs) + # @testset "func-sig variable declarations" begin + # @test test_fsig_decl("f(x) = x") == [:x] + # @test test_fsig_decl("""function f(x) + # x + # end""") == [:x] + + # @test test_fsig_decl("f{T}(x::T) = x") == [:T, :x] + # @test test_fsig_decl("""function f{T}(x::T) + # x + # end""") == [:T, :x] + + # @test test_fsig_decl("f(x::T) where T = x") == [:T, :x] + # @test test_fsig_decl("""function f(x::T) where T + # x + # end""") == [:T, :x] + + + # @test test_fsig_decl("f(x::T{S}) where T where S = x") == [:T, :S, :x] + # @test test_fsig_decl("""function f(x::T{S}) where T where S + # x + # end""") == [:T, :S, :x] + # end @testset "Spans" begin CSTParser.parse(raw""" diff --git a/packages/CSTParser/test/spec.jl b/packages/CSTParser/test/spec.jl index 59d2d3d..c3e7d7e 100644 --- a/packages/CSTParser/test/spec.jl +++ b/packages/CSTParser/test/spec.jl @@ -27,7 +27,7 @@ function test_iter(ex) end end -function test_expr(s, head, n, endswithtrivia = false) +function test_expr(s, head, n, endswithtrivia=false) x = CSTParser.parse(s) head === nothing || @test headof(x) === head @test length(x) === n @@ -37,7 +37,7 @@ function test_expr(s, head, n, endswithtrivia = false) @test isempty(check_span(x)) check_parents(x) test_iter(x) - @test endswithtrivia ? (x.fullspan-x.span) == (last(x.trivia).fullspan - last(x.trivia).span) : (x.fullspan-x.span) == (last(x.args).fullspan - last(x.args).span) + @test endswithtrivia ? (x.fullspan - x.span) == (last(x.trivia).fullspan - last(x.trivia).span) : (x.fullspan - x.span) == (last(x.args).fullspan - last(x.args).span) end @@ -146,7 +146,9 @@ end test_expr("a where {b }", :where, 5, true) test_expr("a where {b,c } ", :where, 7, true) test_expr("a...", nothing, 2, false) - @test let x = cst"a... "; x.fullspan - x.span == 1 end + @test let x = cst"a... " + x.fullspan - x.span == 1 + end test_expr("a <: b", nothing, 3, false) # https://github.com/julia-vscode/CSTParser.jl/issues/278 diff --git a/packages/TestItemDetection/src/packagedef.jl b/packages/TestItemDetection/src/packagedef.jl index a5ef42f..f75a8a8 100644 --- a/packages/TestItemDetection/src/packagedef.jl +++ b/packages/TestItemDetection/src/packagedef.jl @@ -3,24 +3,24 @@ include("vendored_code.jl") function find_test_items_detail!(node, testitems, errors) node isa EXPR || return - if node.head == :macrocall && length(node.args)>0 && CSTParser.valof(node.args[1]) == "@testitem" + if node.head == :macrocall && length(node.args) > 0 && CSTParser.valof(node.args[1]) == "@testitem" pos = 1 + get_file_loc(node)[2] range = pos:pos+node.span-1 # filter out line nodes - child_nodes = filter(i->!(isa(i, EXPR) && i.head==:NOTHING && i.args===nothing), node.args) + child_nodes = filter(i -> !(isa(i, EXPR) && i.head == :NOTHING && i.args === nothing), node.args) # Check for various syntax errors - if length(child_nodes)==1 + if length(child_nodes) == 1 push!(errors, (error="Your @testitem is missing a name and code block.", range=range)) return - elseif length(child_nodes)>1 && !(child_nodes[2] isa EXPR && child_nodes[2].head==:STRING) + elseif length(child_nodes) > 1 && !(child_nodes[2] isa EXPR && child_nodes[2].head == :STRING) push!(errors, (error="Your @testitem must have a first argument that is of type String for the name.", range=range)) return - elseif length(child_nodes)==2 + elseif length(child_nodes) == 2 push!(errors, (error="Your @testitem is missing a code block argument.", range=range)) return - elseif !(child_nodes[end] isa EXPR && child_nodes[end].head==:block) + elseif !(child_nodes[end] isa EXPR && child_nodes[end].head == :block) push!(errors, (error="The final argument of a @testitem must be a begin end block.", range=range)) return else @@ -29,13 +29,13 @@ function find_test_items_detail!(node, testitems, errors) # Now check our keyword args for i in child_nodes[3:end-1] - if !(i isa EXPR && i.head isa EXPR && i.head.head==:OPERATOR && CSTParser.valof(i.head)=="=") + if !(i isa EXPR && i.head isa EXPR && i.head.head == :OPERATOR && CSTParser.valof(i.head) == "=") push!(errors, (error="The arguments to a @testitem must be in keyword format.", range=range)) return - elseif !(length(i.args)==2) + elseif !(length(i.args) == 2) error("This code path should not be possible.") - elseif CSTParser.valof(i.args[1])=="tags" - if option_tags!==nothing + elseif CSTParser.valof(i.args[1]) == "tags" + if option_tags !== nothing push!(errors, (error="The keyword argument tags cannot be specified more than once.", range=range)) return end @@ -48,15 +48,15 @@ function find_test_items_detail!(node, testitems, errors) option_tags = Symbol[] for j in i.args[2].args - if !(j isa EXPR && j.head==:quotenode && length(j.args)==1 && j.args[1] isa EXPR && j.args[1].head==:IDENTIFIER) + if !(j isa EXPR && j.head == :quotenode && length(j.args) == 1 && j.args[1] isa EXPR && j.args[1].head == :IDENTIFIER) push!(errors, (error="The keyword argument tags only accepts a vector of symbols.", range=range)) return end push!(option_tags, Symbol(CSTParser.valof(j.args[1]))) end - elseif CSTParser.valof(i.args[1])=="default_imports" - if option_default_imports!==nothing + elseif CSTParser.valof(i.args[1]) == "default_imports" + if option_default_imports !== nothing push!(errors, (error="The keyword argument default_imports cannot be specified more than once.", range=range)) return end @@ -73,11 +73,11 @@ function find_test_items_detail!(node, testitems, errors) end end - if option_tags===nothing + if option_tags === nothing option_tags = Symbol[] end - if option_default_imports===nothing + if option_default_imports === nothing option_default_imports = true end @@ -85,11 +85,11 @@ function find_test_items_detail!(node, testitems, errors) # not sure whether that is always assigned to the begin end block EXPR code_pos = get_file_loc(child_nodes[end])[2] + 1 + length("begin") - code_range = code_pos:code_pos+child_nodes[end].span - 1 - length("begin") - length("end") + code_range = code_pos:code_pos+child_nodes[end].span-1-length("begin")-length("end") push!(testitems, (name=CSTParser.valof(node.args[3]), range=range, code_range=code_range, option_default_imports=option_default_imports, option_tags=option_tags)) end - elseif node.head == :module && length(node.args)>=3 && node.args[3] isa EXPR && node.args[3].head==:block + elseif node.head == :module && length(node.args) >= 3 && node.args[3] isa EXPR && node.args[3].head == :block for i in node.args[3].args find_test_items_detail!(i, testitems, errors) end diff --git a/packages/Tokenize/benchmark/lex_base.jl b/packages/Tokenize/benchmark/lex_base.jl index cf58cb9..b09b4ad 100644 --- a/packages/Tokenize/benchmark/lex_base.jl +++ b/packages/Tokenize/benchmark/lex_base.jl @@ -2,7 +2,7 @@ using Tokenize using BenchmarkTools using Printf -function speed_test(::Type{T}=Tokenize.Tokens.Token) where T <: Tokenize.Tokens.AbstractToken +function speed_test(::Type{T}=Tokenize.Tokens.Token) where T<:Tokenize.Tokens.AbstractToken tot_files = 0 tot_tokens = 0 tot_errors = 0 @@ -33,6 +33,6 @@ tot_files, tot_tokens, tot_errors = speed_test() tot_time_token = @belapsed speed_test() tot_time_rawtoken = @belapsed speed_test(Tokenize.Tokens.RawToken) println("Lexed ", tot_files, " files, with a total of ", tot_tokens, - " tokens with ", tot_errors, " errors") + " tokens with ", tot_errors, " errors") println("Time Token: ", @sprintf("%3.4f", tot_time_token), " seconds") println("Time RawToken: ", @sprintf("%3.4f", tot_time_rawtoken), " seconds") diff --git a/packages/Tokenize/src/_precompile.jl b/packages/Tokenize/src/_precompile.jl index 880ee40..c1ddd97 100644 --- a/packages/Tokenize/src/_precompile.jl +++ b/packages/Tokenize/src/_precompile.jl @@ -5,91 +5,91 @@ function _precompile_() precompile(Tokenize.Tokens.iskeyword, (Tokenize.Tokens.Kind,)) precompile(Tokenize.Tokens.isliteral, (Tokenize.Tokens.Kind,)) precompile(Tokenize.Tokens.isoperator, (Tokenize.Tokens.Kind,)) - precompile(Tokenize.Tokens.Token, (Tokenize.Tokens.Kind,Tuple{Int,Int},Tuple{Int,Int},Int,Int,String)) + precompile(Tokenize.Tokens.Token, (Tokenize.Tokens.Kind, Tuple{Int,Int}, Tuple{Int,Int}, Int, Int, String)) precompile(Tokenize.Tokens.Token, ()) precompile(Tokenize.Tokens.kind, (Tokenize.Tokens.Token,)) precompile(Tokenize.Tokens.startpos, (Tokenize.Tokens.Token,)) precompile(Tokenize.Tokens.endpos, (Tokenize.Tokens.Token,)) precompile(Tokenize.Tokens.untokenize, (Tokenize.Tokens.Token,)) - precompile(Tokenize.Tokens.untokenize, (Tokenize.Tokens.RawToken,String)) - precompile(Tokenize.Tokens.untokenize, (Array{Tokenize.Tokens.Token, 1},)) - precompile(Tokenize.Tokens.untokenize, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Tokens.untokenize, (Tokenize.Tokens.RawToken, String)) + precompile(Tokenize.Tokens.untokenize, (Array{Tokenize.Tokens.Token,1},)) + precompile(Tokenize.Tokens.untokenize, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) precompile(Tokenize.Lexers.is_identifier_char, (Char,)) precompile(Tokenize.Lexers.is_identifier_start_char, (Char,)) - precompile(Tokenize.Lexers.peekchar, (GenericIOBuffer{Array{UInt8, 1}},)) - precompile(Tokenize.Lexers.dpeekchar, (GenericIOBuffer{Array{UInt8, 1}},)) - precompile(Tokenize.Lexers.readchar, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.readchar, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.RawToken},)) - precompile(Tokenize.Lexers.next_token, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.peekchar, (GenericIOBuffer{Array{UInt8,1}},)) + precompile(Tokenize.Lexers.dpeekchar, (GenericIOBuffer{Array{UInt8,1}},)) + precompile(Tokenize.Lexers.readchar, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.readchar, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.RawToken},)) + precompile(Tokenize.Lexers.next_token, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) precompile(Tokenize.Lexers.ishex, (Char,)) precompile(Tokenize.Lexers.isbinary, (Char,)) precompile(Tokenize.Lexers.isoctal, (Char,)) precompile(Tokenize.Lexers.iswhitespace, (Char,)) precompile(Tokenize.Lexers.Lexer, (String,)) - precompile(Tokenize.Lexers.Lexer, (String,Type{Tokenize.Tokens.Token})) - precompile(Tokenize.Lexers.Lexer, (String,Type{Tokenize.Tokens.RawToken})) - precompile(Tokenize.Lexers.Lexer, (GenericIOBuffer{Array{UInt8, 1}},Type{Tokenize.Tokens.Token})) - precompile(Tokenize.Lexers.Lexer, (GenericIOBuffer{Array{UInt8, 1}},Type{Tokenize.Tokens.RawToken})) + precompile(Tokenize.Lexers.Lexer, (String, Type{Tokenize.Tokens.Token})) + precompile(Tokenize.Lexers.Lexer, (String, Type{Tokenize.Tokens.RawToken})) + precompile(Tokenize.Lexers.Lexer, (GenericIOBuffer{Array{UInt8,1}}, Type{Tokenize.Tokens.Token})) + precompile(Tokenize.Lexers.Lexer, (GenericIOBuffer{Array{UInt8,1}}, Type{Tokenize.Tokens.RawToken})) precompile(Tokenize.Lexers.tokenize, (String,)) - precompile(Tokenize.Lexers.iterate, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.iterate, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.RawToken},)) - precompile(Tokenize.Lexers.iterate, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token}, Bool,)) - precompile(Tokenize.Lexers.iterate, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.RawToken}, Bool,)) - precompile(Tokenize.Lexers.iterate, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token}, Bool,)) - precompile(Tokenize.Lexers.iterate, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.RawToken}, Bool,)) - precompile(Tokenize.Lexers.startpos, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.startpos, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.RawToken},)) - precompile(Tokenize.Lexers.startpos!, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},Int)) - precompile(Tokenize.Lexers.startpos!, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.RawToken},Int)) - precompile(Tokenize.Lexers.start_token!, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.start_token!, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.RawToken},)) + precompile(Tokenize.Lexers.iterate, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.iterate, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.RawToken},)) + precompile(Tokenize.Lexers.iterate, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token}, Bool,)) + precompile(Tokenize.Lexers.iterate, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.RawToken}, Bool,)) + precompile(Tokenize.Lexers.iterate, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token}, Bool,)) + precompile(Tokenize.Lexers.iterate, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.RawToken}, Bool,)) + precompile(Tokenize.Lexers.startpos, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.startpos, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.RawToken},)) + precompile(Tokenize.Lexers.startpos!, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token}, Int)) + precompile(Tokenize.Lexers.startpos!, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.RawToken}, Int)) + precompile(Tokenize.Lexers.start_token!, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.start_token!, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.RawToken},)) - precompile(Tokenize.Lexers.lex_greater, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_prime, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_digit, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},Tokenize.Tokens.Kind)) - precompile(Tokenize.Lexers.lex_identifier, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token}, Char,)) - precompile(Tokenize.Lexers.lex_less, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_forwardslash, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_minus, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_xor, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_equal, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_bar, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_quote, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_plus, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_dot, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_exclaim, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_colon, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_percent, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_comment, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_comment, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},Bool)) - precompile(Tokenize.Lexers.lex_cmd, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_division, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_circumflex, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_backslash, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_star, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_amper, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_greater, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_prime, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_digit, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token}, Tokenize.Tokens.Kind)) + precompile(Tokenize.Lexers.lex_identifier, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token}, Char,)) + precompile(Tokenize.Lexers.lex_less, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_forwardslash, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_minus, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_xor, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_equal, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_bar, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_quote, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_plus, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_dot, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_exclaim, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_colon, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_percent, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_comment, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_comment, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token}, Bool)) + precompile(Tokenize.Lexers.lex_cmd, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_division, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_circumflex, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_backslash, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_star, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.lex_amper, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.lex_whitespace, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},)) - precompile(Tokenize.Lexers.read_string, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token}, Tokenize.Tokens.Kind,)) + precompile(Tokenize.Lexers.lex_whitespace, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token},)) + precompile(Tokenize.Lexers.read_string, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token}, Tokenize.Tokens.Kind,)) - precompile(Tokenize.Lexers.accept, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token}, Char,)) - precompile(Tokenize.Lexers.accept, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token}, String,)) - precompile(Tokenize.Lexers.accept, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},typeof( Base.isdigit),)) - precompile(Tokenize.Lexers.accept, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},typeof( Tokenize.Lexers.iswhitespace),)) - precompile(Tokenize.Lexers.accept, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},typeof( Tokenize.Lexers.is_identifier_char),)) - precompile(Tokenize.Lexers.accept, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token},typeof(Tokenize.Lexers.ishex),)) - precompile(Tokenize.Lexers.accept_batch, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token}, typeof(Tokenize.Lexers.iswhitespace),)) - precompile(Tokenize.Lexers.accept_batch, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.Token}, typeof(Tokenize.Lexers.isdigit),)) + precompile(Tokenize.Lexers.accept, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token}, Char,)) + precompile(Tokenize.Lexers.accept, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token}, String,)) + precompile(Tokenize.Lexers.accept, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token}, typeof(Base.isdigit),)) + precompile(Tokenize.Lexers.accept, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token}, typeof(Tokenize.Lexers.iswhitespace),)) + precompile(Tokenize.Lexers.accept, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token}, typeof(Tokenize.Lexers.is_identifier_char),)) + precompile(Tokenize.Lexers.accept, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token}, typeof(Tokenize.Lexers.ishex),)) + precompile(Tokenize.Lexers.accept_batch, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token}, typeof(Tokenize.Lexers.iswhitespace),)) + precompile(Tokenize.Lexers.accept_batch, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token}, typeof(Tokenize.Lexers.isdigit),)) - precompile(Tokenize.Lexers.accept_batch, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.RawToken}, typeof(Tokenize.Lexers.iswhitespace),)) - precompile(Tokenize.Lexers.accept_batch, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.RawToken}, typeof(Tokenize.Lexers.isdigit),)) - precompile(Tokenize.Lexers.accept, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8, 1}},Tokenize.Tokens.RawToken}, Char,)) + precompile(Tokenize.Lexers.accept_batch, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.RawToken}, typeof(Tokenize.Lexers.iswhitespace),)) + precompile(Tokenize.Lexers.accept_batch, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.RawToken}, typeof(Tokenize.Lexers.isdigit),)) + precompile(Tokenize.Lexers.accept, (Tokenize.Lexers.Lexer{GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.RawToken}, Char,)) - precompile(Tokenize.Lexers.readchar, (GenericIOBuffer{Array{UInt8, 1}},)) + precompile(Tokenize.Lexers.readchar, (GenericIOBuffer{Array{UInt8,1}},)) end diff --git a/packages/Tokenize/src/lexer.jl b/packages/Tokenize/src/lexer.jl index b8303cf..0e15f17 100644 --- a/packages/Tokenize/src/lexer.jl +++ b/packages/Tokenize/src/lexer.jl @@ -12,19 +12,19 @@ import ..Tokens import ..Tokens: AbstractToken, Token, RawToken, Kind, TokenError, UNICODE_OPS, EMPTY_TOKEN, isliteral import ..Tokens: FUNCTION, ABSTRACT, IDENTIFIER, BAREMODULE, BEGIN, BREAK, CATCH, CONST, CONTINUE, - DO, ELSE, ELSEIF, END, EXPORT, FALSE, FINALLY, FOR, FUNCTION, GLOBAL, LET, LOCAL, IF, - IMPORT, IMPORTALL, MACRO, MODULE, OUTER, QUOTE, RETURN, TRUE, TRY, TYPE, USING, WHILE, ISA, IN, - MUTABLE, PRIMITIVE, STRUCT, WHERE + DO, ELSE, ELSEIF, END, EXPORT, FALSE, FINALLY, FOR, FUNCTION, GLOBAL, LET, LOCAL, IF, + IMPORT, IMPORTALL, MACRO, MODULE, OUTER, QUOTE, RETURN, TRUE, TRY, TYPE, USING, WHILE, ISA, IN, + MUTABLE, PRIMITIVE, STRUCT, WHERE export tokenize @inline ishex(c::Char) = isdigit(c) || ('a' <= c <= 'f') || ('A' <= c <= 'F') @inline isbinary(c::Char) = c == '0' || c == '1' -@inline isoctal(c::Char) = '0' ≤ c ≤ '7' +@inline isoctal(c::Char) = '0' ≤ c ≤ '7' @inline iswhitespace(c::Char) = Base.isspace(c) || c === '\ufeff' -mutable struct Lexer{IO_t <: IO, T <: AbstractToken} +mutable struct Lexer{IO_t<:IO,T<:AbstractToken} io::IO_t io_startpos::Int @@ -44,7 +44,7 @@ mutable struct Lexer{IO_t <: IO, T <: AbstractToken} dotop::Bool end -function Lexer(io::IO_t, T::Type{TT} = Token) where {IO_t,TT <: AbstractToken} +function Lexer(io::IO_t, T::Type{TT}=Token) where {IO_t,TT<:AbstractToken} c1 = ' ' p1 = position(io) if eof(io) @@ -61,11 +61,11 @@ function Lexer(io::IO_t, T::Type{TT} = Token) where {IO_t,TT <: AbstractToken} end end - Lexer{IO_t,T}(io, position(io), 1, 1, position(io), 1, 1, position(io), Tokens.ERROR, IOBuffer(), (c1,c2,c3), (p1,p2,p3), false, false) + Lexer{IO_t,T}(io, position(io), 1, 1, position(io), 1, 1, position(io), Tokens.ERROR, IOBuffer(), (c1, c2, c3), (p1, p2, p3), false, false) end -Lexer(str::AbstractString, T::Type{TT} = Token) where TT <: AbstractToken = Lexer(IOBuffer(str), T) +Lexer(str::AbstractString, T::Type{TT}=Token) where TT<:AbstractToken = Lexer(IOBuffer(str), T) -@inline token_type(l::Lexer{IO_t, TT}) where {IO_t, TT} = TT +@inline token_type(l::Lexer{IO_t,TT}) where {IO_t,TT} = TT """ tokenize(x, T = Token) @@ -179,7 +179,7 @@ Returns the next character and increments the current position. """ function readchar end -function readchar(l::Lexer{I}) where {I <: IO} +function readchar(l::Lexer{I}) where {I<:IO} c = readchar(l.io) l.chars = (l.chars[2], l.chars[3], c) l.charspos = (l.charspos[2], l.charspos[3], position(l.io)) @@ -195,8 +195,8 @@ function readchar(l::Lexer{I}) where {I <: IO} return l.chars[1] end -readon(l::Lexer{I,RawToken}) where {I <: IO} = l.chars[1] -function readon(l::Lexer{I,Token}) where {I <: IO} +readon(l::Lexer{I,RawToken}) where {I<:IO} = l.chars[1] +function readon(l::Lexer{I,Token}) where {I<:IO} if l.charstore.size != 0 take!(l.charstore) end @@ -204,8 +204,8 @@ function readon(l::Lexer{I,Token}) where {I <: IO} l.doread = true end -readoff(l::Lexer{I,RawToken}) where {I <: IO} = l.chars[1] -function readoff(l::Lexer{I,Token}) where {I <: IO} +readoff(l::Lexer{I,RawToken}) where {I<:IO} = l.chars[1] +function readoff(l::Lexer{I,Token}) where {I<:IO} l.doread = false return l.chars[1] end @@ -217,7 +217,7 @@ Consumes the next character `c` if either `f::Function(c)` returns true, `c == f for `c::Char` or `c in f` otherwise. Returns `true` if a character has been consumed and `false` otherwise. """ -@inline function accept(l::Lexer, f::Union{Function, Char, Vector{Char}, String}) +@inline function accept(l::Lexer, f::Union{Function,Char,Vector{Char},String}) c = peekchar(l) if isa(f, Function) ok = f(c) @@ -248,10 +248,10 @@ end Returns a `Token` of kind `kind` with contents `str` and starts a new `Token`. """ -function emit(l::Lexer{IO_t,Token}, kind::Kind, err::TokenError = Tokens.NO_ERR) where IO_t +function emit(l::Lexer{IO_t,Token}, kind::Kind, err::TokenError=Tokens.NO_ERR) where IO_t suffix = false if kind in (Tokens.ERROR, Tokens.STRING, Tokens.TRIPLE_STRING, Tokens.CMD, Tokens.TRIPLE_CMD) - str = String(l.io.data[(l.token_startpos + 1):position(l)]) + str = String(l.io.data[(l.token_startpos+1):position(l)]) elseif (kind == Tokens.IDENTIFIER || isliteral(kind) || kind == Tokens.COMMENT || kind == Tokens.WHITESPACE) str = String(take!(l.charstore)) elseif optakessuffix(kind) @@ -264,16 +264,16 @@ function emit(l::Lexer{IO_t,Token}, kind::Kind, err::TokenError = Tokens.NO_ERR) str = "" end tok = Token(kind, (l.token_start_row, l.token_start_col), - (l.current_row, l.current_col - 1), - startpos(l), position(l) - 1, - str, err, l.dotop, suffix) + (l.current_row, l.current_col - 1), + startpos(l), position(l) - 1, + str, err, l.dotop, suffix) l.dotop = false l.last_token = kind readoff(l) return tok end -function emit(l::Lexer{IO_t,RawToken}, kind::Kind, err::TokenError = Tokens.NO_ERR) where IO_t +function emit(l::Lexer{IO_t,RawToken}, kind::Kind, err::TokenError=Tokens.NO_ERR) where IO_t suffix = false if optakessuffix(kind) while isopsuffix(peekchar(l)) @@ -283,8 +283,8 @@ function emit(l::Lexer{IO_t,RawToken}, kind::Kind, err::TokenError = Tokens.NO_E end tok = RawToken(kind, (l.token_start_row, l.token_start_col), - (l.current_row, l.current_col - 1), - startpos(l), position(l) - 1, err, l.dotop, suffix) + (l.current_row, l.current_col - 1), + startpos(l), position(l) - 1, err, l.dotop, suffix) l.dotop = false l.last_token = kind @@ -297,7 +297,7 @@ end Returns an `ERROR` token with error `err` and starts a new `Token`. """ -function emit_error(l::Lexer, err::TokenError = Tokens.UNKNOWN) +function emit_error(l::Lexer, err::TokenError=Tokens.UNKNOWN) return emit(l, Tokens.ERROR, err) end @@ -311,7 +311,7 @@ end Returns the next `Token`. """ -function next_token(l::Lexer, start = true) +function next_token(l::Lexer, start=true) start && start_token!(l) c = readchar(l) if eof(c) @@ -335,17 +335,17 @@ function next_token(l::Lexer, start = true) elseif c == ',' return emit(l, Tokens.COMMA) elseif c == '*' - return lex_star(l); + return lex_star(l) elseif c == '^' - return lex_circumflex(l); + return lex_circumflex(l) elseif c == '@' return emit(l, Tokens.AT_SIGN) elseif c == '?' return emit(l, Tokens.CONDITIONAL) elseif c == '$' - return lex_dollar(l); + return lex_dollar(l) elseif c == '⊻' - return lex_xor(l); + return lex_xor(l) elseif c == '~' return emit(l, Tokens.APPROX) elseif c == '#' @@ -369,21 +369,21 @@ function next_token(l::Lexer, start = true) elseif c == '÷' return lex_division(l) elseif c == '"' - return lex_quote(l); + return lex_quote(l) elseif c == '%' - return lex_percent(l); + return lex_percent(l) elseif c == '/' - return lex_forwardslash(l); + return lex_forwardslash(l) elseif c == '\\' - return lex_backslash(l); + return lex_backslash(l) elseif c == '.' - return lex_dot(l); + return lex_dot(l) elseif c == '+' - return lex_plus(l); + return lex_plus(l) elseif c == '-' - return lex_minus(l); + return lex_minus(l) elseif c == '`' - return lex_cmd(l); + return lex_cmd(l) elseif is_identifier_start_char(c) return lex_identifier(l, c) elseif isdigit(c) @@ -474,7 +474,8 @@ function lex_less(l::Lexer) elseif accept(l, '|') # <| return emit(l, Tokens.LPIPE) elseif dpeekchar(l) == ('-', '-') # <-- or <--> - readchar(l); readchar(l) + readchar(l) + readchar(l) if accept(l, '>') return emit(l, Tokens.DOUBLE_ARROW) else @@ -622,7 +623,7 @@ end function lex_digit(l::Lexer, kind) readon(l) accept_number(l, isdigit) - pc,ppc = dpeekchar(l) + pc, ppc = dpeekchar(l) if pc == '.' if kind === Tokens.FLOAT # If we enter the function with kind == FLOAT then a '.' has been parsed. @@ -634,22 +635,22 @@ function lex_digit(l::Lexer, kind) readchar(l) return emit_error(l) elseif (!(isdigit(ppc) || - iswhitespace(ppc) || - is_identifier_start_char(ppc) - || ppc == '(' - || ppc == ')' - || ppc == '[' - || ppc == ']' - || ppc == '{' - || ppc == '}' - || ppc == ',' - || ppc == ';' - || ppc == '@' - || ppc == '`' - || ppc == '"' - || ppc == ':' - || ppc == '?' - || eof(ppc))) + iswhitespace(ppc) || + is_identifier_start_char(ppc) + || ppc == '(' + || ppc == ')' + || ppc == '[' + || ppc == ']' + || ppc == '{' + || ppc == '}' + || ppc == ',' + || ppc == ';' + || ppc == '@' + || ppc == '`' + || ppc == '"' + || ppc == ':' + || ppc == '?' + || eof(ppc))) kind = Tokens.INTEGER return emit(l, kind) @@ -664,7 +665,7 @@ function lex_digit(l::Lexer, kind) readchar(l) accept(l, "+-") if accept_batch(l, isdigit) - pc,ppc = dpeekchar(l) + pc, ppc = dpeekchar(l) if pc === '.' && !dotop2(ppc, ' ') accept(l, '.') return emit_error(l, Tokens.INVALID_NUMERIC_CONSTANT) @@ -682,7 +683,7 @@ function lex_digit(l::Lexer, kind) readchar(l) accept(l, "+-") if accept_batch(l, isdigit) - pc,ppc = dpeekchar(l) + pc, ppc = dpeekchar(l) if pc === '.' && !dotop2(ppc, ' ') accept(l, '.') return emit_error(l, Tokens.INVALID_NUMERIC_CONSTANT) @@ -724,14 +725,14 @@ function lex_digit(l::Lexer, kind) return emit(l, kind) end -function lex_prime(l, doemit = true) +function lex_prime(l, doemit=true) if l.last_token == Tokens.IDENTIFIER || - l.last_token == Tokens.DOT || - l.last_token == Tokens.RPAREN || - l.last_token == Tokens.RSQUARE || - l.last_token == Tokens.RBRACE || - l.last_token == Tokens.PRIME || - l.last_token == Tokens.END || isliteral(l.last_token) + l.last_token == Tokens.DOT || + l.last_token == Tokens.RPAREN || + l.last_token == Tokens.RSQUARE || + l.last_token == Tokens.RBRACE || + l.last_token == Tokens.PRIME || + l.last_token == Tokens.END || isliteral(l.last_token) return emit(l, Tokens.PRIME) else readon(l) @@ -899,39 +900,39 @@ function lex_dot(l::Lexer) if dotop1(pc) l.dotop = true return next_token(l, false) - elseif pc =='+' + elseif pc == '+' l.dotop = true readchar(l) return lex_plus(l) - elseif pc =='-' + elseif pc == '-' l.dotop = true readchar(l) return lex_minus(l) - elseif pc =='*' + elseif pc == '*' l.dotop = true readchar(l) return lex_star(l) - elseif pc =='/' + elseif pc == '/' l.dotop = true readchar(l) return lex_forwardslash(l) - elseif pc =='\\' + elseif pc == '\\' l.dotop = true readchar(l) return lex_backslash(l) - elseif pc =='^' + elseif pc == '^' l.dotop = true readchar(l) return lex_circumflex(l) - elseif pc =='<' + elseif pc == '<' l.dotop = true readchar(l) return lex_less(l) - elseif pc =='>' + elseif pc == '>' l.dotop = true readchar(l) return lex_greater(l) - elseif pc =='&' + elseif pc == '&' l.dotop = true readchar(l) if accept(l, "=") @@ -944,7 +945,7 @@ function lex_dot(l::Lexer) end return emit(l, Tokens.AND) end - elseif pc =='%' + elseif pc == '%' l.dotop = true readchar(l) return lex_percent(l) @@ -1059,44 +1060,44 @@ function simple_hash(str) end kws = [ -Tokens.ABSTRACT, -Tokens.BAREMODULE, -Tokens.BEGIN, -Tokens.BREAK, -Tokens.CATCH, -Tokens.CONST, -Tokens.CONTINUE, -Tokens.DO, -Tokens.ELSE, -Tokens.ELSEIF, -Tokens.END, -Tokens.EXPORT, -Tokens.FINALLY, -Tokens.FOR, -Tokens.FUNCTION, -Tokens.GLOBAL, -Tokens.IF, -Tokens.IMPORT, -Tokens.IMPORTALL, -Tokens.LET, -Tokens.LOCAL, -Tokens.MACRO, -Tokens.MODULE, -Tokens.MUTABLE, -Tokens.OUTER, -Tokens.PRIMITIVE, -Tokens.QUOTE, -Tokens.RETURN, -Tokens.STRUCT, -Tokens.TRY, -Tokens.TYPE, -Tokens.USING, -Tokens.WHILE, -Tokens.IN, -Tokens.ISA, -Tokens.WHERE, -Tokens.TRUE, -Tokens.FALSE, + Tokens.ABSTRACT, + Tokens.BAREMODULE, + Tokens.BEGIN, + Tokens.BREAK, + Tokens.CATCH, + Tokens.CONST, + Tokens.CONTINUE, + Tokens.DO, + Tokens.ELSE, + Tokens.ELSEIF, + Tokens.END, + Tokens.EXPORT, + Tokens.FINALLY, + Tokens.FOR, + Tokens.FUNCTION, + Tokens.GLOBAL, + Tokens.IF, + Tokens.IMPORT, + Tokens.IMPORTALL, + Tokens.LET, + Tokens.LOCAL, + Tokens.MACRO, + Tokens.MODULE, + Tokens.MUTABLE, + Tokens.OUTER, + Tokens.PRIMITIVE, + Tokens.QUOTE, + Tokens.RETURN, + Tokens.STRUCT, + Tokens.TRY, + Tokens.TYPE, + Tokens.USING, + Tokens.WHILE, + Tokens.IN, + Tokens.ISA, + Tokens.WHERE, + Tokens.TRUE, + Tokens.FALSE, ] const kw_hash = Dict(simple_hash(lowercase(string(kw))) => kw for kw in kws) diff --git a/packages/Tokenize/src/token.jl b/packages/Tokenize/src/token.jl index c9f5051..ed169bf 100644 --- a/packages/Tokenize/src/token.jl +++ b/packages/Tokenize/src/token.jl @@ -12,7 +12,7 @@ isliteral(k::Kind) = begin_literal < k < end_literal isoperator(k::Kind) = begin_ops < k < end_ops # Create string => keyword kind -const KEYWORDS = Dict{String, Kind}() +const KEYWORDS = Dict{String,Kind}() function _add_kws() for k in instances(Kind) @@ -36,7 +36,7 @@ _add_kws() ) # Error kind => description -TOKEN_ERROR_DESCRIPTION = Dict{TokenError, String}( +TOKEN_ERROR_DESCRIPTION = Dict{TokenError,String}( EOF_MULTICOMMENT => "unterminated multi-line comment #= ... =#", EOF_STRING => "unterminated string literal", EOF_CHAR => "unterminated character literal", @@ -51,8 +51,8 @@ abstract type AbstractToken end struct Token <: AbstractToken kind::Kind # Offsets into a string or buffer - startpos::Tuple{Int, Int} # row, col where token starts /end, col is a string index - endpos::Tuple{Int, Int} + startpos::Tuple{Int,Int} # row, col where token starts /end, col is a string index + endpos::Tuple{Int,Int} startbyte::Int # The byte where the token start in the buffer endbyte::Int # The byte where the token ended in the buffer val::String # The actual string of the token @@ -60,28 +60,28 @@ struct Token <: AbstractToken dotop::Bool suffix::Bool end -function Token(kind::Kind, startposition::Tuple{Int, Int}, endposition::Tuple{Int, Int}, +function Token(kind::Kind, startposition::Tuple{Int,Int}, endposition::Tuple{Int,Int}, startbyte::Int, endbyte::Int, val::String) -Token(kind, startposition, endposition, startbyte, endbyte, val, NO_ERR, false, false) + Token(kind, startposition, endposition, startbyte, endbyte, val, NO_ERR, false, false) end -Token() = Token(ERROR, (0,0), (0,0), 0, 0, "", UNKNOWN, false, false) +Token() = Token(ERROR, (0, 0), (0, 0), 0, 0, "", UNKNOWN, false, false) struct RawToken <: AbstractToken kind::Kind # Offsets into a string or buffer - startpos::Tuple{Int, Int} # row, col where token starts /end, col is a string index - endpos::Tuple{Int, Int} + startpos::Tuple{Int,Int} # row, col where token starts /end, col is a string index + endpos::Tuple{Int,Int} startbyte::Int # The byte where the token start in the buffer endbyte::Int # The byte where the token ended in the buffer token_error::TokenError dotop::Bool suffix::Bool end -function RawToken(kind::Kind, startposition::Tuple{Int, Int}, endposition::Tuple{Int, Int}, +function RawToken(kind::Kind, startposition::Tuple{Int,Int}, endposition::Tuple{Int,Int}, startbyte::Int, endbyte::Int) -RawToken(kind, startposition, endposition, startbyte, endbyte, NO_ERR, false, false) + RawToken(kind, startposition, endposition, startbyte, endbyte, NO_ERR, false, false) end -RawToken() = RawToken(ERROR, (0,0), (0,0), 0, 0, UNKNOWN, false, false) +RawToken() = RawToken(ERROR, (0, 0), (0, 0), 0, 0, UNKNOWN, false, false) const _EMPTY_TOKEN = Token() @@ -106,11 +106,11 @@ function untokenize(t::Token) return lowercase(string(t.kind)) elseif isoperator(t.kind) if t.dotop - str = string(".", UNICODE_OPS_REVERSE[t.kind]) - else - str = string(UNICODE_OPS_REVERSE[t.kind]) - end - return string(str, t.val) + str = string(".", UNICODE_OPS_REVERSE[t.kind]) + else + str = string(UNICODE_OPS_REVERSE[t.kind]) + end + return string(str, t.val) elseif t.kind == LPAREN return "(" elseif t.kind == LSQUARE diff --git a/packages/Tokenize/src/token_kinds.jl b/packages/Tokenize/src/token_kinds.jl index d8d8e18..91d4cd7 100644 --- a/packages/Tokenize/src/token_kinds.jl +++ b/packages/Tokenize/src/token_kinds.jl @@ -7,1406 +7,1392 @@ AT_SIGN, # @ COMMA, #, SEMICOLON, # ; - begin_keywords, - KEYWORD, # general - ABSTRACT, - BAREMODULE, - BEGIN, - BREAK, - CATCH, - CONST, - CONTINUE, - DO, - ELSE, - ELSEIF, - END, - EXPORT, - FINALLY, - FOR, - FUNCTION, - GLOBAL, - IF, - IMPORT, - IMPORTALL, - LET, - LOCAL, - MACRO, - MODULE, - MUTABLE, - NEW, - OUTER, - PRIMITIVE, - QUOTE, - RETURN, - STRUCT, - TRY, - TYPE, - USING, - WHILE, - end_keywords, - - begin_cstparser, - INVISIBLE_BRACKETS, - NOTHING, - WS, - SEMICOLON_WS, - NEWLINE_WS, - EMPTY_WS, - end_cstparser, - - begin_literal, - LITERAL, # general - INTEGER, # 4 - BIN_INT, # 0b1 - HEX_INT, # 0x0 - OCT_INT, # 0o0 - FLOAT, # 3.5, 3.7e+3 - STRING, # "foo" - TRIPLE_STRING, # """ foo \n """ - CHAR, # 'a' - CMD, # `cmd ...` - TRIPLE_CMD, # ```cmd ...``` - TRUE, FALSE, - end_literal, - - begin_delimiters, - LSQUARE, # [ - RSQUARE, # [ - LBRACE, # { - RBRACE, # } - LPAREN, # ( - RPAREN, # ) - end_delimiters, - - begin_ops, - OP, # general - DDDOT, # ... - - # Level 1 - begin_assignments, - EQ, # = - PLUS_EQ, # += - MINUS_EQ, # -= - STAR_EQ, # *= - FWD_SLASH_EQ, # /= - FWDFWD_SLASH_EQ, # //= - OR_EQ, # |= - CIRCUMFLEX_EQ, # ^= - DIVISION_EQ, # ÷= - REM_EQ, # %= - LBITSHIFT_EQ, # <<= - RBITSHIFT_EQ, # >>= - UNSIGNED_BITSHIFT_EQ, # >>>= - BACKSLASH_EQ, # \= - AND_EQ, # &= - COLON_EQ, # := - APPROX, # ~ - EX_OR_EQ, # $= - XOR_EQ, # ⊻= - end_assignments, - - begin_pairarrow, - PAIR_ARROW, # => - end_pairarrow, - - # Level 2 - begin_conditional, - CONDITIONAL, # ? - end_conditional, + KEYWORD, # general + ABSTRACT, + BAREMODULE, + BEGIN, + BREAK, + CATCH, + CONST, + CONTINUE, + DO, + ELSE, + ELSEIF, + END, + EXPORT, + FINALLY, + FOR, + FUNCTION, + GLOBAL, + IF, + IMPORT, + IMPORTALL, + LET, + LOCAL, + MACRO, + MODULE, + MUTABLE, + NEW, + OUTER, + PRIMITIVE, + QUOTE, + RETURN, + STRUCT, + TRY, + TYPE, + USING, + WHILE, + end_keywords, begin_cstparser, + INVISIBLE_BRACKETS, + NOTHING, + WS, + SEMICOLON_WS, + NEWLINE_WS, + EMPTY_WS, + end_cstparser, begin_literal, + LITERAL, # general + INTEGER, # 4 + BIN_INT, # 0b1 + HEX_INT, # 0x0 + OCT_INT, # 0o0 + FLOAT, # 3.5, 3.7e+3 + STRING, # "foo" + TRIPLE_STRING, # """ foo \n """ + CHAR, # 'a' + CMD, # `cmd ...` + TRIPLE_CMD, # ```cmd ...``` + TRUE, FALSE, + end_literal, begin_delimiters, + LSQUARE, # [ + RSQUARE, # [ + LBRACE, # { + RBRACE, # } + LPAREN, # ( + RPAREN, # ) + end_delimiters, begin_ops, + OP, # general + DDDOT, # ... - # Level 3 - begin_arrow, - RIGHT_ARROW, # --> - LEFT_ARROW, # <-- - DOUBLE_ARROW, # <--> - LEFTWARDS_ARROW, # ← - RIGHTWARDS_ARROW, # → - LEFT_RIGHT_ARROW, # ↔ - LEFTWARDS_ARROW_WITH_STROKE, # ↚ - RIGHTWARDS_ARROW_WITH_STROKE, # ↛ - LEFTWARDS_TWO_HEADED_ARROW,# ↞ - RIGHTWARDS_TWO_HEADED_ARROW, # ↠ - LEFTWARDS_ARROW_WITH_TAIL, # ↢ - RIGHTWARDS_ARROW_WITH_TAIL, # ↣ - LEFTWARDS_ARROW_FROM_BAR,# ↤ - RIGHTWARDS_ARROW_FROM_BAR, # ↦ - LEFT_RIGHT_ARROW_WITH_STROKE, # ↮ - LEFT_RIGHT_DOUBLE_ARROW_WITH_STROKE, # ⇎ - LEFTWARDS_DOUBLE_ARROW_WITH_STROKE, # ⇍ - RIGHTWARDS_DOUBLE_ARROW_WITH_STROKE, # ⇏ - LEFTWARDS_DOUBLE_ARROW, # ⇐ - RIGHTWARDS_DOUBLE_ARROW, # ⇒ - LEFT_RIGHT_DOUBLE_ARROW, # ⇔ - RIGHT_ARROW_WITH_SMALL_CIRCLE, # ⇴ - THREE_RIGHTWARDS_ARROWS, # ⇶ - LEFTWARDS_ARROW_WITH_VERTICAL_STROKE, # ⇷ - RIGHTWARDS_ARROW_WITH_VERTICAL_STROKE, # ⇸ - LEFT_RIGHT_ARROW_WITH_VERTICAL_STROKE, # ⇹ - LEFTWARDS_ARROW_WITH_DOUBLE_VERTICAL_STROKE, # ⇺ - RIGHTWARDS_ARROW_WITH_DOUBLE_VERTICAL_STROKE, # ⇻ - LEFT_RIGHT_ARROW_WITH_DOUBLE_VERTICAL_STROKE, # ⇼ - LEFTWARDS_OPEN_HEADED_ARROW, # ⇽ - RIGHTWARDS_OPEN_HEADED_ARROW, # ⇾ - LEFT_RIGHT_OPEN_HEADED_ARROW, # ⇿ - LONG_LEFTWARDS_ARROW, # ⟵ - LONG_RIGHTWARDS_ARROW, # ⟶ - LONG_LEFT_RIGHT_ARROW, # ⟷ - LONG_RIGHTWARDS_DOUBLE_ARROW, # ⟹ - LONG_LEFT_RIGHT_DOUBLE_ARROW, # ⟺ - LONG_LEFTWARDS_ARROW_FROM_BAR, # ⟻ - LONG_RIGHTWARDS_ARROW_FROM_BAR, # ⟼ - LONG_LEFTWARDS_DOUBLE_ARROW_FROM_BAR, # ⟽ - LONG_RIGHTWARDS_DOUBLE_ARROW_FROM_BAR, # ⟾ - LONG_RIGHTWARDS_SQUIGGLE_ARROW, # ⟿ - RIGHTWARDS_TWO_HEADED_ARROW_WITH_VERTICAL_STROKE, # ⤀ - RIGHTWARDS_TWO_HEADED_ARROW_WITH_DOUBLE_VERTICAL_STROKE, # ⤁ - LEFTWARDS_DOUBLE_ARROW_WITH_VERTICAL_STROKE, # ⤂ - RIGHTWARDS_DOUBLE_ARROW_WITH_VERTICAL_STROKE, # ⤃ - LEFT_RIGHT_DOUBLE_ARROW_WITH_VERTICAL_STROKE, # ⤄ - RIGHTWARDS_TWO_HEADED_ARROW_FROM_BAR, # ⤅ - LEFTWARDS_DOUBLE_ARROW_FROM_BAR, # ⤆ - RIGHTWARDS_DOUBLE_ARROW_FROM_BAR, # ⤇ - LEFTWARDS_DOUBLE_DASH_ARROW, # ⤌ - RIGHTWARDS_DOUBLE_DASH_ARROW, # ⤍ - LEFTWARDS_TRIPLE_DASH_ARROW, # ⤎ - RIGHTWARDS_TRIPLE_DASH_ARROW, # ⤏ - RIGHTWARDS_TWO_HEADED_TRIPLE_DASH_ARROW, # ⤐ - RIGHTWARDS_ARROW_WITH_DOTTED_STEM, # ⤑ - RIGHTWARDS_ARROW_WITH_TAIL_WITH_VERTICAL_STROKE, # ⤔ - RIGHTWARDS_ARROW_WITH_TAIL_WITH_DOUBLE_VERTICAL_STROKE, # ⤕ - RIGHTWARDS_TWO_HEADED_ARROW_WITH_TAIL, # ⤖ - RIGHTWARDS_TWO_HEADED_ARROW_WITH_TAIL_WITH_VERTICAL_STROKE, # ⤗ - RIGHTWARDS_TWO_HEADED_ARROW_WITH_TAIL_WITH_DOUBLE_VERTICAL_STROKE, # ⤘ - LEFTWARDS_ARROW_TO_BLACK_DIAMOND, # ⤝ - RIGHTWARDS_ARROW_TO_BLACK_DIAMOND, # ⤞ - LEFTWARDS_ARROW_FROM_BAR_TO_BLACK_DIAMOND, # ⤟ - RIGHTWARDS_ARROW_FROM_BAR_TO_BLACK_DIAMOND, # ⤠ - SHORT_RIGHTWARDS_ARROW_ABOVE_LEFTWARDS_ARROW, # ⥄ - RIGHTWARDS_ARROW_WITH_PLUS_BELOW, # ⥅ - LEFTWARDS_ARROW_WITH_PLUS_BELOW, # ⥆ - RIGHTWARDS_ARROW_THROUGH_X, # ⥇ - LEFT_RIGHT_ARROW_THROUGH_SMALL_CIRCLE, # ⥈ - LEFT_BARB_UP_RIGHT_BARB_DOWN_HARPOON, # ⥊ - LEFT_BARB_DOWN_RIGHT_BARB_UP_HARPOON, # ⥋ - LEFT_BARB_UP_RIGHT_BARB_UP_HARPOON, # ⥎ - LEFT_BARB_DOWN_RIGHT_BARB_DOWN_HARPOON, # ⥐ - LEFTWARDS_HARPOON_WITH_BARB_UP_TO_BAR, # ⥒ - RIGHTWARDS_HARPOON_WITH_BARB_UP_TO_BAR, # ⥓ - LEFTWARDS_HARPOON_WITH_BARB_DOWN_TO_BAR, # ⥖ - RIGHTWARDS_HARPOON_WITH_BARB_DOWN_TO_BAR, # ⥗ - LEFTWARDS_HARPOON_WITH_BARB_UP_FROM_BAR, # ⥚ - RIGHTWARDS_HARPOON_WITH_BARB_UP_FROM_BAR, # ⥛ - LEFTWARDS_HARPOON_WITH_BARB_DOWN_FROM_BAR, # ⥞ - RIGHTWARDS_HARPOON_WITH_BARB_DOWN_FROM_BAR, # ⥟ - LEFTWARDS_HARPOON_WITH_BARB_UP_ABOVE_LEFTWARDS_HARPOON_WITH_BARB_DOWN, # ⥢ - RIGHTWARDS_HARPOON_WITH_BARB_UP_ABOVE_RIGHTWARDS_HARPOON_WITH_BARB_DOWN, # ⥤ - LEFTWARDS_HARPOON_WITH_BARB_UP_ABOVE_RIGHTWARDS_HARPOON_WITH_BARB_UP, # ⥦ - LEFTWARDS_HARPOON_WITH_BARB_DOWN_ABOVE_RIGHTWARDS_HARPOON_WITH_BARB_DOWN, # ⥧ - RIGHTWARDS_HARPOON_WITH_BARB_UP_ABOVE_LEFTWARDS_HARPOON_WITH_BARB_UP, # ⥨ - RIGHTWARDS_HARPOON_WITH_BARB_DOWN_ABOVE_LEFTWARDS_HARPOON_WITH_BARB_DOWN, # ⥩ - LEFTWARDS_HARPOON_WITH_BARB_UP_ABOVE_LONG_DASH, # ⥪ - LEFTWARDS_HARPOON_WITH_BARB_DOWN_BELOW_LONG_DASH, # ⥫ - RIGHTWARDS_HARPOON_WITH_BARB_UP_ABOVE_LONG_DASH, # ⥬ - RIGHTWARDS_HARPOON_WITH_BARB_DOWN_BELOW_LONG_DASH, # ⥭ - RIGHT_DOUBLE_ARROW_WITH_ROUNDED_HEAD, # ⥰ - RULE_DELAYED, # ⧴ - THREE_LEFTWARDS_ARROWS, # ⬱ - LEFT_ARROW_WITH_SMALL_CIRCLE, # ⬰ - LEFT_ARROW_WITH_CIRCLED_PLUS, # ⬲ - LONG_LEFTWARDS_SQUIGGLE_ARROW, # ⬳ - LEFTWARDS_TWO_HEADED_ARROW_WITH_VERTICAL_STROKE, # ⬴ - LEFTWARDS_TWO_HEADED_ARROW_WITH_DOUBLE_VERTICAL_STROKE, # ⬵ - LEFTWARDS_TWO_HEADED_ARROW_FROM_BAR, # ⬶ - LEFTWARDS_TWO_HEADED_TRIPLE_DASH_ARROW, # ⬷ - LEFTWARDS_ARROW_WITH_DOTTED_STEM, # ⬸ - LEFTWARDS_ARROW_WITH_TAIL_WITH_VERTICAL_STROKE, # ⬹ - LEFTWARDS_ARROW_WITH_TAIL_WITH_DOUBLE_VERTICAL_STROKE, # ⬺ - LEFTWARDS_TWO_HEADED_ARROW_WITH_TAIL, # ⬻ - LEFTWARDS_TWO_HEADED_ARROW_WITH_TAIL_WITH_VERTICAL_STROKE, # ⬼ - LEFTWARDS_TWO_HEADED_ARROW_WITH_TAIL_WITH_DOUBLE_VERTICAL_STROKE, # ⬽ - LEFTWARDS_ARROW_THROUGH_X, # ⬾ - WAVE_ARROW_POINTING_DIRECTLY_LEFT, # ⬿ - EQUALS_SIGN_ABOVE_LEFTWARDS_ARROW, # ⭀ - REVERSE_TILDE_OPERATOR_ABOVE_LEFTWARDS_ARROW, # ⭁ - LEFTWARDS_ARROW_ABOVE_REVERSE_ALMOST_EQUAL_TO, # ⭂ - RIGHTWARDS_ARROW_THROUGH_GREATER_THAN, # ⭃ - RIGHTWARDS_ARROW_THROUGH_SUPERSET, # ⭄ - REVERSE_TILDE_OPERATOR_ABOVE_RIGHTWARDS_ARROW, # ⭇ - RIGHTWARDS_ARROW_ABOVE_REVERSE_ALMOST_EQUAL_TO, # ⭈ - TILDE_OPERATOR_ABOVE_LEFTWARDS_ARROW, # ⭉ - LEFTWARDS_ARROW_ABOVE_ALMOST_EQUAL_TO, # ⭊ - LEFTWARDS_ARROW_ABOVE_REVERSE_TILDE_OPERATOR, # ⭋ - RIGHTWARDS_ARROW_ABOVE_REVERSE_TILDE_OPERATOR, # ⭌ - HALFWIDTH_LEFTWARDS_ARROW, # ← - HALFWIDTH_RIGHTWARDS_ARROW, # → - CIRCLE_ARROW_RIGHT, - LEFT_SQUIGGLE_ARROW, # ⇜ - RIGHT_SQUIGGLE_ARROW, # ⇝ - LEFT_WAVE_ARROW, # ↜ - RIGHT_WAVE_ARROW, # ↝ - LEFTWARDS_ARROW_WITH_HOOK, # ↩ - RIGHTWARDS_ARROW_WITH_HOOK, # ↪ - LOOP_ARROW_LEFT, # ↫ - LOOP_ARROW_RIGHT, # ↬ - LEFT_HARPOON_UP, # ↼ - LEFT_HARPOON_DOWN, # ↽ - RIGHT_HARPOON_UP, # ⇀ - RIGHT_HARPOON_DOWN, # ⇁ - RIGHT_LEFT_ARROWS, # ⇄ - LEFT_RIGHT_ARROWS, # ⇆ - LEFT_LEFT_ARROWS, # ⇇ - RIGHT_RIGHT_ARROWS, # ⇉ - LEFT_RIGHT_HARPOONS, # ⇋ - RIGHT_LEFT_HARPOONS, # ⇌ - L_LEFT_ARROW, # ⇚ - R_RIGHT_ARROW, # ⇛ - LEFT_DASH_ARROW, # ⇠ - RIGHT_DASH_ARROW, # ⇢ - CURVE_ARROW_RIGHT, # ↷ - CURVE_ARROW_LEFT,# ↶ - CIRCLE_ARROW_LEFT,# ↺ - end_arrow, + # Level 1 + begin_assignments, + EQ, # = + PLUS_EQ, # += + MINUS_EQ, # -= + STAR_EQ, # *= + FWD_SLASH_EQ, # /= + FWDFWD_SLASH_EQ, # //= + OR_EQ, # |= + CIRCUMFLEX_EQ, # ^= + DIVISION_EQ, # ÷= + REM_EQ, # %= + LBITSHIFT_EQ, # <<= + RBITSHIFT_EQ, # >>= + UNSIGNED_BITSHIFT_EQ, # >>>= + BACKSLASH_EQ, # \= + AND_EQ, # &= + COLON_EQ, # := + APPROX, # ~ + EX_OR_EQ, # $= + XOR_EQ, # ⊻= + end_assignments, begin_pairarrow, + PAIR_ARROW, # => + end_pairarrow, - # Level 4 - begin_lazyor, - LAZY_OR, # || - end_lazyor, + # Level 2 + begin_conditional, + CONDITIONAL, # ? + end_conditional, - # Level 5 - begin_lazyand, - LAZY_AND, # && - end_lazyand, + # Level 3 + begin_arrow, + RIGHT_ARROW, # --> + LEFT_ARROW, # <-- + DOUBLE_ARROW, # <--> + LEFTWARDS_ARROW, # ← + RIGHTWARDS_ARROW, # → + LEFT_RIGHT_ARROW, # ↔ + LEFTWARDS_ARROW_WITH_STROKE, # ↚ + RIGHTWARDS_ARROW_WITH_STROKE, # ↛ + LEFTWARDS_TWO_HEADED_ARROW,# ↞ + RIGHTWARDS_TWO_HEADED_ARROW, # ↠ + LEFTWARDS_ARROW_WITH_TAIL, # ↢ + RIGHTWARDS_ARROW_WITH_TAIL, # ↣ + LEFTWARDS_ARROW_FROM_BAR,# ↤ + RIGHTWARDS_ARROW_FROM_BAR, # ↦ + LEFT_RIGHT_ARROW_WITH_STROKE, # ↮ + LEFT_RIGHT_DOUBLE_ARROW_WITH_STROKE, # ⇎ + LEFTWARDS_DOUBLE_ARROW_WITH_STROKE, # ⇍ + RIGHTWARDS_DOUBLE_ARROW_WITH_STROKE, # ⇏ + LEFTWARDS_DOUBLE_ARROW, # ⇐ + RIGHTWARDS_DOUBLE_ARROW, # ⇒ + LEFT_RIGHT_DOUBLE_ARROW, # ⇔ + RIGHT_ARROW_WITH_SMALL_CIRCLE, # ⇴ + THREE_RIGHTWARDS_ARROWS, # ⇶ + LEFTWARDS_ARROW_WITH_VERTICAL_STROKE, # ⇷ + RIGHTWARDS_ARROW_WITH_VERTICAL_STROKE, # ⇸ + LEFT_RIGHT_ARROW_WITH_VERTICAL_STROKE, # ⇹ + LEFTWARDS_ARROW_WITH_DOUBLE_VERTICAL_STROKE, # ⇺ + RIGHTWARDS_ARROW_WITH_DOUBLE_VERTICAL_STROKE, # ⇻ + LEFT_RIGHT_ARROW_WITH_DOUBLE_VERTICAL_STROKE, # ⇼ + LEFTWARDS_OPEN_HEADED_ARROW, # ⇽ + RIGHTWARDS_OPEN_HEADED_ARROW, # ⇾ + LEFT_RIGHT_OPEN_HEADED_ARROW, # ⇿ + LONG_LEFTWARDS_ARROW, # ⟵ + LONG_RIGHTWARDS_ARROW, # ⟶ + LONG_LEFT_RIGHT_ARROW, # ⟷ + LONG_RIGHTWARDS_DOUBLE_ARROW, # ⟹ + LONG_LEFT_RIGHT_DOUBLE_ARROW, # ⟺ + LONG_LEFTWARDS_ARROW_FROM_BAR, # ⟻ + LONG_RIGHTWARDS_ARROW_FROM_BAR, # ⟼ + LONG_LEFTWARDS_DOUBLE_ARROW_FROM_BAR, # ⟽ + LONG_RIGHTWARDS_DOUBLE_ARROW_FROM_BAR, # ⟾ + LONG_RIGHTWARDS_SQUIGGLE_ARROW, # ⟿ + RIGHTWARDS_TWO_HEADED_ARROW_WITH_VERTICAL_STROKE, # ⤀ + RIGHTWARDS_TWO_HEADED_ARROW_WITH_DOUBLE_VERTICAL_STROKE, # ⤁ + LEFTWARDS_DOUBLE_ARROW_WITH_VERTICAL_STROKE, # ⤂ + RIGHTWARDS_DOUBLE_ARROW_WITH_VERTICAL_STROKE, # ⤃ + LEFT_RIGHT_DOUBLE_ARROW_WITH_VERTICAL_STROKE, # ⤄ + RIGHTWARDS_TWO_HEADED_ARROW_FROM_BAR, # ⤅ + LEFTWARDS_DOUBLE_ARROW_FROM_BAR, # ⤆ + RIGHTWARDS_DOUBLE_ARROW_FROM_BAR, # ⤇ + LEFTWARDS_DOUBLE_DASH_ARROW, # ⤌ + RIGHTWARDS_DOUBLE_DASH_ARROW, # ⤍ + LEFTWARDS_TRIPLE_DASH_ARROW, # ⤎ + RIGHTWARDS_TRIPLE_DASH_ARROW, # ⤏ + RIGHTWARDS_TWO_HEADED_TRIPLE_DASH_ARROW, # ⤐ + RIGHTWARDS_ARROW_WITH_DOTTED_STEM, # ⤑ + RIGHTWARDS_ARROW_WITH_TAIL_WITH_VERTICAL_STROKE, # ⤔ + RIGHTWARDS_ARROW_WITH_TAIL_WITH_DOUBLE_VERTICAL_STROKE, # ⤕ + RIGHTWARDS_TWO_HEADED_ARROW_WITH_TAIL, # ⤖ + RIGHTWARDS_TWO_HEADED_ARROW_WITH_TAIL_WITH_VERTICAL_STROKE, # ⤗ + RIGHTWARDS_TWO_HEADED_ARROW_WITH_TAIL_WITH_DOUBLE_VERTICAL_STROKE, # ⤘ + LEFTWARDS_ARROW_TO_BLACK_DIAMOND, # ⤝ + RIGHTWARDS_ARROW_TO_BLACK_DIAMOND, # ⤞ + LEFTWARDS_ARROW_FROM_BAR_TO_BLACK_DIAMOND, # ⤟ + RIGHTWARDS_ARROW_FROM_BAR_TO_BLACK_DIAMOND, # ⤠ + SHORT_RIGHTWARDS_ARROW_ABOVE_LEFTWARDS_ARROW, # ⥄ + RIGHTWARDS_ARROW_WITH_PLUS_BELOW, # ⥅ + LEFTWARDS_ARROW_WITH_PLUS_BELOW, # ⥆ + RIGHTWARDS_ARROW_THROUGH_X, # ⥇ + LEFT_RIGHT_ARROW_THROUGH_SMALL_CIRCLE, # ⥈ + LEFT_BARB_UP_RIGHT_BARB_DOWN_HARPOON, # ⥊ + LEFT_BARB_DOWN_RIGHT_BARB_UP_HARPOON, # ⥋ + LEFT_BARB_UP_RIGHT_BARB_UP_HARPOON, # ⥎ + LEFT_BARB_DOWN_RIGHT_BARB_DOWN_HARPOON, # ⥐ + LEFTWARDS_HARPOON_WITH_BARB_UP_TO_BAR, # ⥒ + RIGHTWARDS_HARPOON_WITH_BARB_UP_TO_BAR, # ⥓ + LEFTWARDS_HARPOON_WITH_BARB_DOWN_TO_BAR, # ⥖ + RIGHTWARDS_HARPOON_WITH_BARB_DOWN_TO_BAR, # ⥗ + LEFTWARDS_HARPOON_WITH_BARB_UP_FROM_BAR, # ⥚ + RIGHTWARDS_HARPOON_WITH_BARB_UP_FROM_BAR, # ⥛ + LEFTWARDS_HARPOON_WITH_BARB_DOWN_FROM_BAR, # ⥞ + RIGHTWARDS_HARPOON_WITH_BARB_DOWN_FROM_BAR, # ⥟ + LEFTWARDS_HARPOON_WITH_BARB_UP_ABOVE_LEFTWARDS_HARPOON_WITH_BARB_DOWN, # ⥢ + RIGHTWARDS_HARPOON_WITH_BARB_UP_ABOVE_RIGHTWARDS_HARPOON_WITH_BARB_DOWN, # ⥤ + LEFTWARDS_HARPOON_WITH_BARB_UP_ABOVE_RIGHTWARDS_HARPOON_WITH_BARB_UP, # ⥦ + LEFTWARDS_HARPOON_WITH_BARB_DOWN_ABOVE_RIGHTWARDS_HARPOON_WITH_BARB_DOWN, # ⥧ + RIGHTWARDS_HARPOON_WITH_BARB_UP_ABOVE_LEFTWARDS_HARPOON_WITH_BARB_UP, # ⥨ + RIGHTWARDS_HARPOON_WITH_BARB_DOWN_ABOVE_LEFTWARDS_HARPOON_WITH_BARB_DOWN, # ⥩ + LEFTWARDS_HARPOON_WITH_BARB_UP_ABOVE_LONG_DASH, # ⥪ + LEFTWARDS_HARPOON_WITH_BARB_DOWN_BELOW_LONG_DASH, # ⥫ + RIGHTWARDS_HARPOON_WITH_BARB_UP_ABOVE_LONG_DASH, # ⥬ + RIGHTWARDS_HARPOON_WITH_BARB_DOWN_BELOW_LONG_DASH, # ⥭ + RIGHT_DOUBLE_ARROW_WITH_ROUNDED_HEAD, # ⥰ + RULE_DELAYED, # ⧴ + THREE_LEFTWARDS_ARROWS, # ⬱ + LEFT_ARROW_WITH_SMALL_CIRCLE, # ⬰ + LEFT_ARROW_WITH_CIRCLED_PLUS, # ⬲ + LONG_LEFTWARDS_SQUIGGLE_ARROW, # ⬳ + LEFTWARDS_TWO_HEADED_ARROW_WITH_VERTICAL_STROKE, # ⬴ + LEFTWARDS_TWO_HEADED_ARROW_WITH_DOUBLE_VERTICAL_STROKE, # ⬵ + LEFTWARDS_TWO_HEADED_ARROW_FROM_BAR, # ⬶ + LEFTWARDS_TWO_HEADED_TRIPLE_DASH_ARROW, # ⬷ + LEFTWARDS_ARROW_WITH_DOTTED_STEM, # ⬸ + LEFTWARDS_ARROW_WITH_TAIL_WITH_VERTICAL_STROKE, # ⬹ + LEFTWARDS_ARROW_WITH_TAIL_WITH_DOUBLE_VERTICAL_STROKE, # ⬺ + LEFTWARDS_TWO_HEADED_ARROW_WITH_TAIL, # ⬻ + LEFTWARDS_TWO_HEADED_ARROW_WITH_TAIL_WITH_VERTICAL_STROKE, # ⬼ + LEFTWARDS_TWO_HEADED_ARROW_WITH_TAIL_WITH_DOUBLE_VERTICAL_STROKE, # ⬽ + LEFTWARDS_ARROW_THROUGH_X, # ⬾ + WAVE_ARROW_POINTING_DIRECTLY_LEFT, # ⬿ + EQUALS_SIGN_ABOVE_LEFTWARDS_ARROW, # ⭀ + REVERSE_TILDE_OPERATOR_ABOVE_LEFTWARDS_ARROW, # ⭁ + LEFTWARDS_ARROW_ABOVE_REVERSE_ALMOST_EQUAL_TO, # ⭂ + RIGHTWARDS_ARROW_THROUGH_GREATER_THAN, # ⭃ + RIGHTWARDS_ARROW_THROUGH_SUPERSET, # ⭄ + REVERSE_TILDE_OPERATOR_ABOVE_RIGHTWARDS_ARROW, # ⭇ + RIGHTWARDS_ARROW_ABOVE_REVERSE_ALMOST_EQUAL_TO, # ⭈ + TILDE_OPERATOR_ABOVE_LEFTWARDS_ARROW, # ⭉ + LEFTWARDS_ARROW_ABOVE_ALMOST_EQUAL_TO, # ⭊ + LEFTWARDS_ARROW_ABOVE_REVERSE_TILDE_OPERATOR, # ⭋ + RIGHTWARDS_ARROW_ABOVE_REVERSE_TILDE_OPERATOR, # ⭌ + HALFWIDTH_LEFTWARDS_ARROW, # ← + HALFWIDTH_RIGHTWARDS_ARROW, # → + CIRCLE_ARROW_RIGHT, + LEFT_SQUIGGLE_ARROW, # ⇜ + RIGHT_SQUIGGLE_ARROW, # ⇝ + LEFT_WAVE_ARROW, # ↜ + RIGHT_WAVE_ARROW, # ↝ + LEFTWARDS_ARROW_WITH_HOOK, # ↩ + RIGHTWARDS_ARROW_WITH_HOOK, # ↪ + LOOP_ARROW_LEFT, # ↫ + LOOP_ARROW_RIGHT, # ↬ + LEFT_HARPOON_UP, # ↼ + LEFT_HARPOON_DOWN, # ↽ + RIGHT_HARPOON_UP, # ⇀ + RIGHT_HARPOON_DOWN, # ⇁ + RIGHT_LEFT_ARROWS, # ⇄ + LEFT_RIGHT_ARROWS, # ⇆ + LEFT_LEFT_ARROWS, # ⇇ + RIGHT_RIGHT_ARROWS, # ⇉ + LEFT_RIGHT_HARPOONS, # ⇋ + RIGHT_LEFT_HARPOONS, # ⇌ + L_LEFT_ARROW, # ⇚ + R_RIGHT_ARROW, # ⇛ + LEFT_DASH_ARROW, # ⇠ + RIGHT_DASH_ARROW, # ⇢ + CURVE_ARROW_RIGHT, # ↷ + CURVE_ARROW_LEFT,# ↶ + CIRCLE_ARROW_LEFT,# ↺ + end_arrow, - # Level 6 - begin_comparison, - ISSUBTYPE, # <: - ISSUPERTYPE, # >: - GREATER, # > - LESS, # < - GREATER_EQ, # >= - GREATER_THAN_OR_EQUAL_TO, # ≥ - LESS_EQ, # <= - LESS_THAN_OR_EQUAL_TO, # ≤ - EQEQ, # == - EQEQEQ, # === - IDENTICAL_TO, # ≡ - NOT_EQ, # != - NOT_EQUAL_TO, # ≠ - NOT_IS, # !== - NOT_IDENTICAL_TO, # ≢ - ELEMENT_OF, # ∈ - IN, # in - ISA, # isa - NOT_AN_ELEMENT_OF, # ∉ - CONTAINS_AS_MEMBER, # ∋ - DOES_NOT_CONTAIN_AS_MEMBER, # ∌ - SUBSET_OF_OR_EQUAL_TO, # ⊆ - NEITHER_A_SUBSET_OF_NOR_EQUAL_TO, # ⊈ - SUBSET_OF, # ⊂ - NOT_A_SUBSET_OF, # ⊄ - SUBSET_OF_WITH_NOT_EQUAL_TO, # ⊊ - PROPORTIONAL_TO, # ∝ - SMALL_ELEMENT_OF, # ∊ - SMALL_CONTAINS_AS_MEMBER, # ∍ - PARALLEL_TO, # ∥ - NOT_PARALLEL_TO, # ∦ - PROPORTION, # ∷ - GEOMETRIC_PROPORTION, # ∺ - HOMOTHETIC, # ∻ - REVERSED_TILDE, # ∽ - INVERTED_LAZY_S, # ∾ - NOT_TILDE, # ≁ - ASYMPTOTICALLY_EQUAL_TO, # ≃ - NOT_ASYMPTOTICALLY_EQUAL_TO, # ≄ - APPROXIMATELY_EQUAL_TO, # ≅ - APPROXIMATELY_BUT_NOT_ACTUALLY_EQUAL_TO, # ≆ - NEITHER_APPROXIMATELY_NOR_ACTUALLY_EQUAL_TO, # ≇ - ALMOST_EQUAL_TO, # ≈ - NOT_ALMOST_EQUAL_TO, # ≉ - ALMOST_EQUAL_OR_EQUAL_TO, # ≊ - TRIPLE_TILDE, # ≋ - ALL_EQUAL_TO, # ≌ - EQUIVALENT_TO, # ≍ - GEOMETRICALLY_EQUIVALENT_TO, # ≎ - APPROACHES_THE_LIMIT, # ≐ - GEOMETRICALLY_EQUAL_TO, # ≑ - APPROXIMATELY_EQUAL_TO_OR_THE_IMAGE_OF, # ≒ - IMAGE_OF_OR_APPROXIMATELY_EQUAL_TO, # ≓ - COLON_EQUALS, # ≔ - EQUALS_COLON, # ≕ - RING_IN_EQUAL_TO, # ≖ - RING_EQUAL_TO, # ≗ - CORRESPONDS_TO, # ≘ - ESTIMATES, # ≙ - EQUIANGULAR_TO, # ≚ - STAR_EQUALS, # ≛ - DELTA_EQUAL_TO, # ≜ - EQUAL_TO_BY_DEFINITION, # ≝ - MEASURED_BY, # ≞ - QUESTIONED_EQUAL_TO, # ≟ - STRICTLY_EQUIVALENT_TO, # ≣ - LESS_THAN_OVER_EQUAL_TO, # ≦ - GREATER_THAN_OVER_EQUAL_TO, # ≧ - LESS_THAN_BUT_NOT_EQUAL_TO, # ≨ - GREATER_THAN_BUT_NOT_EQUAL_TO, # ≩ - MUCH_LESS_THAN, # ≪ - MUCH_GREATER_THAN, # ≫ - BETWEEN, # ≬ - NOT_EQUIVALENT_TO, # ≭ - NOT_LESS_THAN, # ≮ - NOT_GREATER_THAN, # ≯ - NEITHER_LESS_THAN_NOR_EQUAL_TO, # ≰ - NEITHER_GREATER_THAN_NOR_EQUAL_TO, # ≱ - LESS_THAN_OR_EQUIVALENT_TO, # ≲ - GREATER_THAN_OR_EQUIVALENT_TO, # ≳ - NEITHER_LESS_THAN_NOR_EQUIVALENT_TO, # ≴ - NEITHER_GREATER_THAN_NOR_EQUIVALENT_TO, # ≵ - LESS_THAN_OR_GREATER_THAN, # ≶ - GREATER_THAN_OR_LESS_THAN, # ≷ - NEITHER_LESS_THAN_NOR_GREATER_THAN, # ≸ - NEITHER_GREATER_THAN_NOR_LESS_THAN, # ≹ - PRECEDES, # ≺ - SUCCEEDS, # ≻ - PRECEDES_OR_EQUAL_TO, # ≼ - SUCCEEDS_OR_EQUAL_TO, # ≽ - PRECEDES_OR_EQUIVALENT_TO, # ≾ - SUCCEEDS_OR_EQUIVALENT_TO, # ≿ - DOES_NOT_PRECEDE, # ⊀ - DOES_NOT_SUCCEED, # ⊁ - SUPERSET_OF, # ⊃ - NOT_A_SUPERSET_OF, # ⊅ - SUPERSET_OF_OR_EQUAL_TO, # ⊇ - NEITHER_A_SUPERSET_OF_NOR_EQUAL_TO, # ⊉ - SUPERSET_OF_WITH_NOT_EQUAL_TO, # ⊋ - SQUARE_IMAGE_OF, # ⊏ - SQUARE_ORIGINAL_OF, # ⊐ - SQUARE_IMAGE_OF_OR_EQUAL_TO, # ⊑ - SQUARE_ORIGINAL_OF_OR_EQUAL_TO, # ⊒ - CIRCLED_EQUALS, # ⊜ - FORCES, # ⊩ - DOES_NOT_PROVE, # ⊬ - DOES_NOT_FORCE, # ⊮ - PRECEDES_UNDER_RELATION, # ⊰ - SUCCEEDS_UNDER_RELATION, # ⊱ - NORMAL_SUBGROUP_OF, # ⊲ - CONTAINS_AS_NORMAL_SUBGROUP, # ⊳ - NORMAL_SUBGROUP_OF_OR_EQUAL_TO, # ⊴ - CONTAINS_AS_NORMAL_SUBGROUP_OR_EQUAL_TO, # ⊵ - ORIGINAL_OF, # ⊶ - IMAGE_OF, # ⊷ - REVERSED_TILDE_EQUALS, # ⋍ - DOUBLE_SUBSET, # ⋐ - DOUBLE_SUPERSET, # ⋑ - EQUAL_AND_PARALLEL_TO, # ⋕ - LESS_THAN_WITH_DOT, # ⋖ - GREATER_THAN_WITH_DOT, # ⋗ - VERY_MUCH_LESS_THAN, # ⋘ - VERY_MUCH_GREATER_THAN, # ⋙ - LESS_THAN_EQUAL_TO_OR_GREATER_THAN, # ⋚ - GREATER_THAN_EQUAL_TO_OR_LESS_THAN, # ⋛ - EQUAL_TO_OR_LESS_THAN, # ⋜ - EQUAL_TO_OR_GREATER_THAN, # ⋝ - EQUAL_TO_OR_PRECEDES, # ⋞ - EQUAL_TO_OR_SUCCEEDS, # ⋟ - DOES_NOT_PRECEDE_OR_EQUAL, # ⋠ - DOES_NOT_SUCCEED_OR_EQUAL, # ⋡ - NOT_SQUARE_IMAGE_OF_OR_EQUAL_TO, # ⋢ - NOT_SQUARE_ORIGINAL_OF_OR_EQUAL_TO, # ⋣ - SQUARE_IMAGE_OF_OR_NOT_EQUAL_TO, # ⋤ - SQUARE_ORIGINAL_OF_OR_NOT_EQUAL_TO, # ⋥ - LESS_THAN_BUT_NOT_EQUIVALENT_TO, # ⋦ - GREATER_THAN_BUT_NOT_EQUIVALENT_TO, # ⋧ - PRECEDES_BUT_NOT_EQUIVALENT_TO, # ⋨ - SUCCEEDS_BUT_NOT_EQUIVALENT_TO, # ⋩ - NOT_NORMAL_SUBGROUP_OF, # ⋪ - DOES_NOT_CONTAIN_AS_NORMAL_SUBGROUP, # ⋫ - NOT_NORMAL_SUBGROUP_OF_OR_EQUAL_TO, # ⋬ - DOES_NOT_CONTAIN_AS_NORMAL_SUBGROUP_OR_EQUAL, # ⋭ - ELEMENT_OF_WITH_LONG_HORIZONTAL_STROKE, # ⋲ - ELEMENT_OF_WITH_VERTICAL_BAR_AT_END_OF_HORIZONTAL_STROKE, # ⋳ - SMALL_ELEMENT_OF_WITH_VERTICAL_BAR_AT_END_OF_HORIZONTAL_STROKE, # ⋴ - ELEMENT_OF_WITH_DOT_ABOVE, # ⋵ - ELEMENT_OF_WITH_OVERBAR, # ⋶ - SMALL_ELEMENT_OF_WITH_OVERBAR, # ⋷ - ELEMENT_OF_WITH_UNDERBAR, # ⋸ - ELEMENT_OF_WITH_TWO_HORIZONTAL_STROKES, # ⋹ - CONTAINS_WITH_LONG_HORIZONTAL_STROKE, # ⋺ - CONTAINS_WITH_VERTICAL_BAR_AT_END_OF_HORIZONTAL_STROKE, # ⋻ - SMALL_CONTAINS_WITH_VERTICAL_BAR_AT_END_OF_HORIZONTAL_STROKE, # ⋼ - CONTAINS_WITH_OVERBAR, # ⋽ - SMALL_CONTAINS_WITH_OVERBAR, # ⋾ - Z_NOTATION_BAG_MEMBERSHIP, # ⋿ - REVERSE_SOLIDUS_PRECEDING_SUBSET, # ⟈ - SUPERSET_PRECEDING_SOLIDUS, # ⟉ - ELEMENT_OF_OPENING_UPWARDS, # ⟒ - CIRCLED_PARALLEL, # ⦷ - CIRCLED_LESS_THAN, # ⧀ - CIRCLED_GREATER_THAN, # ⧁ - INCREASES_AS, # ⧡ - EQUALS_SIGN_AND_SLANTED_PARALLEL, # ⧣ - EQUALS_SIGN_AND_SLANTED_PARALLEL_WITH_TILDE_ABOVE, # ⧤ - IDENTICAL_TO_AND_SLANTED_PARALLEL, # ⧥ - EQUALS_SIGN_WITH_DOT_BELOW, # ⩦ - IDENTICAL_WITH_DOT_ABOVE, # ⩧ - TILDE_OPERATOR_WITH_DOT_ABOVE, # ⩪ - TILDE_OPERATOR_WITH_RISING_DOTS, # ⩫ - SIMILAR_MINUS_SIMILAR, # ⩬ - CONGRUENT_WITH_DOT_ABOVE, # ⩭ - EQUALS_WITH_ASTERISK, # ⩮ - ALMOST_EQUAL_TO_WITH_CIRCUMFLEX_ACCENT, # ⩯ - APPROXIMATELY_EQUAL_OR_EQUAL_TO, # ⩰ - EQUALS_SIGN_ABOVE_PLUS_SIGN, # ⩱ - PLUS_SIGN_ABOVE_EQUALS_SIGN, # ⩲ - EQUALS_SIGN_ABOVE_TILDE_OPERATOR, # ⩳ - DOUBLE_COLON_EQUAL, # ⩴ - TWO_CONSECUTIVE_EQUALS_SIGNS, # ⩵ - THREE_CONSECUTIVE_EQUALS_SIGNS, # ⩶ - EQUALS_SIGN_WITH_TWO_DOTS_ABOVE_AND_TWO_DOTS_BELOW, # ⩷ - EQUIVALENT_WITH_FOUR_DOTS_ABOVE, # ⩸ - LESS_THAN_WITH_CIRCLE_INSIDE, # ⩹ - GREATER_THAN_WITH_CIRCLE_INSIDE, # ⩺ - LESS_THAN_WITH_QUESTION_MARK_ABOVE, # ⩻ - GREATER_THAN_WITH_QUESTION_MARK_ABOVE, # ⩼ - LESS_THAN_OR_SLANTED_EQUAL_TO, # ⩽ - GREATER_THAN_OR_SLANTED_EQUAL_TO, # ⩾ - LESS_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_INSIDE, # ⩿ - GREATER_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_INSIDE, # ⪀ - LESS_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_ABOVE, # ⪁ - GREATER_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_ABOVE, # ⪂ - LESS_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_ABOVE_RIGHT, # ⪃ - GREATER_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_ABOVE_LEFT, # ⪄ - LESS_THAN_OR_APPROXIMATE, # ⪅ - GREATER_THAN_OR_APPROXIMATE, # ⪆ - LESS_THAN_AND_SINGLE_LINE_NOT_EQUAL_TO, # ⪇ - GREATER_THAN_AND_SINGLE_LINE_NOT_EQUAL_TO, # ⪈ - LESS_THAN_AND_NOT_APPROXIMATE, # ⪉ - GREATER_THAN_AND_NOT_APPROXIMATE, # ⪊ - LESS_THAN_ABOVE_DOUBLE_LINE_EQUAL_ABOVE_GREATER_THAN, # ⪋ - GREATER_THAN_ABOVE_DOUBLE_LINE_EQUAL_ABOVE_LESS_THAN, # ⪌ - LESS_THAN_ABOVE_SIMILAR_OR_EQUAL, # ⪍ - GREATER_THAN_ABOVE_SIMILAR_OR_EQUAL, # ⪎ - LESS_THAN_ABOVE_SIMILAR_ABOVE_GREATER_THAN, # ⪏ - GREATER_THAN_ABOVE_SIMILAR_ABOVE_LESS_THAN, # ⪐ - LESS_THAN_ABOVE_GREATER_THAN_ABOVE_DOUBLE_LINE_EQUAL, # ⪑ - GREATER_THAN_ABOVE_LESS_THAN_ABOVE_DOUBLE_LINE_EQUAL, # ⪒ - LESS_THAN_ABOVE_SLANTED_EQUAL_ABOVE_GREATER_THAN_ABOVE_SLANTED_EQUAL, # ⪓ - GREATER_THAN_ABOVE_SLANTED_EQUAL_ABOVE_LESS_THAN_ABOVE_SLANTED_EQUAL, # ⪔ - SLANTED_EQUAL_TO_OR_LESS_THAN, # ⪕ - SLANTED_EQUAL_TO_OR_GREATER_THAN, # ⪖ - SLANTED_EQUAL_TO_OR_LESS_THAN_WITH_DOT_INSIDE, # ⪗ - SLANTED_EQUAL_TO_OR_GREATER_THAN_WITH_DOT_INSIDE, # ⪘ - DOUBLE_LINE_EQUAL_TO_OR_LESS_THAN, # ⪙ - DOUBLE_LINE_EQUAL_TO_OR_GREATER_THAN, # ⪚ - DOUBLE_LINE_SLANTED_EQUAL_TO_OR_LESS_THAN, # ⪛ - DOUBLE_LINE_SLANTED_EQUAL_TO_OR_GREATER_THAN, # ⪜ - SIMILAR_OR_LESS_THAN, # ⪝ - SIMILAR_OR_GREATER_THAN, # ⪞ - SIMILAR_ABOVE_LESS_THAN_ABOVE_EQUALS_SIGN, # ⪟ - SIMILAR_ABOVE_GREATER_THAN_ABOVE_EQUALS_SIGN, # ⪠ - DOUBLE_NESTED_LESS_THAN, # ⪡ - DOUBLE_NESTED_GREATER_THAN, # ⪢ - DOUBLE_NESTED_LESS_THAN_WITH_UNDERBAR, # ⪣ - GREATER_THAN_OVERLAPPING_LESS_THAN, # ⪤ - GREATER_THAN_BESIDE_LESS_THAN, # ⪥ - LESS_THAN_CLOSED_BY_CURVE, # ⪦ - GREATER_THAN_CLOSED_BY_CURVE, # ⪧ - LESS_THAN_CLOSED_BY_CURVE_ABOVE_SLANTED_EQUAL, # ⪨ - GREATER_THAN_CLOSED_BY_CURVE_ABOVE_SLANTED_EQUAL, # ⪩ - SMALLER_THAN, # ⪪ - LARGER_THAN, # ⪫ - SMALLER_THAN_OR_EQUAL_TO, # ⪬ - LARGER_THAN_OR_EQUAL_TO, # ⪭ - EQUALS_SIGN_WITH_BUMPY_ABOVE, # ⪮ - PRECEDES_ABOVE_SINGLE_LINE_EQUALS_SIGN, # ⪯ - SUCCEEDS_ABOVE_SINGLE_LINE_EQUALS_SIGN, # ⪰ - PRECEDES_ABOVE_SINGLE_LINE_NOT_EQUAL_TO, # ⪱ - SUCCEEDS_ABOVE_SINGLE_LINE_NOT_EQUAL_TO, # ⪲ - PRECEDES_ABOVE_EQUALS_SIGN, # ⪳ - SUCCEEDS_ABOVE_EQUALS_SIGN, # ⪴ - PRECEDES_ABOVE_NOT_EQUAL_TO, # ⪵ - SUCCEEDS_ABOVE_NOT_EQUAL_TO, # ⪶ - PRECEDES_ABOVE_ALMOST_EQUAL_TO, # ⪷ - SUCCEEDS_ABOVE_ALMOST_EQUAL_TO, # ⪸ - PRECEDES_ABOVE_NOT_ALMOST_EQUAL_TO, # ⪹ - SUCCEEDS_ABOVE_NOT_ALMOST_EQUAL_TO, # ⪺ - DOUBLE_PRECEDES, # ⪻ - DOUBLE_SUCCEEDS, # ⪼ - SUBSET_WITH_DOT, # ⪽ - SUPERSET_WITH_DOT, # ⪾ - SUBSET_WITH_PLUS_SIGN_BELOW, # ⪿ - SUPERSET_WITH_PLUS_SIGN_BELOW, # ⫀ - SUBSET_WITH_MULTIPLICATION_SIGN_BELOW, # ⫁ - SUPERSET_WITH_MULTIPLICATION_SIGN_BELOW, # ⫂ - SUBSET_OF_OR_EQUAL_TO_WITH_DOT_ABOVE, # ⫃ - SUPERSET_OF_OR_EQUAL_TO_WITH_DOT_ABOVE, # ⫄ - SUBSET_OF_ABOVE_EQUALS_SIGN, # ⫅ - SUPERSET_OF_ABOVE_EQUALS_SIGN, # ⫆ - SUBSET_OF_ABOVE_TILDE_OPERATOR, # ⫇ - SUPERSET_OF_ABOVE_TILDE_OPERATOR, # ⫈ - SUBSET_OF_ABOVE_ALMOST_EQUAL_TO, # ⫉ - SUPERSET_OF_ABOVE_ALMOST_EQUAL_TO, # ⫊ - SUBSET_OF_ABOVE_NOT_EQUAL_TO, # ⫋ - SUPERSET_OF_ABOVE_NOT_EQUAL_TO, # ⫌ - SQUARE_LEFT_OPEN_BOX_OPERATOR, # ⫍ - SQUARE_RIGHT_OPEN_BOX_OPERATOR, # ⫎ - CLOSED_SUBSET, # ⫏ - CLOSED_SUPERSET, # ⫐ - CLOSED_SUBSET_OR_EQUAL_TO, # ⫑ - CLOSED_SUPERSET_OR_EQUAL_TO, # ⫒ - SUBSET_ABOVE_SUPERSET, # ⫓ - SUPERSET_ABOVE_SUBSET, # ⫔ - SUBSET_ABOVE_SUBSET, # ⫕ - SUPERSET_ABOVE_SUPERSET, # ⫖ - SUPERSET_BESIDE_SUBSET, # ⫗ - SUPERSET_BESIDE_AND_JOINED_BY_DASH_WITH_SUBSET, # ⫘ - ELEMENT_OF_OPENING_DOWNWARDS, # ⫙ - TRIPLE_NESTED_LESS_THAN, # ⫷ - TRIPLE_NESTED_GREATER_THAN, # ⫸ - DOUBLE_LINE_SLANTED_LESS_THAN_OR_EQUAL_TO, # ⫹ - DOUBLE_LINE_SLANTED_GREATER_THAN_OR_EQUAL_TO, # ⫺ - RIGHT_TACK, # ⊢ - LEFT_TACK, # ⊣ - PERP, # ⟂ - TOP, # ⫪ - BOT, # ⫫ - end_comparison, + # Level 4 + begin_lazyor, + LAZY_OR, # || + end_lazyor, - # Level 7 - begin_pipe, - LPIPE, # |> - RPIPE, # <| - end_pipe, + # Level 5 + begin_lazyand, + LAZY_AND, # && + end_lazyand, - # Level 8 - begin_colon, - COLON, # : - DDOT, # .. - LDOTS, # … - TRICOLON, # ⁝ - VDOTS, # ⋮ - DDOTS, # ⋱ - ADOTS, # ⋰ - CDOTS, # ⋯ - end_colon, + # Level 6 + begin_comparison, + ISSUBTYPE, # <: + ISSUPERTYPE, # >: + GREATER, # > + LESS, # < + GREATER_EQ, # >= + GREATER_THAN_OR_EQUAL_TO, # ≥ + LESS_EQ, # <= + LESS_THAN_OR_EQUAL_TO, # ≤ + EQEQ, # == + EQEQEQ, # === + IDENTICAL_TO, # ≡ + NOT_EQ, # != + NOT_EQUAL_TO, # ≠ + NOT_IS, # !== + NOT_IDENTICAL_TO, # ≢ + ELEMENT_OF, # ∈ + IN, # in + ISA, # isa + NOT_AN_ELEMENT_OF, # ∉ + CONTAINS_AS_MEMBER, # ∋ + DOES_NOT_CONTAIN_AS_MEMBER, # ∌ + SUBSET_OF_OR_EQUAL_TO, # ⊆ + NEITHER_A_SUBSET_OF_NOR_EQUAL_TO, # ⊈ + SUBSET_OF, # ⊂ + NOT_A_SUBSET_OF, # ⊄ + SUBSET_OF_WITH_NOT_EQUAL_TO, # ⊊ + PROPORTIONAL_TO, # ∝ + SMALL_ELEMENT_OF, # ∊ + SMALL_CONTAINS_AS_MEMBER, # ∍ + PARALLEL_TO, # ∥ + NOT_PARALLEL_TO, # ∦ + PROPORTION, # ∷ + GEOMETRIC_PROPORTION, # ∺ + HOMOTHETIC, # ∻ + REVERSED_TILDE, # ∽ + INVERTED_LAZY_S, # ∾ + NOT_TILDE, # ≁ + ASYMPTOTICALLY_EQUAL_TO, # ≃ + NOT_ASYMPTOTICALLY_EQUAL_TO, # ≄ + APPROXIMATELY_EQUAL_TO, # ≅ + APPROXIMATELY_BUT_NOT_ACTUALLY_EQUAL_TO, # ≆ + NEITHER_APPROXIMATELY_NOR_ACTUALLY_EQUAL_TO, # ≇ + ALMOST_EQUAL_TO, # ≈ + NOT_ALMOST_EQUAL_TO, # ≉ + ALMOST_EQUAL_OR_EQUAL_TO, # ≊ + TRIPLE_TILDE, # ≋ + ALL_EQUAL_TO, # ≌ + EQUIVALENT_TO, # ≍ + GEOMETRICALLY_EQUIVALENT_TO, # ≎ + APPROACHES_THE_LIMIT, # ≐ + GEOMETRICALLY_EQUAL_TO, # ≑ + APPROXIMATELY_EQUAL_TO_OR_THE_IMAGE_OF, # ≒ + IMAGE_OF_OR_APPROXIMATELY_EQUAL_TO, # ≓ + COLON_EQUALS, # ≔ + EQUALS_COLON, # ≕ + RING_IN_EQUAL_TO, # ≖ + RING_EQUAL_TO, # ≗ + CORRESPONDS_TO, # ≘ + ESTIMATES, # ≙ + EQUIANGULAR_TO, # ≚ + STAR_EQUALS, # ≛ + DELTA_EQUAL_TO, # ≜ + EQUAL_TO_BY_DEFINITION, # ≝ + MEASURED_BY, # ≞ + QUESTIONED_EQUAL_TO, # ≟ + STRICTLY_EQUIVALENT_TO, # ≣ + LESS_THAN_OVER_EQUAL_TO, # ≦ + GREATER_THAN_OVER_EQUAL_TO, # ≧ + LESS_THAN_BUT_NOT_EQUAL_TO, # ≨ + GREATER_THAN_BUT_NOT_EQUAL_TO, # ≩ + MUCH_LESS_THAN, # ≪ + MUCH_GREATER_THAN, # ≫ + BETWEEN, # ≬ + NOT_EQUIVALENT_TO, # ≭ + NOT_LESS_THAN, # ≮ + NOT_GREATER_THAN, # ≯ + NEITHER_LESS_THAN_NOR_EQUAL_TO, # ≰ + NEITHER_GREATER_THAN_NOR_EQUAL_TO, # ≱ + LESS_THAN_OR_EQUIVALENT_TO, # ≲ + GREATER_THAN_OR_EQUIVALENT_TO, # ≳ + NEITHER_LESS_THAN_NOR_EQUIVALENT_TO, # ≴ + NEITHER_GREATER_THAN_NOR_EQUIVALENT_TO, # ≵ + LESS_THAN_OR_GREATER_THAN, # ≶ + GREATER_THAN_OR_LESS_THAN, # ≷ + NEITHER_LESS_THAN_NOR_GREATER_THAN, # ≸ + NEITHER_GREATER_THAN_NOR_LESS_THAN, # ≹ + PRECEDES, # ≺ + SUCCEEDS, # ≻ + PRECEDES_OR_EQUAL_TO, # ≼ + SUCCEEDS_OR_EQUAL_TO, # ≽ + PRECEDES_OR_EQUIVALENT_TO, # ≾ + SUCCEEDS_OR_EQUIVALENT_TO, # ≿ + DOES_NOT_PRECEDE, # ⊀ + DOES_NOT_SUCCEED, # ⊁ + SUPERSET_OF, # ⊃ + NOT_A_SUPERSET_OF, # ⊅ + SUPERSET_OF_OR_EQUAL_TO, # ⊇ + NEITHER_A_SUPERSET_OF_NOR_EQUAL_TO, # ⊉ + SUPERSET_OF_WITH_NOT_EQUAL_TO, # ⊋ + SQUARE_IMAGE_OF, # ⊏ + SQUARE_ORIGINAL_OF, # ⊐ + SQUARE_IMAGE_OF_OR_EQUAL_TO, # ⊑ + SQUARE_ORIGINAL_OF_OR_EQUAL_TO, # ⊒ + CIRCLED_EQUALS, # ⊜ + FORCES, # ⊩ + DOES_NOT_PROVE, # ⊬ + DOES_NOT_FORCE, # ⊮ + PRECEDES_UNDER_RELATION, # ⊰ + SUCCEEDS_UNDER_RELATION, # ⊱ + NORMAL_SUBGROUP_OF, # ⊲ + CONTAINS_AS_NORMAL_SUBGROUP, # ⊳ + NORMAL_SUBGROUP_OF_OR_EQUAL_TO, # ⊴ + CONTAINS_AS_NORMAL_SUBGROUP_OR_EQUAL_TO, # ⊵ + ORIGINAL_OF, # ⊶ + IMAGE_OF, # ⊷ + REVERSED_TILDE_EQUALS, # ⋍ + DOUBLE_SUBSET, # ⋐ + DOUBLE_SUPERSET, # ⋑ + EQUAL_AND_PARALLEL_TO, # ⋕ + LESS_THAN_WITH_DOT, # ⋖ + GREATER_THAN_WITH_DOT, # ⋗ + VERY_MUCH_LESS_THAN, # ⋘ + VERY_MUCH_GREATER_THAN, # ⋙ + LESS_THAN_EQUAL_TO_OR_GREATER_THAN, # ⋚ + GREATER_THAN_EQUAL_TO_OR_LESS_THAN, # ⋛ + EQUAL_TO_OR_LESS_THAN, # ⋜ + EQUAL_TO_OR_GREATER_THAN, # ⋝ + EQUAL_TO_OR_PRECEDES, # ⋞ + EQUAL_TO_OR_SUCCEEDS, # ⋟ + DOES_NOT_PRECEDE_OR_EQUAL, # ⋠ + DOES_NOT_SUCCEED_OR_EQUAL, # ⋡ + NOT_SQUARE_IMAGE_OF_OR_EQUAL_TO, # ⋢ + NOT_SQUARE_ORIGINAL_OF_OR_EQUAL_TO, # ⋣ + SQUARE_IMAGE_OF_OR_NOT_EQUAL_TO, # ⋤ + SQUARE_ORIGINAL_OF_OR_NOT_EQUAL_TO, # ⋥ + LESS_THAN_BUT_NOT_EQUIVALENT_TO, # ⋦ + GREATER_THAN_BUT_NOT_EQUIVALENT_TO, # ⋧ + PRECEDES_BUT_NOT_EQUIVALENT_TO, # ⋨ + SUCCEEDS_BUT_NOT_EQUIVALENT_TO, # ⋩ + NOT_NORMAL_SUBGROUP_OF, # ⋪ + DOES_NOT_CONTAIN_AS_NORMAL_SUBGROUP, # ⋫ + NOT_NORMAL_SUBGROUP_OF_OR_EQUAL_TO, # ⋬ + DOES_NOT_CONTAIN_AS_NORMAL_SUBGROUP_OR_EQUAL, # ⋭ + ELEMENT_OF_WITH_LONG_HORIZONTAL_STROKE, # ⋲ + ELEMENT_OF_WITH_VERTICAL_BAR_AT_END_OF_HORIZONTAL_STROKE, # ⋳ + SMALL_ELEMENT_OF_WITH_VERTICAL_BAR_AT_END_OF_HORIZONTAL_STROKE, # ⋴ + ELEMENT_OF_WITH_DOT_ABOVE, # ⋵ + ELEMENT_OF_WITH_OVERBAR, # ⋶ + SMALL_ELEMENT_OF_WITH_OVERBAR, # ⋷ + ELEMENT_OF_WITH_UNDERBAR, # ⋸ + ELEMENT_OF_WITH_TWO_HORIZONTAL_STROKES, # ⋹ + CONTAINS_WITH_LONG_HORIZONTAL_STROKE, # ⋺ + CONTAINS_WITH_VERTICAL_BAR_AT_END_OF_HORIZONTAL_STROKE, # ⋻ + SMALL_CONTAINS_WITH_VERTICAL_BAR_AT_END_OF_HORIZONTAL_STROKE, # ⋼ + CONTAINS_WITH_OVERBAR, # ⋽ + SMALL_CONTAINS_WITH_OVERBAR, # ⋾ + Z_NOTATION_BAG_MEMBERSHIP, # ⋿ + REVERSE_SOLIDUS_PRECEDING_SUBSET, # ⟈ + SUPERSET_PRECEDING_SOLIDUS, # ⟉ + ELEMENT_OF_OPENING_UPWARDS, # ⟒ + CIRCLED_PARALLEL, # ⦷ + CIRCLED_LESS_THAN, # ⧀ + CIRCLED_GREATER_THAN, # ⧁ + INCREASES_AS, # ⧡ + EQUALS_SIGN_AND_SLANTED_PARALLEL, # ⧣ + EQUALS_SIGN_AND_SLANTED_PARALLEL_WITH_TILDE_ABOVE, # ⧤ + IDENTICAL_TO_AND_SLANTED_PARALLEL, # ⧥ + EQUALS_SIGN_WITH_DOT_BELOW, # ⩦ + IDENTICAL_WITH_DOT_ABOVE, # ⩧ + TILDE_OPERATOR_WITH_DOT_ABOVE, # ⩪ + TILDE_OPERATOR_WITH_RISING_DOTS, # ⩫ + SIMILAR_MINUS_SIMILAR, # ⩬ + CONGRUENT_WITH_DOT_ABOVE, # ⩭ + EQUALS_WITH_ASTERISK, # ⩮ + ALMOST_EQUAL_TO_WITH_CIRCUMFLEX_ACCENT, # ⩯ + APPROXIMATELY_EQUAL_OR_EQUAL_TO, # ⩰ + EQUALS_SIGN_ABOVE_PLUS_SIGN, # ⩱ + PLUS_SIGN_ABOVE_EQUALS_SIGN, # ⩲ + EQUALS_SIGN_ABOVE_TILDE_OPERATOR, # ⩳ + DOUBLE_COLON_EQUAL, # ⩴ + TWO_CONSECUTIVE_EQUALS_SIGNS, # ⩵ + THREE_CONSECUTIVE_EQUALS_SIGNS, # ⩶ + EQUALS_SIGN_WITH_TWO_DOTS_ABOVE_AND_TWO_DOTS_BELOW, # ⩷ + EQUIVALENT_WITH_FOUR_DOTS_ABOVE, # ⩸ + LESS_THAN_WITH_CIRCLE_INSIDE, # ⩹ + GREATER_THAN_WITH_CIRCLE_INSIDE, # ⩺ + LESS_THAN_WITH_QUESTION_MARK_ABOVE, # ⩻ + GREATER_THAN_WITH_QUESTION_MARK_ABOVE, # ⩼ + LESS_THAN_OR_SLANTED_EQUAL_TO, # ⩽ + GREATER_THAN_OR_SLANTED_EQUAL_TO, # ⩾ + LESS_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_INSIDE, # ⩿ + GREATER_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_INSIDE, # ⪀ + LESS_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_ABOVE, # ⪁ + GREATER_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_ABOVE, # ⪂ + LESS_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_ABOVE_RIGHT, # ⪃ + GREATER_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_ABOVE_LEFT, # ⪄ + LESS_THAN_OR_APPROXIMATE, # ⪅ + GREATER_THAN_OR_APPROXIMATE, # ⪆ + LESS_THAN_AND_SINGLE_LINE_NOT_EQUAL_TO, # ⪇ + GREATER_THAN_AND_SINGLE_LINE_NOT_EQUAL_TO, # ⪈ + LESS_THAN_AND_NOT_APPROXIMATE, # ⪉ + GREATER_THAN_AND_NOT_APPROXIMATE, # ⪊ + LESS_THAN_ABOVE_DOUBLE_LINE_EQUAL_ABOVE_GREATER_THAN, # ⪋ + GREATER_THAN_ABOVE_DOUBLE_LINE_EQUAL_ABOVE_LESS_THAN, # ⪌ + LESS_THAN_ABOVE_SIMILAR_OR_EQUAL, # ⪍ + GREATER_THAN_ABOVE_SIMILAR_OR_EQUAL, # ⪎ + LESS_THAN_ABOVE_SIMILAR_ABOVE_GREATER_THAN, # ⪏ + GREATER_THAN_ABOVE_SIMILAR_ABOVE_LESS_THAN, # ⪐ + LESS_THAN_ABOVE_GREATER_THAN_ABOVE_DOUBLE_LINE_EQUAL, # ⪑ + GREATER_THAN_ABOVE_LESS_THAN_ABOVE_DOUBLE_LINE_EQUAL, # ⪒ + LESS_THAN_ABOVE_SLANTED_EQUAL_ABOVE_GREATER_THAN_ABOVE_SLANTED_EQUAL, # ⪓ + GREATER_THAN_ABOVE_SLANTED_EQUAL_ABOVE_LESS_THAN_ABOVE_SLANTED_EQUAL, # ⪔ + SLANTED_EQUAL_TO_OR_LESS_THAN, # ⪕ + SLANTED_EQUAL_TO_OR_GREATER_THAN, # ⪖ + SLANTED_EQUAL_TO_OR_LESS_THAN_WITH_DOT_INSIDE, # ⪗ + SLANTED_EQUAL_TO_OR_GREATER_THAN_WITH_DOT_INSIDE, # ⪘ + DOUBLE_LINE_EQUAL_TO_OR_LESS_THAN, # ⪙ + DOUBLE_LINE_EQUAL_TO_OR_GREATER_THAN, # ⪚ + DOUBLE_LINE_SLANTED_EQUAL_TO_OR_LESS_THAN, # ⪛ + DOUBLE_LINE_SLANTED_EQUAL_TO_OR_GREATER_THAN, # ⪜ + SIMILAR_OR_LESS_THAN, # ⪝ + SIMILAR_OR_GREATER_THAN, # ⪞ + SIMILAR_ABOVE_LESS_THAN_ABOVE_EQUALS_SIGN, # ⪟ + SIMILAR_ABOVE_GREATER_THAN_ABOVE_EQUALS_SIGN, # ⪠ + DOUBLE_NESTED_LESS_THAN, # ⪡ + DOUBLE_NESTED_GREATER_THAN, # ⪢ + DOUBLE_NESTED_LESS_THAN_WITH_UNDERBAR, # ⪣ + GREATER_THAN_OVERLAPPING_LESS_THAN, # ⪤ + GREATER_THAN_BESIDE_LESS_THAN, # ⪥ + LESS_THAN_CLOSED_BY_CURVE, # ⪦ + GREATER_THAN_CLOSED_BY_CURVE, # ⪧ + LESS_THAN_CLOSED_BY_CURVE_ABOVE_SLANTED_EQUAL, # ⪨ + GREATER_THAN_CLOSED_BY_CURVE_ABOVE_SLANTED_EQUAL, # ⪩ + SMALLER_THAN, # ⪪ + LARGER_THAN, # ⪫ + SMALLER_THAN_OR_EQUAL_TO, # ⪬ + LARGER_THAN_OR_EQUAL_TO, # ⪭ + EQUALS_SIGN_WITH_BUMPY_ABOVE, # ⪮ + PRECEDES_ABOVE_SINGLE_LINE_EQUALS_SIGN, # ⪯ + SUCCEEDS_ABOVE_SINGLE_LINE_EQUALS_SIGN, # ⪰ + PRECEDES_ABOVE_SINGLE_LINE_NOT_EQUAL_TO, # ⪱ + SUCCEEDS_ABOVE_SINGLE_LINE_NOT_EQUAL_TO, # ⪲ + PRECEDES_ABOVE_EQUALS_SIGN, # ⪳ + SUCCEEDS_ABOVE_EQUALS_SIGN, # ⪴ + PRECEDES_ABOVE_NOT_EQUAL_TO, # ⪵ + SUCCEEDS_ABOVE_NOT_EQUAL_TO, # ⪶ + PRECEDES_ABOVE_ALMOST_EQUAL_TO, # ⪷ + SUCCEEDS_ABOVE_ALMOST_EQUAL_TO, # ⪸ + PRECEDES_ABOVE_NOT_ALMOST_EQUAL_TO, # ⪹ + SUCCEEDS_ABOVE_NOT_ALMOST_EQUAL_TO, # ⪺ + DOUBLE_PRECEDES, # ⪻ + DOUBLE_SUCCEEDS, # ⪼ + SUBSET_WITH_DOT, # ⪽ + SUPERSET_WITH_DOT, # ⪾ + SUBSET_WITH_PLUS_SIGN_BELOW, # ⪿ + SUPERSET_WITH_PLUS_SIGN_BELOW, # ⫀ + SUBSET_WITH_MULTIPLICATION_SIGN_BELOW, # ⫁ + SUPERSET_WITH_MULTIPLICATION_SIGN_BELOW, # ⫂ + SUBSET_OF_OR_EQUAL_TO_WITH_DOT_ABOVE, # ⫃ + SUPERSET_OF_OR_EQUAL_TO_WITH_DOT_ABOVE, # ⫄ + SUBSET_OF_ABOVE_EQUALS_SIGN, # ⫅ + SUPERSET_OF_ABOVE_EQUALS_SIGN, # ⫆ + SUBSET_OF_ABOVE_TILDE_OPERATOR, # ⫇ + SUPERSET_OF_ABOVE_TILDE_OPERATOR, # ⫈ + SUBSET_OF_ABOVE_ALMOST_EQUAL_TO, # ⫉ + SUPERSET_OF_ABOVE_ALMOST_EQUAL_TO, # ⫊ + SUBSET_OF_ABOVE_NOT_EQUAL_TO, # ⫋ + SUPERSET_OF_ABOVE_NOT_EQUAL_TO, # ⫌ + SQUARE_LEFT_OPEN_BOX_OPERATOR, # ⫍ + SQUARE_RIGHT_OPEN_BOX_OPERATOR, # ⫎ + CLOSED_SUBSET, # ⫏ + CLOSED_SUPERSET, # ⫐ + CLOSED_SUBSET_OR_EQUAL_TO, # ⫑ + CLOSED_SUPERSET_OR_EQUAL_TO, # ⫒ + SUBSET_ABOVE_SUPERSET, # ⫓ + SUPERSET_ABOVE_SUBSET, # ⫔ + SUBSET_ABOVE_SUBSET, # ⫕ + SUPERSET_ABOVE_SUPERSET, # ⫖ + SUPERSET_BESIDE_SUBSET, # ⫗ + SUPERSET_BESIDE_AND_JOINED_BY_DASH_WITH_SUBSET, # ⫘ + ELEMENT_OF_OPENING_DOWNWARDS, # ⫙ + TRIPLE_NESTED_LESS_THAN, # ⫷ + TRIPLE_NESTED_GREATER_THAN, # ⫸ + DOUBLE_LINE_SLANTED_LESS_THAN_OR_EQUAL_TO, # ⫹ + DOUBLE_LINE_SLANTED_GREATER_THAN_OR_EQUAL_TO, # ⫺ + RIGHT_TACK, # ⊢ + LEFT_TACK, # ⊣ + PERP, # ⟂ + TOP, # ⫪ + BOT, # ⫫ + end_comparison, - # Level 9 - begin_plus, - EX_OR, # $ - PLUS, # + - MINUS, # - - PLUSPLUS, # ++ - CIRCLED_PLUS, # ⊕ - CIRCLED_MINUS, # ⊖ - SQUARED_PLUS, # ⊞ - SQUARED_MINUS, # ⊟ - OR, # | - UNION, # ∪ - LOGICAL_OR, # ∨ - SQUARE_CUP, # ⊔ - PLUS_MINUS_SIGN, # ± - MINUS_OR_PLUS_SIGN, # ∓ - DOT_PLUS, # ∔ - DOT_MINUS, # ∸ - MINUS_TILDE, # ≂ - DIFFERENCE_BETWEEN, # ≏ - MULTISET_UNION, # ⊎ - XOR, # ⊻ - NOR, # ⊽ - CURLY_LOGICAL_OR, # ⋎ - DOUBLE_UNION, # ⋓ - DOUBLE_PLUS, # ⧺ - TRIPLE_PLUS, # ⧻ - TWO_LOGICAL_OR_OPERATOR, # ⨈ - PLUS_SIGN_WITH_SMALL_CIRCLE_ABOVE, # ⨢ - PLUS_SIGN_WITH_CIRCUMFLEX_ACCENT_ABOVE, # ⨣ - PLUS_SIGN_WITH_TILDE_ABOVE, # ⨤ - PLUS_SIGN_WITH_DOT_BELOW, # ⨥ - PLUS_SIGN_WITH_TILDE_BELOW, # ⨦ - PLUS_SIGN_WITH_SUBSCRIPT_TWO, # ⨧ - PLUS_SIGN_WITH_BLACK_TRIANGLE, # ⨨ - MINUS_SIGN_WITH_COMMA_ABOVE, # ⨩ - MINUS_SIGN_WITH_DOT_BELOW, # ⨪ - MINUS_SIGN_WITH_FALLING_DOTS, # ⨫ - MINUS_SIGN_WITH_RISING_DOTS, # ⨬ - PLUS_SIGN_IN_LEFT_HALF_CIRCLE, # ⨭ - PLUS_SIGN_IN_RIGHT_HALF_CIRCLE, # ⨮ - PLUS_SIGN_IN_TRIANGLE, # ⨹ - MINUS_SIGN_IN_TRIANGLE, # ⨺ - UNION_WITH_MINUS_SIGN, # ⩁ - UNION_WITH_OVERBAR, # ⩂ - UNION_WITH_LOGICAL_OR, # ⩅ - UNION_BESIDE_AND_JOINED_WITH_UNION, # ⩊ - CLOSED_UNION_WITH_SERIFS, # ⩌ - DOUBLE_SQUARE_UNION, # ⩏ - CLOSED_UNION_WITH_SERIFS_AND_SMASH_PRODUCT, # ⩐ - LOGICAL_OR_WITH_DOT_ABOVE, # ⩒ - DOUBLE_LOGICAL_OR, # ⩔ - TWO_INTERSECTING_LOGICAL_OR, # ⩖ - SLOPING_LARGE_OR, # ⩗ - LOGICAL_OR_WITH_MIDDLE_STEM, # ⩛ - LOGICAL_OR_WITH_HORIZONTAL_DASH, # ⩝ - SMALL_VEE_WITH_UNDERBAR, # ⩡ - LOGICAL_OR_WITH_DOUBLE_OVERBAR, # ⩢ - LOGICAL_OR_WITH_DOUBLE_UNDERBAR, # ⩣ - BROKEN_BAR, # ¦ - end_plus, + # Level 7 + begin_pipe, + LPIPE, # |> + RPIPE, # <| + end_pipe, - # Level 10 - begin_bitshifts, - LBITSHIFT, # << - RBITSHIFT, # >> - UNSIGNED_BITSHIFT, # >>> - end_bitshifts, + # Level 8 + begin_colon, + COLON, # : + DDOT, # .. + LDOTS, # … + TRICOLON, # ⁝ + VDOTS, # ⋮ + DDOTS, # ⋱ + ADOTS, # ⋰ + CDOTS, # ⋯ + end_colon, - # Level 11 - begin_times, - STAR, # * - FWD_SLASH, # / - DIVISION_SIGN, # ÷ - REM, # % - UNICODE_DOT, # ⋅ - RING_OPERATOR, # ∘ - MULTIPLICATION_SIGN, # × - BACKSLASH, # \ - AND, # & - INTERSECTION, # ∩ - LOGICAL_AND, # ∧ - CIRCLED_TIMES, # ⊗ - CIRCLED_DIVISION_SLASH, # ⊘ - CIRCLED_DOT_OPERATOR, # ⊙ - CIRCLED_RING_OPERATOR, # ⊚ - CIRCLED_ASTERISK_OPERATOR, # ⊛ - SQUARED_TIMES, # ⊠ - SQUARED_DOT_OPERATOR, # ⊡ - SQUARE_CAP, # ⊓ - ASTERISK_OPERATOR, # ∗ - BULLET_OPERATOR, # ∙ - DOES_NOT_DIVIDE, # ∤ - TURNED_AMPERSAND, # ⅋ - WREATH_PRODUCT, # ≀ - NAND, # ⊼ - DIAMOND_OPERATOR, # ⋄ - STAR_OPERATOR, # ⋆ - DIVISION_TIMES, # ⋇ - LEFT_NORMAL_FACTOR_SEMIDIRECT_PRODUCT, # ⋉ - RIGHT_NORMAL_FACTOR_SEMIDIRECT_PRODUCT, # ⋊ - LEFT_SEMIDIRECT_PRODUCT, # ⋋ - RIGHT_SEMIDIRECT_PRODUCT, # ⋌ - CURLY_LOGICAL_AND, # ⋏ - DOUBLE_INTERSECTION, # ⋒ - AND_WITH_DOT, # ⟑ - CIRCLED_REVERSE_SOLIDUS, # ⦸ - CIRCLED_ANTICLOCKWISE_ROTATED_DIVISION_SIGN, # ⦼ - CIRCLED_WHITE_BULLET, # ⦾ - CIRCLED_BULLET, # ⦿ - SOLIDUS_WITH_OVERBAR, # ⧶ - REVERSE_SOLIDUS_WITH_HORIZONTAL_STROKE, # ⧷ - TWO_LOGICAL_AND_OPERATOR, # ⨇ - MULTIPLICATION_SIGN_WITH_DOT_ABOVE, # ⨰ - MULTIPLICATION_SIGN_WITH_UNDERBAR, # ⨱ - SEMIDIRECT_PRODUCT_WITH_BOTTOM_CLOSED, # ⨲ - SMASH_PRODUCT, # ⨳ - MULTIPLICATION_SIGN_IN_LEFT_HALF_CIRCLE, # ⨴ - MULTIPLICATION_SIGN_IN_RIGHT_HALF_CIRCLE, # ⨵ - CIRCLED_MULTIPLICATION_SIGN_WITH_CIRCUMFLEX_ACCENT, # ⨶ - MULTIPLICATION_SIGN_IN_DOUBLE_CIRCLE, # ⨷ - CIRCLED_DIVISION_SIGN, # ⨸ - MULTIPLICATION_SIGN_IN_TRIANGLE, # ⨻ - INTERIOR_PRODUCT, # ⨼ - RIGHTHAND_INTERIOR_PRODUCT, # ⨽ - INTERSECTION_WITH_DOT, # ⩀ - INTERSECTION_WITH_OVERBAR, # ⩃ - INTERSECTION_WITH_LOGICAL_AND, # ⩄ - INTERSECTION_BESIDE_AND_JOINED_WITH_INTERSECTION, # ⩋ - CLOSED_INTERSECTION_WITH_SERIFS, # ⩍ - DOUBLE_SQUARE_INTERSECTION, # ⩎ - LOGICAL_AND_WITH_DOT_ABOVE, # ⩑ - DOUBLE_LOGICAL_AND, # ⩓ - TWO_INTERSECTING_LOGICAL_AND, # ⩕ - SLOPING_LARGE_AND, # ⩘ - LOGICAL_AND_WITH_MIDDLE_STEM, # ⩚ - LOGICAL_AND_WITH_HORIZONTAL_DASH, # ⩜ - LOGICAL_AND_WITH_DOUBLE_OVERBAR, # ⩞ - LOGICAL_AND_WITH_UNDERBAR, # ⩟ - LOGICAL_AND_WITH_DOUBLE_UNDERBAR, # ⩠ - TRANSVERSAL_INTERSECTION, # ⫛ - MULTISET_MULTIPLICATION, # ⊍ - WHITE_RIGHT_POINTING_TRIANGLE, # ▷ - JOIN, # ⨝ - LEFT_OUTER_JOIN, # ⟕ - RIGHT_OUTER_JOIN, # ⟖ - FULL_OUTER_JOIN, # ⟗ - NOT_SLASH, # ⌿ - BB_SEMI, # ⨟ - end_times, + # Level 9 + begin_plus, + EX_OR, # $ + PLUS, # + + MINUS, # - + PLUSPLUS, # ++ + CIRCLED_PLUS, # ⊕ + CIRCLED_MINUS, # ⊖ + SQUARED_PLUS, # ⊞ + SQUARED_MINUS, # ⊟ + OR, # | + UNION, # ∪ + LOGICAL_OR, # ∨ + SQUARE_CUP, # ⊔ + PLUS_MINUS_SIGN, # ± + MINUS_OR_PLUS_SIGN, # ∓ + DOT_PLUS, # ∔ + DOT_MINUS, # ∸ + MINUS_TILDE, # ≂ + DIFFERENCE_BETWEEN, # ≏ + MULTISET_UNION, # ⊎ + XOR, # ⊻ + NOR, # ⊽ + CURLY_LOGICAL_OR, # ⋎ + DOUBLE_UNION, # ⋓ + DOUBLE_PLUS, # ⧺ + TRIPLE_PLUS, # ⧻ + TWO_LOGICAL_OR_OPERATOR, # ⨈ + PLUS_SIGN_WITH_SMALL_CIRCLE_ABOVE, # ⨢ + PLUS_SIGN_WITH_CIRCUMFLEX_ACCENT_ABOVE, # ⨣ + PLUS_SIGN_WITH_TILDE_ABOVE, # ⨤ + PLUS_SIGN_WITH_DOT_BELOW, # ⨥ + PLUS_SIGN_WITH_TILDE_BELOW, # ⨦ + PLUS_SIGN_WITH_SUBSCRIPT_TWO, # ⨧ + PLUS_SIGN_WITH_BLACK_TRIANGLE, # ⨨ + MINUS_SIGN_WITH_COMMA_ABOVE, # ⨩ + MINUS_SIGN_WITH_DOT_BELOW, # ⨪ + MINUS_SIGN_WITH_FALLING_DOTS, # ⨫ + MINUS_SIGN_WITH_RISING_DOTS, # ⨬ + PLUS_SIGN_IN_LEFT_HALF_CIRCLE, # ⨭ + PLUS_SIGN_IN_RIGHT_HALF_CIRCLE, # ⨮ + PLUS_SIGN_IN_TRIANGLE, # ⨹ + MINUS_SIGN_IN_TRIANGLE, # ⨺ + UNION_WITH_MINUS_SIGN, # ⩁ + UNION_WITH_OVERBAR, # ⩂ + UNION_WITH_LOGICAL_OR, # ⩅ + UNION_BESIDE_AND_JOINED_WITH_UNION, # ⩊ + CLOSED_UNION_WITH_SERIFS, # ⩌ + DOUBLE_SQUARE_UNION, # ⩏ + CLOSED_UNION_WITH_SERIFS_AND_SMASH_PRODUCT, # ⩐ + LOGICAL_OR_WITH_DOT_ABOVE, # ⩒ + DOUBLE_LOGICAL_OR, # ⩔ + TWO_INTERSECTING_LOGICAL_OR, # ⩖ + SLOPING_LARGE_OR, # ⩗ + LOGICAL_OR_WITH_MIDDLE_STEM, # ⩛ + LOGICAL_OR_WITH_HORIZONTAL_DASH, # ⩝ + SMALL_VEE_WITH_UNDERBAR, # ⩡ + LOGICAL_OR_WITH_DOUBLE_OVERBAR, # ⩢ + LOGICAL_OR_WITH_DOUBLE_UNDERBAR, # ⩣ + BROKEN_BAR, # ¦ + end_plus, - # Level 12 - begin_rational, - FWDFWD_SLASH, # // - end_rational, + # Level 10 + begin_bitshifts, + LBITSHIFT, # << + RBITSHIFT, # >> + UNSIGNED_BITSHIFT, # >>> + end_bitshifts, - # Level 13 - begin_power, - CIRCUMFLEX_ACCENT, # ^ - UPWARDS_ARROW, # ↑ - DOWNWARDS_ARROW, # ↓ - DOWNWARDS_ARROW_LEFTWARDS_OF_UPWARDS_ARROW, # ⇵ - UPWARDS_QUADRUPLE_ARROW, # ⟰ - DOWNWARDS_QUADRUPLE_ARROW, # ⟱ - DOWNWARDS_ARROW_WITH_HORIZONTAL_STROKE, # ⤈ - UPWARDS_ARROW_WITH_HORIZONTAL_STROKE, # ⤉ - UPWARDS_TRIPLE_ARROW, # ⤊ - DOWNWARDS_TRIPLE_ARROW, # ⤋ - UPWARDS_ARROW_TO_BAR, # ⤒ - DOWNWARDS_ARROW_TO_BAR, # ⤓ - UPWARDS_TWO_HEADED_ARROW_FROM_SMALL_CIRCLE, # ⥉ - UP_BARB_RIGHT_DOWN_BARB_LEFT_HARPOON, # ⥌ - UP_BARB_LEFT_DOWN_BARB_RIGHT_HARPOON, # ⥍ - UP_BARB_RIGHT_DOWN_BARB_RIGHT_HARPOON, # ⥏ - UP_BARB_LEFT_DOWN_BARB_LEFT_HARPOON, # ⥑ - UPWARDS_HARPOON_WITH_BARB_RIGHT_TO_BAR, # ⥔ - DOWNWARDS_HARPOON_WITH_BARB_RIGHT_TO_BAR, # ⥕ - UPWARDS_HARPOON_WITH_BARB_LEFT_TO_BAR, # ⥘ - DOWNWARDS_HARPOON_WITH_BARB_LEFT_TO_BAR, # ⥙ - UPWARDS_HARPOON_WITH_BARB_RIGHT_FROM_BAR, # ⥜ - DOWNWARDS_HARPOON_WITH_BARB_RIGHT_FROM_BAR, # ⥝ - UPWARDS_HARPOON_WITH_BARB_LEFT_FROM_BAR, # ⥠ - DOWNWARDS_HARPOON_WITH_BARB_LEFT_FROM_BAR, # ⥡ - UPWARDS_HARPOON_WITH_BARB_LEFT_BESIDE_UPWARDS_HARPOON_WITH_BARB_RIGHT, # ⥣ - DOWNWARDS_HARPOON_WITH_BARB_LEFT_BESIDE_DOWNWARDS_HARPOON_WITH_BARB_RIGHT, # ⥥ - UPWARDS_HARPOON_WITH_BARB_LEFT_BESIDE_DOWNWARDS_HARPOON_WITH_BARB_RIGHT, # ⥮ - DOWNWARDS_HARPOON_WITH_BARB_LEFT_BESIDE_UPWARDS_HARPOON_WITH_BARB_RIGHT, # ⥯ - HALFWIDTH_UPWARDS_ARROW, # ↑ - HALFWIDTH_DOWNWARDS_ARROW, # ↓ - end_power, + # Level 11 + begin_times, + STAR, # * + FWD_SLASH, # / + DIVISION_SIGN, # ÷ + REM, # % + UNICODE_DOT, # ⋅ + RING_OPERATOR, # ∘ + MULTIPLICATION_SIGN, # × + BACKSLASH, # \ + AND, # & + INTERSECTION, # ∩ + LOGICAL_AND, # ∧ + CIRCLED_TIMES, # ⊗ + CIRCLED_DIVISION_SLASH, # ⊘ + CIRCLED_DOT_OPERATOR, # ⊙ + CIRCLED_RING_OPERATOR, # ⊚ + CIRCLED_ASTERISK_OPERATOR, # ⊛ + SQUARED_TIMES, # ⊠ + SQUARED_DOT_OPERATOR, # ⊡ + SQUARE_CAP, # ⊓ + ASTERISK_OPERATOR, # ∗ + BULLET_OPERATOR, # ∙ + DOES_NOT_DIVIDE, # ∤ + TURNED_AMPERSAND, # ⅋ + WREATH_PRODUCT, # ≀ + NAND, # ⊼ + DIAMOND_OPERATOR, # ⋄ + STAR_OPERATOR, # ⋆ + DIVISION_TIMES, # ⋇ + LEFT_NORMAL_FACTOR_SEMIDIRECT_PRODUCT, # ⋉ + RIGHT_NORMAL_FACTOR_SEMIDIRECT_PRODUCT, # ⋊ + LEFT_SEMIDIRECT_PRODUCT, # ⋋ + RIGHT_SEMIDIRECT_PRODUCT, # ⋌ + CURLY_LOGICAL_AND, # ⋏ + DOUBLE_INTERSECTION, # ⋒ + AND_WITH_DOT, # ⟑ + CIRCLED_REVERSE_SOLIDUS, # ⦸ + CIRCLED_ANTICLOCKWISE_ROTATED_DIVISION_SIGN, # ⦼ + CIRCLED_WHITE_BULLET, # ⦾ + CIRCLED_BULLET, # ⦿ + SOLIDUS_WITH_OVERBAR, # ⧶ + REVERSE_SOLIDUS_WITH_HORIZONTAL_STROKE, # ⧷ + TWO_LOGICAL_AND_OPERATOR, # ⨇ + MULTIPLICATION_SIGN_WITH_DOT_ABOVE, # ⨰ + MULTIPLICATION_SIGN_WITH_UNDERBAR, # ⨱ + SEMIDIRECT_PRODUCT_WITH_BOTTOM_CLOSED, # ⨲ + SMASH_PRODUCT, # ⨳ + MULTIPLICATION_SIGN_IN_LEFT_HALF_CIRCLE, # ⨴ + MULTIPLICATION_SIGN_IN_RIGHT_HALF_CIRCLE, # ⨵ + CIRCLED_MULTIPLICATION_SIGN_WITH_CIRCUMFLEX_ACCENT, # ⨶ + MULTIPLICATION_SIGN_IN_DOUBLE_CIRCLE, # ⨷ + CIRCLED_DIVISION_SIGN, # ⨸ + MULTIPLICATION_SIGN_IN_TRIANGLE, # ⨻ + INTERIOR_PRODUCT, # ⨼ + RIGHTHAND_INTERIOR_PRODUCT, # ⨽ + INTERSECTION_WITH_DOT, # ⩀ + INTERSECTION_WITH_OVERBAR, # ⩃ + INTERSECTION_WITH_LOGICAL_AND, # ⩄ + INTERSECTION_BESIDE_AND_JOINED_WITH_INTERSECTION, # ⩋ + CLOSED_INTERSECTION_WITH_SERIFS, # ⩍ + DOUBLE_SQUARE_INTERSECTION, # ⩎ + LOGICAL_AND_WITH_DOT_ABOVE, # ⩑ + DOUBLE_LOGICAL_AND, # ⩓ + TWO_INTERSECTING_LOGICAL_AND, # ⩕ + SLOPING_LARGE_AND, # ⩘ + LOGICAL_AND_WITH_MIDDLE_STEM, # ⩚ + LOGICAL_AND_WITH_HORIZONTAL_DASH, # ⩜ + LOGICAL_AND_WITH_DOUBLE_OVERBAR, # ⩞ + LOGICAL_AND_WITH_UNDERBAR, # ⩟ + LOGICAL_AND_WITH_DOUBLE_UNDERBAR, # ⩠ + TRANSVERSAL_INTERSECTION, # ⫛ + MULTISET_MULTIPLICATION, # ⊍ + WHITE_RIGHT_POINTING_TRIANGLE, # ▷ + JOIN, # ⨝ + LEFT_OUTER_JOIN, # ⟕ + RIGHT_OUTER_JOIN, # ⟖ + FULL_OUTER_JOIN, # ⟗ + NOT_SLASH, # ⌿ + BB_SEMI, # ⨟ + end_times, - # Level 14 - begin_decl, - DECLARATION, # :: - end_decl, + # Level 12 + begin_rational, + FWDFWD_SLASH, # // + end_rational, - # Level 15 - begin_where, - WHERE, - end_where, + # Level 13 + begin_power, + CIRCUMFLEX_ACCENT, # ^ + UPWARDS_ARROW, # ↑ + DOWNWARDS_ARROW, # ↓ + DOWNWARDS_ARROW_LEFTWARDS_OF_UPWARDS_ARROW, # ⇵ + UPWARDS_QUADRUPLE_ARROW, # ⟰ + DOWNWARDS_QUADRUPLE_ARROW, # ⟱ + DOWNWARDS_ARROW_WITH_HORIZONTAL_STROKE, # ⤈ + UPWARDS_ARROW_WITH_HORIZONTAL_STROKE, # ⤉ + UPWARDS_TRIPLE_ARROW, # ⤊ + DOWNWARDS_TRIPLE_ARROW, # ⤋ + UPWARDS_ARROW_TO_BAR, # ⤒ + DOWNWARDS_ARROW_TO_BAR, # ⤓ + UPWARDS_TWO_HEADED_ARROW_FROM_SMALL_CIRCLE, # ⥉ + UP_BARB_RIGHT_DOWN_BARB_LEFT_HARPOON, # ⥌ + UP_BARB_LEFT_DOWN_BARB_RIGHT_HARPOON, # ⥍ + UP_BARB_RIGHT_DOWN_BARB_RIGHT_HARPOON, # ⥏ + UP_BARB_LEFT_DOWN_BARB_LEFT_HARPOON, # ⥑ + UPWARDS_HARPOON_WITH_BARB_RIGHT_TO_BAR, # ⥔ + DOWNWARDS_HARPOON_WITH_BARB_RIGHT_TO_BAR, # ⥕ + UPWARDS_HARPOON_WITH_BARB_LEFT_TO_BAR, # ⥘ + DOWNWARDS_HARPOON_WITH_BARB_LEFT_TO_BAR, # ⥙ + UPWARDS_HARPOON_WITH_BARB_RIGHT_FROM_BAR, # ⥜ + DOWNWARDS_HARPOON_WITH_BARB_RIGHT_FROM_BAR, # ⥝ + UPWARDS_HARPOON_WITH_BARB_LEFT_FROM_BAR, # ⥠ + DOWNWARDS_HARPOON_WITH_BARB_LEFT_FROM_BAR, # ⥡ + UPWARDS_HARPOON_WITH_BARB_LEFT_BESIDE_UPWARDS_HARPOON_WITH_BARB_RIGHT, # ⥣ + DOWNWARDS_HARPOON_WITH_BARB_LEFT_BESIDE_DOWNWARDS_HARPOON_WITH_BARB_RIGHT, # ⥥ + UPWARDS_HARPOON_WITH_BARB_LEFT_BESIDE_DOWNWARDS_HARPOON_WITH_BARB_RIGHT, # ⥮ + DOWNWARDS_HARPOON_WITH_BARB_LEFT_BESIDE_UPWARDS_HARPOON_WITH_BARB_RIGHT, # ⥯ + HALFWIDTH_UPWARDS_ARROW, # ↑ + HALFWIDTH_DOWNWARDS_ARROW, # ↓ + end_power, - # Level 16 - begin_dot, - DOT,# . - end_dot, + # Level 14 + begin_decl, + DECLARATION, # :: + end_decl, - NOT, # ! - PRIME, # ' - TRANSPOSE, # .' - ANON_FUNC, # -> + # Level 15 + begin_where, + WHERE, + end_where, - begin_unicode_ops, - NOT_SIGN, # ¬ - SQUARE_ROOT, # √ - CUBE_ROOT, # ∛ - QUAD_ROOT, # ∜ - end_unicode_ops, + # Level 16 + begin_dot, + DOT,# . + end_dot, NOT, # ! + PRIME, # ' + TRANSPOSE, # .' + ANON_FUNC, # -> + begin_unicode_ops, + NOT_SIGN, # ¬ + SQUARE_ROOT, # √ + CUBE_ROOT, # ∛ + QUAD_ROOT, # ∜ + end_unicode_ops, end_ops, ) -const UNICODE_OPS = Dict{Char, Kind}( -'÷' => DIVISION_SIGN, -'¬' => NOT_SIGN, -'√' => SQUARE_ROOT, -'∛' => CUBE_ROOT, -'∜' => QUAD_ROOT, -'←' => LEFTWARDS_ARROW, -'→' => RIGHTWARDS_ARROW, -'↔' => LEFT_RIGHT_ARROW, -'↚' => LEFTWARDS_ARROW_WITH_STROKE, -'↛' => RIGHTWARDS_ARROW_WITH_STROKE, -'↞' => LEFTWARDS_TWO_HEADED_ARROW, -'↠' => RIGHTWARDS_TWO_HEADED_ARROW, -'↢' => LEFTWARDS_ARROW_WITH_TAIL, -'↣' => RIGHTWARDS_ARROW_WITH_TAIL, -'↤' => LEFTWARDS_ARROW_FROM_BAR, -'↦' => RIGHTWARDS_ARROW_FROM_BAR, -'↮' => LEFT_RIGHT_ARROW_WITH_STROKE, -'⇎' => LEFT_RIGHT_DOUBLE_ARROW_WITH_STROKE, -'⇍' => LEFTWARDS_DOUBLE_ARROW_WITH_STROKE, -'⇏' => RIGHTWARDS_DOUBLE_ARROW_WITH_STROKE, -'⇐' => LEFTWARDS_DOUBLE_ARROW, -'⇒' => RIGHTWARDS_DOUBLE_ARROW, -'⇔' => LEFT_RIGHT_DOUBLE_ARROW, -'⇴' => RIGHT_ARROW_WITH_SMALL_CIRCLE, -'⇶' => THREE_RIGHTWARDS_ARROWS, -'⇷' => LEFTWARDS_ARROW_WITH_VERTICAL_STROKE, -'⇸' => RIGHTWARDS_ARROW_WITH_VERTICAL_STROKE, -'⇹' => LEFT_RIGHT_ARROW_WITH_VERTICAL_STROKE, -'⇺' => LEFTWARDS_ARROW_WITH_DOUBLE_VERTICAL_STROKE, -'⇻' => RIGHTWARDS_ARROW_WITH_DOUBLE_VERTICAL_STROKE, -'⇼' => LEFT_RIGHT_ARROW_WITH_DOUBLE_VERTICAL_STROKE, -'⇽' => LEFTWARDS_OPEN_HEADED_ARROW, -'⇾' => RIGHTWARDS_OPEN_HEADED_ARROW, -'⇿' => LEFT_RIGHT_OPEN_HEADED_ARROW, -'⟵' => LONG_LEFTWARDS_ARROW, -'⟶' => LONG_RIGHTWARDS_ARROW, -'⟷' => LONG_LEFT_RIGHT_ARROW, -'⟹' => LONG_RIGHTWARDS_DOUBLE_ARROW, -'⟺' => LONG_LEFT_RIGHT_DOUBLE_ARROW, -'⟻' => LONG_LEFTWARDS_ARROW_FROM_BAR, -'⟼' => LONG_RIGHTWARDS_ARROW_FROM_BAR, -'⟽' => LONG_LEFTWARDS_DOUBLE_ARROW_FROM_BAR, -'⟾' => LONG_RIGHTWARDS_DOUBLE_ARROW_FROM_BAR, -'⟿' => LONG_RIGHTWARDS_SQUIGGLE_ARROW, -'⤀' => RIGHTWARDS_TWO_HEADED_ARROW_WITH_VERTICAL_STROKE, -'⤁' => RIGHTWARDS_TWO_HEADED_ARROW_WITH_DOUBLE_VERTICAL_STROKE, -'⤂' => LEFTWARDS_DOUBLE_ARROW_WITH_VERTICAL_STROKE, -'⤃' => RIGHTWARDS_DOUBLE_ARROW_WITH_VERTICAL_STROKE, -'⤄' => LEFT_RIGHT_DOUBLE_ARROW_WITH_VERTICAL_STROKE, -'⤅' => RIGHTWARDS_TWO_HEADED_ARROW_FROM_BAR, -'⤆' => LEFTWARDS_DOUBLE_ARROW_FROM_BAR, -'⤇' => RIGHTWARDS_DOUBLE_ARROW_FROM_BAR, -'⤌' => LEFTWARDS_DOUBLE_DASH_ARROW, -'⤍' => RIGHTWARDS_DOUBLE_DASH_ARROW, -'⤎' => LEFTWARDS_TRIPLE_DASH_ARROW, -'⤏' => RIGHTWARDS_TRIPLE_DASH_ARROW, -'⤐' => RIGHTWARDS_TWO_HEADED_TRIPLE_DASH_ARROW, -'⤑' => RIGHTWARDS_ARROW_WITH_DOTTED_STEM, -'⤔' => RIGHTWARDS_ARROW_WITH_TAIL_WITH_VERTICAL_STROKE, -'⤕' => RIGHTWARDS_ARROW_WITH_TAIL_WITH_DOUBLE_VERTICAL_STROKE, -'⤖' => RIGHTWARDS_TWO_HEADED_ARROW_WITH_TAIL, -'⤗' => RIGHTWARDS_TWO_HEADED_ARROW_WITH_TAIL_WITH_VERTICAL_STROKE, -'⤘' => RIGHTWARDS_TWO_HEADED_ARROW_WITH_TAIL_WITH_DOUBLE_VERTICAL_STROKE, -'⤝' => LEFTWARDS_ARROW_TO_BLACK_DIAMOND, -'⤞' => RIGHTWARDS_ARROW_TO_BLACK_DIAMOND, -'⤟' => LEFTWARDS_ARROW_FROM_BAR_TO_BLACK_DIAMOND, -'⤠' => RIGHTWARDS_ARROW_FROM_BAR_TO_BLACK_DIAMOND, -'⥄' => SHORT_RIGHTWARDS_ARROW_ABOVE_LEFTWARDS_ARROW, -'⥅' => RIGHTWARDS_ARROW_WITH_PLUS_BELOW, -'⥆' => LEFTWARDS_ARROW_WITH_PLUS_BELOW, -'⥇' => RIGHTWARDS_ARROW_THROUGH_X, -'⥈' => LEFT_RIGHT_ARROW_THROUGH_SMALL_CIRCLE, -'⥊' => LEFT_BARB_UP_RIGHT_BARB_DOWN_HARPOON, -'⥋' => LEFT_BARB_DOWN_RIGHT_BARB_UP_HARPOON, -'⥎' => LEFT_BARB_UP_RIGHT_BARB_UP_HARPOON, -'⥐' => LEFT_BARB_DOWN_RIGHT_BARB_DOWN_HARPOON, -'⥒' => LEFTWARDS_HARPOON_WITH_BARB_UP_TO_BAR, -'⥓' => RIGHTWARDS_HARPOON_WITH_BARB_UP_TO_BAR, -'⥖' => LEFTWARDS_HARPOON_WITH_BARB_DOWN_TO_BAR, -'⥗' => RIGHTWARDS_HARPOON_WITH_BARB_DOWN_TO_BAR, -'⥚' => LEFTWARDS_HARPOON_WITH_BARB_UP_FROM_BAR, -'⥛' => RIGHTWARDS_HARPOON_WITH_BARB_UP_FROM_BAR, -'⥞' => LEFTWARDS_HARPOON_WITH_BARB_DOWN_FROM_BAR, -'⥟' => RIGHTWARDS_HARPOON_WITH_BARB_DOWN_FROM_BAR, -'⥢' => LEFTWARDS_HARPOON_WITH_BARB_UP_ABOVE_LEFTWARDS_HARPOON_WITH_BARB_DOWN, -'⥤' => RIGHTWARDS_HARPOON_WITH_BARB_UP_ABOVE_RIGHTWARDS_HARPOON_WITH_BARB_DOWN, -'⥦' => LEFTWARDS_HARPOON_WITH_BARB_UP_ABOVE_RIGHTWARDS_HARPOON_WITH_BARB_UP, -'⥧' => LEFTWARDS_HARPOON_WITH_BARB_DOWN_ABOVE_RIGHTWARDS_HARPOON_WITH_BARB_DOWN, -'⥨' => RIGHTWARDS_HARPOON_WITH_BARB_UP_ABOVE_LEFTWARDS_HARPOON_WITH_BARB_UP, -'⥩' => RIGHTWARDS_HARPOON_WITH_BARB_DOWN_ABOVE_LEFTWARDS_HARPOON_WITH_BARB_DOWN, -'⥪' => LEFTWARDS_HARPOON_WITH_BARB_UP_ABOVE_LONG_DASH, -'⥫' => LEFTWARDS_HARPOON_WITH_BARB_DOWN_BELOW_LONG_DASH, -'⥬' => RIGHTWARDS_HARPOON_WITH_BARB_UP_ABOVE_LONG_DASH, -'⥭' => RIGHTWARDS_HARPOON_WITH_BARB_DOWN_BELOW_LONG_DASH, -'⥰' => RIGHT_DOUBLE_ARROW_WITH_ROUNDED_HEAD, -'⧴' => RULE_DELAYED, -'⬱' => THREE_LEFTWARDS_ARROWS, -'⬰' => LEFT_ARROW_WITH_SMALL_CIRCLE, -'⬲' => LEFT_ARROW_WITH_CIRCLED_PLUS, -'⬳' => LONG_LEFTWARDS_SQUIGGLE_ARROW, -'⬴' => LEFTWARDS_TWO_HEADED_ARROW_WITH_VERTICAL_STROKE, -'⬵' => LEFTWARDS_TWO_HEADED_ARROW_WITH_DOUBLE_VERTICAL_STROKE, -'⬶' => LEFTWARDS_TWO_HEADED_ARROW_FROM_BAR, -'⬷' => LEFTWARDS_TWO_HEADED_TRIPLE_DASH_ARROW, -'⬸' => LEFTWARDS_ARROW_WITH_DOTTED_STEM, -'⬹' => LEFTWARDS_ARROW_WITH_TAIL_WITH_VERTICAL_STROKE, -'⬺' => LEFTWARDS_ARROW_WITH_TAIL_WITH_DOUBLE_VERTICAL_STROKE, -'⬻' => LEFTWARDS_TWO_HEADED_ARROW_WITH_TAIL, -'⬼' => LEFTWARDS_TWO_HEADED_ARROW_WITH_TAIL_WITH_VERTICAL_STROKE, -'⬽' => LEFTWARDS_TWO_HEADED_ARROW_WITH_TAIL_WITH_DOUBLE_VERTICAL_STROKE, -'⬾' => LEFTWARDS_ARROW_THROUGH_X, -'⬿' => WAVE_ARROW_POINTING_DIRECTLY_LEFT, -'⭀' => EQUALS_SIGN_ABOVE_LEFTWARDS_ARROW, -'⭁' => REVERSE_TILDE_OPERATOR_ABOVE_LEFTWARDS_ARROW, -'⭂' => LEFTWARDS_ARROW_ABOVE_REVERSE_ALMOST_EQUAL_TO, -'⭃' => RIGHTWARDS_ARROW_THROUGH_GREATER_THAN, -'⭄' => RIGHTWARDS_ARROW_THROUGH_SUPERSET, -'⭇' => REVERSE_TILDE_OPERATOR_ABOVE_RIGHTWARDS_ARROW, -'⭈' => RIGHTWARDS_ARROW_ABOVE_REVERSE_ALMOST_EQUAL_TO, -'⭉' => TILDE_OPERATOR_ABOVE_LEFTWARDS_ARROW, -'⭊' => LEFTWARDS_ARROW_ABOVE_ALMOST_EQUAL_TO, -'⭋' => LEFTWARDS_ARROW_ABOVE_REVERSE_TILDE_OPERATOR, -'⭌' => RIGHTWARDS_ARROW_ABOVE_REVERSE_TILDE_OPERATOR, -'←' => HALFWIDTH_LEFTWARDS_ARROW, -'→' => HALFWIDTH_RIGHTWARDS_ARROW, -'≥' => GREATER_THAN_OR_EQUAL_TO, -'≤' => LESS_THAN_OR_EQUAL_TO, -'≡' => IDENTICAL_TO, -'≠' => NOT_EQUAL_TO, -'≢' => NOT_IDENTICAL_TO, -'∈' => ELEMENT_OF, -'∉' => NOT_AN_ELEMENT_OF, -'∋' => CONTAINS_AS_MEMBER, -'∌' => DOES_NOT_CONTAIN_AS_MEMBER, -'⊆' => SUBSET_OF_OR_EQUAL_TO, -'⊈' => NEITHER_A_SUBSET_OF_NOR_EQUAL_TO, -'⊂' => SUBSET_OF, -'⊄' => NOT_A_SUBSET_OF, -'⊊' => SUBSET_OF_WITH_NOT_EQUAL_TO, -'∝' => PROPORTIONAL_TO, -'∊' => SMALL_ELEMENT_OF, -'∍' => SMALL_CONTAINS_AS_MEMBER, -'∥' => PARALLEL_TO, -'∦' => NOT_PARALLEL_TO, -'∷' => PROPORTION, -'∺' => GEOMETRIC_PROPORTION, -'∻' => HOMOTHETIC, -'∽' => REVERSED_TILDE, -'∾' => INVERTED_LAZY_S, -'≁' => NOT_TILDE, -'≃' => ASYMPTOTICALLY_EQUAL_TO, -'≄' => NOT_ASYMPTOTICALLY_EQUAL_TO, -'≅' => APPROXIMATELY_EQUAL_TO, -'≆' => APPROXIMATELY_BUT_NOT_ACTUALLY_EQUAL_TO, -'≇' => NEITHER_APPROXIMATELY_NOR_ACTUALLY_EQUAL_TO, -'≈' => ALMOST_EQUAL_TO, -'≉' => NOT_ALMOST_EQUAL_TO, -'≊' => ALMOST_EQUAL_OR_EQUAL_TO, -'≋' => TRIPLE_TILDE, -'≌' => ALL_EQUAL_TO, -'≍' => EQUIVALENT_TO, -'≎' => GEOMETRICALLY_EQUIVALENT_TO, -'≐' => APPROACHES_THE_LIMIT, -'≑' => GEOMETRICALLY_EQUAL_TO, -'≒' => APPROXIMATELY_EQUAL_TO_OR_THE_IMAGE_OF, -'≓' => IMAGE_OF_OR_APPROXIMATELY_EQUAL_TO, -'≔' => COLON_EQUALS, -'≕' => EQUALS_COLON, -'≖' => RING_IN_EQUAL_TO, -'≗' => RING_EQUAL_TO, -'≘' => CORRESPONDS_TO, -'≙' => ESTIMATES, -'≚' => EQUIANGULAR_TO, -'≛' => STAR_EQUALS, -'≜' => DELTA_EQUAL_TO, -'≝' => EQUAL_TO_BY_DEFINITION, -'≞' => MEASURED_BY, -'≟' => QUESTIONED_EQUAL_TO, -'≣' => STRICTLY_EQUIVALENT_TO, -'≦' => LESS_THAN_OVER_EQUAL_TO, -'≧' => GREATER_THAN_OVER_EQUAL_TO, -'≨' => LESS_THAN_BUT_NOT_EQUAL_TO, -'≩' => GREATER_THAN_BUT_NOT_EQUAL_TO, -'≪' => MUCH_LESS_THAN, -'≫' => MUCH_GREATER_THAN, -'≬' => BETWEEN, -'≭' => NOT_EQUIVALENT_TO, -'≮' => NOT_LESS_THAN, -'≯' => NOT_GREATER_THAN, -'≰' => NEITHER_LESS_THAN_NOR_EQUAL_TO, -'≱' => NEITHER_GREATER_THAN_NOR_EQUAL_TO, -'≲' => LESS_THAN_OR_EQUIVALENT_TO, -'≳' => GREATER_THAN_OR_EQUIVALENT_TO, -'≴' => NEITHER_LESS_THAN_NOR_EQUIVALENT_TO, -'≵' => NEITHER_GREATER_THAN_NOR_EQUIVALENT_TO, -'≶' => LESS_THAN_OR_GREATER_THAN, -'≷' => GREATER_THAN_OR_LESS_THAN, -'≸' => NEITHER_LESS_THAN_NOR_GREATER_THAN, -'≹' => NEITHER_GREATER_THAN_NOR_LESS_THAN, -'≺' => PRECEDES, -'≻' => SUCCEEDS, -'≼' => PRECEDES_OR_EQUAL_TO, -'≽' => SUCCEEDS_OR_EQUAL_TO, -'≾' => PRECEDES_OR_EQUIVALENT_TO, -'≿' => SUCCEEDS_OR_EQUIVALENT_TO, -'⊀' => DOES_NOT_PRECEDE, -'⊁' => DOES_NOT_SUCCEED, -'⊃' => SUPERSET_OF, -'⊅' => NOT_A_SUPERSET_OF, -'⊇' => SUPERSET_OF_OR_EQUAL_TO, -'⊉' => NEITHER_A_SUPERSET_OF_NOR_EQUAL_TO, -'⊋' => SUPERSET_OF_WITH_NOT_EQUAL_TO, -'⊏' => SQUARE_IMAGE_OF, -'⊐' => SQUARE_ORIGINAL_OF, -'⊑' => SQUARE_IMAGE_OF_OR_EQUAL_TO, -'⊒' => SQUARE_ORIGINAL_OF_OR_EQUAL_TO, -'⊜' => CIRCLED_EQUALS, -'⊩' => FORCES, -'⊬' => DOES_NOT_PROVE, -'⊮' => DOES_NOT_FORCE, -'⊰' => PRECEDES_UNDER_RELATION, -'⊱' => SUCCEEDS_UNDER_RELATION, -'⊲' => NORMAL_SUBGROUP_OF, -'⊳' => CONTAINS_AS_NORMAL_SUBGROUP, -'⊴' => NORMAL_SUBGROUP_OF_OR_EQUAL_TO, -'⊵' => CONTAINS_AS_NORMAL_SUBGROUP_OR_EQUAL_TO, -'⊶' => ORIGINAL_OF, -'⊷' => IMAGE_OF, -'⋍' => REVERSED_TILDE_EQUALS, -'⋐' => DOUBLE_SUBSET, -'⋑' => DOUBLE_SUPERSET, -'⋕' => EQUAL_AND_PARALLEL_TO, -'⋖' => LESS_THAN_WITH_DOT, -'⋗' => GREATER_THAN_WITH_DOT, -'⋘' => VERY_MUCH_LESS_THAN, -'⋙' => VERY_MUCH_GREATER_THAN, -'⋚' => LESS_THAN_EQUAL_TO_OR_GREATER_THAN, -'⋛' => GREATER_THAN_EQUAL_TO_OR_LESS_THAN, -'⋜' => EQUAL_TO_OR_LESS_THAN, -'⋝' => EQUAL_TO_OR_GREATER_THAN, -'⋞' => EQUAL_TO_OR_PRECEDES, -'⋟' => EQUAL_TO_OR_SUCCEEDS, -'⋠' => DOES_NOT_PRECEDE_OR_EQUAL, -'⋡' => DOES_NOT_SUCCEED_OR_EQUAL, -'⋢' => NOT_SQUARE_IMAGE_OF_OR_EQUAL_TO, -'⋣' => NOT_SQUARE_ORIGINAL_OF_OR_EQUAL_TO, -'⋤' => SQUARE_IMAGE_OF_OR_NOT_EQUAL_TO, -'⋥' => SQUARE_ORIGINAL_OF_OR_NOT_EQUAL_TO, -'⋦' => LESS_THAN_BUT_NOT_EQUIVALENT_TO, -'⋧' => GREATER_THAN_BUT_NOT_EQUIVALENT_TO, -'⋨' => PRECEDES_BUT_NOT_EQUIVALENT_TO, -'⋩' => SUCCEEDS_BUT_NOT_EQUIVALENT_TO, -'⋪' => NOT_NORMAL_SUBGROUP_OF, -'⋫' => DOES_NOT_CONTAIN_AS_NORMAL_SUBGROUP, -'⋬' => NOT_NORMAL_SUBGROUP_OF_OR_EQUAL_TO, -'⋭' => DOES_NOT_CONTAIN_AS_NORMAL_SUBGROUP_OR_EQUAL, -'⋲' => ELEMENT_OF_WITH_LONG_HORIZONTAL_STROKE, -'⋳' => ELEMENT_OF_WITH_VERTICAL_BAR_AT_END_OF_HORIZONTAL_STROKE, -'⋴' => SMALL_ELEMENT_OF_WITH_VERTICAL_BAR_AT_END_OF_HORIZONTAL_STROKE, -'⋵' => ELEMENT_OF_WITH_DOT_ABOVE, -'⋶' => ELEMENT_OF_WITH_OVERBAR, -'⋷' => SMALL_ELEMENT_OF_WITH_OVERBAR, -'⋸' => ELEMENT_OF_WITH_UNDERBAR, -'⋹' => ELEMENT_OF_WITH_TWO_HORIZONTAL_STROKES, -'⋺' => CONTAINS_WITH_LONG_HORIZONTAL_STROKE, -'⋻' => CONTAINS_WITH_VERTICAL_BAR_AT_END_OF_HORIZONTAL_STROKE, -'⋼' => SMALL_CONTAINS_WITH_VERTICAL_BAR_AT_END_OF_HORIZONTAL_STROKE, -'⋽' => CONTAINS_WITH_OVERBAR, -'⋾' => SMALL_CONTAINS_WITH_OVERBAR, -'⋿' => Z_NOTATION_BAG_MEMBERSHIP, -'⟈' => REVERSE_SOLIDUS_PRECEDING_SUBSET, -'⟉' => SUPERSET_PRECEDING_SOLIDUS, -'⟒' => ELEMENT_OF_OPENING_UPWARDS, -'⦷' => CIRCLED_PARALLEL, -'⧀' => CIRCLED_LESS_THAN, -'⧁' => CIRCLED_GREATER_THAN, -'⧡' => INCREASES_AS, -'⧣' => EQUALS_SIGN_AND_SLANTED_PARALLEL, -'⧤' => EQUALS_SIGN_AND_SLANTED_PARALLEL_WITH_TILDE_ABOVE, -'⧥' => IDENTICAL_TO_AND_SLANTED_PARALLEL, -'⩦' => EQUALS_SIGN_WITH_DOT_BELOW, -'⩧' => IDENTICAL_WITH_DOT_ABOVE, -'⩪' => TILDE_OPERATOR_WITH_DOT_ABOVE, -'⩫' => TILDE_OPERATOR_WITH_RISING_DOTS, -'⩬' => SIMILAR_MINUS_SIMILAR, -'⩭' => CONGRUENT_WITH_DOT_ABOVE, -'⩮' => EQUALS_WITH_ASTERISK, -'⩯' => ALMOST_EQUAL_TO_WITH_CIRCUMFLEX_ACCENT, -'⩰' => APPROXIMATELY_EQUAL_OR_EQUAL_TO, -'⩱' => EQUALS_SIGN_ABOVE_PLUS_SIGN, -'⩲' => PLUS_SIGN_ABOVE_EQUALS_SIGN, -'⩳' => EQUALS_SIGN_ABOVE_TILDE_OPERATOR, -'⩴' => DOUBLE_COLON_EQUAL, -'⩵' => TWO_CONSECUTIVE_EQUALS_SIGNS, -'⩶' => THREE_CONSECUTIVE_EQUALS_SIGNS, -'⩷' => EQUALS_SIGN_WITH_TWO_DOTS_ABOVE_AND_TWO_DOTS_BELOW, -'⩸' => EQUIVALENT_WITH_FOUR_DOTS_ABOVE, -'⩹' => LESS_THAN_WITH_CIRCLE_INSIDE, -'⩺' => GREATER_THAN_WITH_CIRCLE_INSIDE, -'⩻' => LESS_THAN_WITH_QUESTION_MARK_ABOVE, -'⩼' => GREATER_THAN_WITH_QUESTION_MARK_ABOVE, -'⩽' => LESS_THAN_OR_SLANTED_EQUAL_TO, -'⩾' => GREATER_THAN_OR_SLANTED_EQUAL_TO, -'⩿' => LESS_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_INSIDE, -'⪀' => GREATER_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_INSIDE, -'⪁' => LESS_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_ABOVE, -'⪂' => GREATER_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_ABOVE, -'⪃' => LESS_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_ABOVE_RIGHT, -'⪄' => GREATER_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_ABOVE_LEFT, -'⪅' => LESS_THAN_OR_APPROXIMATE, -'⪆' => GREATER_THAN_OR_APPROXIMATE, -'⪇' => LESS_THAN_AND_SINGLE_LINE_NOT_EQUAL_TO, -'⪈' => GREATER_THAN_AND_SINGLE_LINE_NOT_EQUAL_TO, -'⪉' => LESS_THAN_AND_NOT_APPROXIMATE, -'⪊' => GREATER_THAN_AND_NOT_APPROXIMATE, -'⪋' => LESS_THAN_ABOVE_DOUBLE_LINE_EQUAL_ABOVE_GREATER_THAN, -'⪌' => GREATER_THAN_ABOVE_DOUBLE_LINE_EQUAL_ABOVE_LESS_THAN, -'⪍' => LESS_THAN_ABOVE_SIMILAR_OR_EQUAL, -'⪎' => GREATER_THAN_ABOVE_SIMILAR_OR_EQUAL, -'⪏' => LESS_THAN_ABOVE_SIMILAR_ABOVE_GREATER_THAN, -'⪐' => GREATER_THAN_ABOVE_SIMILAR_ABOVE_LESS_THAN, -'⪑' => LESS_THAN_ABOVE_GREATER_THAN_ABOVE_DOUBLE_LINE_EQUAL, -'⪒' => GREATER_THAN_ABOVE_LESS_THAN_ABOVE_DOUBLE_LINE_EQUAL, -'⪓' => LESS_THAN_ABOVE_SLANTED_EQUAL_ABOVE_GREATER_THAN_ABOVE_SLANTED_EQUAL, -'⪔' => GREATER_THAN_ABOVE_SLANTED_EQUAL_ABOVE_LESS_THAN_ABOVE_SLANTED_EQUAL, -'⪕' => SLANTED_EQUAL_TO_OR_LESS_THAN, -'⪖' => SLANTED_EQUAL_TO_OR_GREATER_THAN, -'⪗' => SLANTED_EQUAL_TO_OR_LESS_THAN_WITH_DOT_INSIDE, -'⪘' => SLANTED_EQUAL_TO_OR_GREATER_THAN_WITH_DOT_INSIDE, -'⪙' => DOUBLE_LINE_EQUAL_TO_OR_LESS_THAN, -'⪚' => DOUBLE_LINE_EQUAL_TO_OR_GREATER_THAN, -'⪛' => DOUBLE_LINE_SLANTED_EQUAL_TO_OR_LESS_THAN, -'⪜' => DOUBLE_LINE_SLANTED_EQUAL_TO_OR_GREATER_THAN, -'⪝' => SIMILAR_OR_LESS_THAN, -'⪞' => SIMILAR_OR_GREATER_THAN, -'⪟' => SIMILAR_ABOVE_LESS_THAN_ABOVE_EQUALS_SIGN, -'⪠' => SIMILAR_ABOVE_GREATER_THAN_ABOVE_EQUALS_SIGN, -'⪡' => DOUBLE_NESTED_LESS_THAN, -'⪢' => DOUBLE_NESTED_GREATER_THAN, -'⪣' => DOUBLE_NESTED_LESS_THAN_WITH_UNDERBAR, -'⪤' => GREATER_THAN_OVERLAPPING_LESS_THAN, -'⪥' => GREATER_THAN_BESIDE_LESS_THAN, -'⪦' => LESS_THAN_CLOSED_BY_CURVE, -'⪧' => GREATER_THAN_CLOSED_BY_CURVE, -'⪨' => LESS_THAN_CLOSED_BY_CURVE_ABOVE_SLANTED_EQUAL, -'⪩' => GREATER_THAN_CLOSED_BY_CURVE_ABOVE_SLANTED_EQUAL, -'⪪' => SMALLER_THAN, -'⪫' => LARGER_THAN, -'⪬' => SMALLER_THAN_OR_EQUAL_TO, -'⪭' => LARGER_THAN_OR_EQUAL_TO, -'⪮' => EQUALS_SIGN_WITH_BUMPY_ABOVE, -'⪯' => PRECEDES_ABOVE_SINGLE_LINE_EQUALS_SIGN, -'⪰' => SUCCEEDS_ABOVE_SINGLE_LINE_EQUALS_SIGN, -'⪱' => PRECEDES_ABOVE_SINGLE_LINE_NOT_EQUAL_TO, -'⪲' => SUCCEEDS_ABOVE_SINGLE_LINE_NOT_EQUAL_TO, -'⪳' => PRECEDES_ABOVE_EQUALS_SIGN, -'⪴' => SUCCEEDS_ABOVE_EQUALS_SIGN, -'⪵' => PRECEDES_ABOVE_NOT_EQUAL_TO, -'⪶' => SUCCEEDS_ABOVE_NOT_EQUAL_TO, -'⪷' => PRECEDES_ABOVE_ALMOST_EQUAL_TO, -'⪸' => SUCCEEDS_ABOVE_ALMOST_EQUAL_TO, -'⪹' => PRECEDES_ABOVE_NOT_ALMOST_EQUAL_TO, -'⪺' => SUCCEEDS_ABOVE_NOT_ALMOST_EQUAL_TO, -'⪻' => DOUBLE_PRECEDES, -'⪼' => DOUBLE_SUCCEEDS, -'⪽' => SUBSET_WITH_DOT, -'⪾' => SUPERSET_WITH_DOT, -'⪿' => SUBSET_WITH_PLUS_SIGN_BELOW, -'⫀' => SUPERSET_WITH_PLUS_SIGN_BELOW, -'⫁' => SUBSET_WITH_MULTIPLICATION_SIGN_BELOW, -'⫂' => SUPERSET_WITH_MULTIPLICATION_SIGN_BELOW, -'⫃' => SUBSET_OF_OR_EQUAL_TO_WITH_DOT_ABOVE, -'⫄' => SUPERSET_OF_OR_EQUAL_TO_WITH_DOT_ABOVE, -'⫅' => SUBSET_OF_ABOVE_EQUALS_SIGN, -'⫆' => SUPERSET_OF_ABOVE_EQUALS_SIGN, -'⫇' => SUBSET_OF_ABOVE_TILDE_OPERATOR, -'⫈' => SUPERSET_OF_ABOVE_TILDE_OPERATOR, -'⫉' => SUBSET_OF_ABOVE_ALMOST_EQUAL_TO, -'⫊' => SUPERSET_OF_ABOVE_ALMOST_EQUAL_TO, -'⫋' => SUBSET_OF_ABOVE_NOT_EQUAL_TO, -'⫌' => SUPERSET_OF_ABOVE_NOT_EQUAL_TO, -'⫍' => SQUARE_LEFT_OPEN_BOX_OPERATOR, -'⫎' => SQUARE_RIGHT_OPEN_BOX_OPERATOR, -'⫏' => CLOSED_SUBSET, -'⫐' => CLOSED_SUPERSET, -'⫑' => CLOSED_SUBSET_OR_EQUAL_TO, -'⫒' => CLOSED_SUPERSET_OR_EQUAL_TO, -'⫓' => SUBSET_ABOVE_SUPERSET, -'⫔' => SUPERSET_ABOVE_SUBSET, -'⫕' => SUBSET_ABOVE_SUBSET, -'⫖' => SUPERSET_ABOVE_SUPERSET, -'⫗' => SUPERSET_BESIDE_SUBSET, -'⫘' => SUPERSET_BESIDE_AND_JOINED_BY_DASH_WITH_SUBSET, -'⫙' => ELEMENT_OF_OPENING_DOWNWARDS, -'⫷' => TRIPLE_NESTED_LESS_THAN, -'⫸' => TRIPLE_NESTED_GREATER_THAN, -'⫹' => DOUBLE_LINE_SLANTED_LESS_THAN_OR_EQUAL_TO, -'⫺' => DOUBLE_LINE_SLANTED_GREATER_THAN_OR_EQUAL_TO, -'⊢' => RIGHT_TACK, -'⊣' => LEFT_TACK, -'⟂' => PERP, -'⊕' => CIRCLED_PLUS, -'⊖' => CIRCLED_MINUS, -'⊞' => SQUARED_PLUS, -'⊟' => SQUARED_MINUS, -'|' => OR, -'∪' => UNION, -'∨' => LOGICAL_OR, -'⊔' => SQUARE_CUP, -'±' => PLUS_MINUS_SIGN, -'∓' => MINUS_OR_PLUS_SIGN, -'∔' => DOT_PLUS, -'∸' => DOT_MINUS, -'≂' => MINUS_TILDE, -'≏' => DIFFERENCE_BETWEEN, -'⊎' => MULTISET_UNION, -'⊻' => XOR, -'⊽' => NOR, -'⋎' => CURLY_LOGICAL_OR, -'⋓' => DOUBLE_UNION, -'⧺' => DOUBLE_PLUS, -'⧻' => TRIPLE_PLUS, -'⨈' => TWO_LOGICAL_OR_OPERATOR, -'⨢' => PLUS_SIGN_WITH_SMALL_CIRCLE_ABOVE, -'⨣' => PLUS_SIGN_WITH_CIRCUMFLEX_ACCENT_ABOVE, -'⨤' => PLUS_SIGN_WITH_TILDE_ABOVE, -'⨥' => PLUS_SIGN_WITH_DOT_BELOW, -'⨦' => PLUS_SIGN_WITH_TILDE_BELOW, -'⨧' => PLUS_SIGN_WITH_SUBSCRIPT_TWO, -'⨨' => PLUS_SIGN_WITH_BLACK_TRIANGLE, -'⨩' => MINUS_SIGN_WITH_COMMA_ABOVE, -'⨪' => MINUS_SIGN_WITH_DOT_BELOW, -'⨫' => MINUS_SIGN_WITH_FALLING_DOTS, -'⨬' => MINUS_SIGN_WITH_RISING_DOTS, -'⨭' => PLUS_SIGN_IN_LEFT_HALF_CIRCLE, -'⨮' => PLUS_SIGN_IN_RIGHT_HALF_CIRCLE, -'⨹' => PLUS_SIGN_IN_TRIANGLE, -'⨺' => MINUS_SIGN_IN_TRIANGLE, -'⩁' => UNION_WITH_MINUS_SIGN, -'⩂' => UNION_WITH_OVERBAR, -'⩅' => UNION_WITH_LOGICAL_OR, -'⩊' => UNION_BESIDE_AND_JOINED_WITH_UNION, -'⩌' => CLOSED_UNION_WITH_SERIFS, -'⩏' => DOUBLE_SQUARE_UNION, -'⩐' => CLOSED_UNION_WITH_SERIFS_AND_SMASH_PRODUCT, -'⩒' => LOGICAL_OR_WITH_DOT_ABOVE, -'⩔' => DOUBLE_LOGICAL_OR, -'⩖' => TWO_INTERSECTING_LOGICAL_OR, -'⩗' => SLOPING_LARGE_OR, -'⩛' => LOGICAL_OR_WITH_MIDDLE_STEM, -'⩝' => LOGICAL_OR_WITH_HORIZONTAL_DASH, -'⩡' => SMALL_VEE_WITH_UNDERBAR, -'⩢' => LOGICAL_OR_WITH_DOUBLE_OVERBAR, -'⩣' => LOGICAL_OR_WITH_DOUBLE_UNDERBAR, -'∘' => RING_OPERATOR, -'×' => MULTIPLICATION_SIGN, -'∩' => INTERSECTION, -'∧' => LOGICAL_AND, -'⊗' => CIRCLED_TIMES, -'⊘' => CIRCLED_DIVISION_SLASH, -'⊙' => CIRCLED_DOT_OPERATOR, -'⊚' => CIRCLED_RING_OPERATOR, -'⊛' => CIRCLED_ASTERISK_OPERATOR, -'⊠' => SQUARED_TIMES, -'⊡' => SQUARED_DOT_OPERATOR, -'⊓' => SQUARE_CAP, -'∗' => ASTERISK_OPERATOR, -'∙' => BULLET_OPERATOR, -'∤' => DOES_NOT_DIVIDE, -'⅋' => TURNED_AMPERSAND, -'≀' => WREATH_PRODUCT, -'⊼' => NAND, -'⋄' => DIAMOND_OPERATOR, -'⋆' => STAR_OPERATOR, -'⋇' => DIVISION_TIMES, -'⋉' => LEFT_NORMAL_FACTOR_SEMIDIRECT_PRODUCT, -'⋊' => RIGHT_NORMAL_FACTOR_SEMIDIRECT_PRODUCT, -'⋋' => LEFT_SEMIDIRECT_PRODUCT, -'⋌' => RIGHT_SEMIDIRECT_PRODUCT, -'⋏' => CURLY_LOGICAL_AND, -'⋒' => DOUBLE_INTERSECTION, -'⟑' => AND_WITH_DOT, -'⦸' => CIRCLED_REVERSE_SOLIDUS, -'⦼' => CIRCLED_ANTICLOCKWISE_ROTATED_DIVISION_SIGN, -'⦾' => CIRCLED_WHITE_BULLET, -'⦿' => CIRCLED_BULLET, -'⧶' => SOLIDUS_WITH_OVERBAR, -'⧷' => REVERSE_SOLIDUS_WITH_HORIZONTAL_STROKE, -'⨇' => TWO_LOGICAL_AND_OPERATOR, -'⨰' => MULTIPLICATION_SIGN_WITH_DOT_ABOVE, -'⨱' => MULTIPLICATION_SIGN_WITH_UNDERBAR, -'⨲' => SEMIDIRECT_PRODUCT_WITH_BOTTOM_CLOSED, -'⨳' => SMASH_PRODUCT, -'⨴' => MULTIPLICATION_SIGN_IN_LEFT_HALF_CIRCLE, -'⨵' => MULTIPLICATION_SIGN_IN_RIGHT_HALF_CIRCLE, -'⨶' => CIRCLED_MULTIPLICATION_SIGN_WITH_CIRCUMFLEX_ACCENT, -'⨷' => MULTIPLICATION_SIGN_IN_DOUBLE_CIRCLE, -'⨸' => CIRCLED_DIVISION_SIGN, -'⨻' => MULTIPLICATION_SIGN_IN_TRIANGLE, -'⨼' => INTERIOR_PRODUCT, -'⨽' => RIGHTHAND_INTERIOR_PRODUCT, -'⩀' => INTERSECTION_WITH_DOT, -'⩃' => INTERSECTION_WITH_OVERBAR, -'⩄' => INTERSECTION_WITH_LOGICAL_AND, -'⩋' => INTERSECTION_BESIDE_AND_JOINED_WITH_INTERSECTION, -'⩍' => CLOSED_INTERSECTION_WITH_SERIFS, -'⩎' => DOUBLE_SQUARE_INTERSECTION, -'⩑' => LOGICAL_AND_WITH_DOT_ABOVE, -'⩓' => DOUBLE_LOGICAL_AND, -'⩕' => TWO_INTERSECTING_LOGICAL_AND, -'⩘' => SLOPING_LARGE_AND, -'⩚' => LOGICAL_AND_WITH_MIDDLE_STEM, -'⩜' => LOGICAL_AND_WITH_HORIZONTAL_DASH, -'⩞' => LOGICAL_AND_WITH_DOUBLE_OVERBAR, -'⩟' => LOGICAL_AND_WITH_UNDERBAR, -'⩠' => LOGICAL_AND_WITH_DOUBLE_UNDERBAR, -'⫛' => TRANSVERSAL_INTERSECTION, -'⊍' => MULTISET_MULTIPLICATION, -'▷' => WHITE_RIGHT_POINTING_TRIANGLE, -'⨝' => JOIN, -'⟕' => LEFT_OUTER_JOIN, -'⟖' => RIGHT_OUTER_JOIN, -'⟗' => FULL_OUTER_JOIN, -'^' => CIRCUMFLEX_ACCENT, -'↑' => UPWARDS_ARROW, -'↓' => DOWNWARDS_ARROW, -'⇵' => DOWNWARDS_ARROW_LEFTWARDS_OF_UPWARDS_ARROW, -'⟰' => UPWARDS_QUADRUPLE_ARROW, -'⟱' => DOWNWARDS_QUADRUPLE_ARROW, -'⤈' => DOWNWARDS_ARROW_WITH_HORIZONTAL_STROKE, -'⤉' => UPWARDS_ARROW_WITH_HORIZONTAL_STROKE, -'⤊' => UPWARDS_TRIPLE_ARROW, -'⤋' => DOWNWARDS_TRIPLE_ARROW, -'⤒' => UPWARDS_ARROW_TO_BAR, -'⤓' => DOWNWARDS_ARROW_TO_BAR, -'⥉' => UPWARDS_TWO_HEADED_ARROW_FROM_SMALL_CIRCLE, -'⥌' => UP_BARB_RIGHT_DOWN_BARB_LEFT_HARPOON, -'⥍' => UP_BARB_LEFT_DOWN_BARB_RIGHT_HARPOON, -'⥏' => UP_BARB_RIGHT_DOWN_BARB_RIGHT_HARPOON, -'⥑' => UP_BARB_LEFT_DOWN_BARB_LEFT_HARPOON, -'⥔' => UPWARDS_HARPOON_WITH_BARB_RIGHT_TO_BAR, -'⥕' => DOWNWARDS_HARPOON_WITH_BARB_RIGHT_TO_BAR, -'⥘' => UPWARDS_HARPOON_WITH_BARB_LEFT_TO_BAR, -'⥙' => DOWNWARDS_HARPOON_WITH_BARB_LEFT_TO_BAR, -'⥜' => UPWARDS_HARPOON_WITH_BARB_RIGHT_FROM_BAR, -'⥝' => DOWNWARDS_HARPOON_WITH_BARB_RIGHT_FROM_BAR, -'⥠' => UPWARDS_HARPOON_WITH_BARB_LEFT_FROM_BAR, -'⥡' => DOWNWARDS_HARPOON_WITH_BARB_LEFT_FROM_BAR, -'⥣' => UPWARDS_HARPOON_WITH_BARB_LEFT_BESIDE_UPWARDS_HARPOON_WITH_BARB_RIGHT, -'⥥' => DOWNWARDS_HARPOON_WITH_BARB_LEFT_BESIDE_DOWNWARDS_HARPOON_WITH_BARB_RIGHT, -'⥮' => UPWARDS_HARPOON_WITH_BARB_LEFT_BESIDE_DOWNWARDS_HARPOON_WITH_BARB_RIGHT, -'⥯' => DOWNWARDS_HARPOON_WITH_BARB_LEFT_BESIDE_UPWARDS_HARPOON_WITH_BARB_RIGHT, -'↑' => HALFWIDTH_UPWARDS_ARROW, -'↓' => HALFWIDTH_DOWNWARDS_ARROW, -'·' => UNICODE_DOT, -'·' => UNICODE_DOT, -'⋅' => UNICODE_DOT, -'…' => LDOTS, -'⁝' => TRICOLON, -'⋮' => VDOTS, -'⋱' => DDOTS, -'⋰' => ADOTS, -'⋯' => CDOTS, -'↻' => CIRCLE_ARROW_RIGHT, -'⇜' => LEFT_SQUIGGLE_ARROW, -'⇝' => RIGHT_SQUIGGLE_ARROW, -'↜' => LEFT_WAVE_ARROW, -'↝' => RIGHT_WAVE_ARROW, -'↩' => LEFTWARDS_ARROW_WITH_HOOK, -'↪' => RIGHTWARDS_ARROW_WITH_HOOK, -'↫' => LOOP_ARROW_LEFT, -'↬' => LOOP_ARROW_RIGHT, -'↼' => LEFT_HARPOON_UP, -'↽' => LEFT_HARPOON_DOWN, -'⇀' => RIGHT_HARPOON_UP, -'⇁' => RIGHT_HARPOON_DOWN, -'⇄' => RIGHT_LEFT_ARROWS, -'⇆' => LEFT_RIGHT_ARROWS, -'⇇' => LEFT_LEFT_ARROWS, -'⇉' => RIGHT_RIGHT_ARROWS, -'⇋' => LEFT_RIGHT_HARPOONS, -'⇌' => RIGHT_LEFT_HARPOONS, -'⇚' => L_LEFT_ARROW, -'⇛' => R_RIGHT_ARROW, -'⇠' => LEFT_DASH_ARROW, -'⇢' => RIGHT_DASH_ARROW, -'↷' => CURVE_ARROW_RIGHT, -'↶' => CURVE_ARROW_LEFT, -'↺' => CIRCLE_ARROW_LEFT, -'¦' => BROKEN_BAR, -'⌿' => NOT_SLASH, -'⨟' => BB_SEMI, -'⫪' => TOP, -'⫫' => BOT, -'−' => MINUS) +const UNICODE_OPS = Dict{Char,Kind}( + '÷' => DIVISION_SIGN, + '¬' => NOT_SIGN, + '√' => SQUARE_ROOT, + '∛' => CUBE_ROOT, + '∜' => QUAD_ROOT, + '←' => LEFTWARDS_ARROW, + '→' => RIGHTWARDS_ARROW, + '↔' => LEFT_RIGHT_ARROW, + '↚' => LEFTWARDS_ARROW_WITH_STROKE, + '↛' => RIGHTWARDS_ARROW_WITH_STROKE, + '↞' => LEFTWARDS_TWO_HEADED_ARROW, + '↠' => RIGHTWARDS_TWO_HEADED_ARROW, + '↢' => LEFTWARDS_ARROW_WITH_TAIL, + '↣' => RIGHTWARDS_ARROW_WITH_TAIL, + '↤' => LEFTWARDS_ARROW_FROM_BAR, + '↦' => RIGHTWARDS_ARROW_FROM_BAR, + '↮' => LEFT_RIGHT_ARROW_WITH_STROKE, + '⇎' => LEFT_RIGHT_DOUBLE_ARROW_WITH_STROKE, + '⇍' => LEFTWARDS_DOUBLE_ARROW_WITH_STROKE, + '⇏' => RIGHTWARDS_DOUBLE_ARROW_WITH_STROKE, + '⇐' => LEFTWARDS_DOUBLE_ARROW, + '⇒' => RIGHTWARDS_DOUBLE_ARROW, + '⇔' => LEFT_RIGHT_DOUBLE_ARROW, + '⇴' => RIGHT_ARROW_WITH_SMALL_CIRCLE, + '⇶' => THREE_RIGHTWARDS_ARROWS, + '⇷' => LEFTWARDS_ARROW_WITH_VERTICAL_STROKE, + '⇸' => RIGHTWARDS_ARROW_WITH_VERTICAL_STROKE, + '⇹' => LEFT_RIGHT_ARROW_WITH_VERTICAL_STROKE, + '⇺' => LEFTWARDS_ARROW_WITH_DOUBLE_VERTICAL_STROKE, + '⇻' => RIGHTWARDS_ARROW_WITH_DOUBLE_VERTICAL_STROKE, + '⇼' => LEFT_RIGHT_ARROW_WITH_DOUBLE_VERTICAL_STROKE, + '⇽' => LEFTWARDS_OPEN_HEADED_ARROW, + '⇾' => RIGHTWARDS_OPEN_HEADED_ARROW, + '⇿' => LEFT_RIGHT_OPEN_HEADED_ARROW, + '⟵' => LONG_LEFTWARDS_ARROW, + '⟶' => LONG_RIGHTWARDS_ARROW, + '⟷' => LONG_LEFT_RIGHT_ARROW, + '⟹' => LONG_RIGHTWARDS_DOUBLE_ARROW, + '⟺' => LONG_LEFT_RIGHT_DOUBLE_ARROW, + '⟻' => LONG_LEFTWARDS_ARROW_FROM_BAR, + '⟼' => LONG_RIGHTWARDS_ARROW_FROM_BAR, + '⟽' => LONG_LEFTWARDS_DOUBLE_ARROW_FROM_BAR, + '⟾' => LONG_RIGHTWARDS_DOUBLE_ARROW_FROM_BAR, + '⟿' => LONG_RIGHTWARDS_SQUIGGLE_ARROW, + '⤀' => RIGHTWARDS_TWO_HEADED_ARROW_WITH_VERTICAL_STROKE, + '⤁' => RIGHTWARDS_TWO_HEADED_ARROW_WITH_DOUBLE_VERTICAL_STROKE, + '⤂' => LEFTWARDS_DOUBLE_ARROW_WITH_VERTICAL_STROKE, + '⤃' => RIGHTWARDS_DOUBLE_ARROW_WITH_VERTICAL_STROKE, + '⤄' => LEFT_RIGHT_DOUBLE_ARROW_WITH_VERTICAL_STROKE, + '⤅' => RIGHTWARDS_TWO_HEADED_ARROW_FROM_BAR, + '⤆' => LEFTWARDS_DOUBLE_ARROW_FROM_BAR, + '⤇' => RIGHTWARDS_DOUBLE_ARROW_FROM_BAR, + '⤌' => LEFTWARDS_DOUBLE_DASH_ARROW, + '⤍' => RIGHTWARDS_DOUBLE_DASH_ARROW, + '⤎' => LEFTWARDS_TRIPLE_DASH_ARROW, + '⤏' => RIGHTWARDS_TRIPLE_DASH_ARROW, + '⤐' => RIGHTWARDS_TWO_HEADED_TRIPLE_DASH_ARROW, + '⤑' => RIGHTWARDS_ARROW_WITH_DOTTED_STEM, + '⤔' => RIGHTWARDS_ARROW_WITH_TAIL_WITH_VERTICAL_STROKE, + '⤕' => RIGHTWARDS_ARROW_WITH_TAIL_WITH_DOUBLE_VERTICAL_STROKE, + '⤖' => RIGHTWARDS_TWO_HEADED_ARROW_WITH_TAIL, + '⤗' => RIGHTWARDS_TWO_HEADED_ARROW_WITH_TAIL_WITH_VERTICAL_STROKE, + '⤘' => RIGHTWARDS_TWO_HEADED_ARROW_WITH_TAIL_WITH_DOUBLE_VERTICAL_STROKE, + '⤝' => LEFTWARDS_ARROW_TO_BLACK_DIAMOND, + '⤞' => RIGHTWARDS_ARROW_TO_BLACK_DIAMOND, + '⤟' => LEFTWARDS_ARROW_FROM_BAR_TO_BLACK_DIAMOND, + '⤠' => RIGHTWARDS_ARROW_FROM_BAR_TO_BLACK_DIAMOND, + '⥄' => SHORT_RIGHTWARDS_ARROW_ABOVE_LEFTWARDS_ARROW, + '⥅' => RIGHTWARDS_ARROW_WITH_PLUS_BELOW, + '⥆' => LEFTWARDS_ARROW_WITH_PLUS_BELOW, + '⥇' => RIGHTWARDS_ARROW_THROUGH_X, + '⥈' => LEFT_RIGHT_ARROW_THROUGH_SMALL_CIRCLE, + '⥊' => LEFT_BARB_UP_RIGHT_BARB_DOWN_HARPOON, + '⥋' => LEFT_BARB_DOWN_RIGHT_BARB_UP_HARPOON, + '⥎' => LEFT_BARB_UP_RIGHT_BARB_UP_HARPOON, + '⥐' => LEFT_BARB_DOWN_RIGHT_BARB_DOWN_HARPOON, + '⥒' => LEFTWARDS_HARPOON_WITH_BARB_UP_TO_BAR, + '⥓' => RIGHTWARDS_HARPOON_WITH_BARB_UP_TO_BAR, + '⥖' => LEFTWARDS_HARPOON_WITH_BARB_DOWN_TO_BAR, + '⥗' => RIGHTWARDS_HARPOON_WITH_BARB_DOWN_TO_BAR, + '⥚' => LEFTWARDS_HARPOON_WITH_BARB_UP_FROM_BAR, + '⥛' => RIGHTWARDS_HARPOON_WITH_BARB_UP_FROM_BAR, + '⥞' => LEFTWARDS_HARPOON_WITH_BARB_DOWN_FROM_BAR, + '⥟' => RIGHTWARDS_HARPOON_WITH_BARB_DOWN_FROM_BAR, + '⥢' => LEFTWARDS_HARPOON_WITH_BARB_UP_ABOVE_LEFTWARDS_HARPOON_WITH_BARB_DOWN, + '⥤' => RIGHTWARDS_HARPOON_WITH_BARB_UP_ABOVE_RIGHTWARDS_HARPOON_WITH_BARB_DOWN, + '⥦' => LEFTWARDS_HARPOON_WITH_BARB_UP_ABOVE_RIGHTWARDS_HARPOON_WITH_BARB_UP, + '⥧' => LEFTWARDS_HARPOON_WITH_BARB_DOWN_ABOVE_RIGHTWARDS_HARPOON_WITH_BARB_DOWN, + '⥨' => RIGHTWARDS_HARPOON_WITH_BARB_UP_ABOVE_LEFTWARDS_HARPOON_WITH_BARB_UP, + '⥩' => RIGHTWARDS_HARPOON_WITH_BARB_DOWN_ABOVE_LEFTWARDS_HARPOON_WITH_BARB_DOWN, + '⥪' => LEFTWARDS_HARPOON_WITH_BARB_UP_ABOVE_LONG_DASH, + '⥫' => LEFTWARDS_HARPOON_WITH_BARB_DOWN_BELOW_LONG_DASH, + '⥬' => RIGHTWARDS_HARPOON_WITH_BARB_UP_ABOVE_LONG_DASH, + '⥭' => RIGHTWARDS_HARPOON_WITH_BARB_DOWN_BELOW_LONG_DASH, + '⥰' => RIGHT_DOUBLE_ARROW_WITH_ROUNDED_HEAD, + '⧴' => RULE_DELAYED, + '⬱' => THREE_LEFTWARDS_ARROWS, + '⬰' => LEFT_ARROW_WITH_SMALL_CIRCLE, + '⬲' => LEFT_ARROW_WITH_CIRCLED_PLUS, + '⬳' => LONG_LEFTWARDS_SQUIGGLE_ARROW, + '⬴' => LEFTWARDS_TWO_HEADED_ARROW_WITH_VERTICAL_STROKE, + '⬵' => LEFTWARDS_TWO_HEADED_ARROW_WITH_DOUBLE_VERTICAL_STROKE, + '⬶' => LEFTWARDS_TWO_HEADED_ARROW_FROM_BAR, + '⬷' => LEFTWARDS_TWO_HEADED_TRIPLE_DASH_ARROW, + '⬸' => LEFTWARDS_ARROW_WITH_DOTTED_STEM, + '⬹' => LEFTWARDS_ARROW_WITH_TAIL_WITH_VERTICAL_STROKE, + '⬺' => LEFTWARDS_ARROW_WITH_TAIL_WITH_DOUBLE_VERTICAL_STROKE, + '⬻' => LEFTWARDS_TWO_HEADED_ARROW_WITH_TAIL, + '⬼' => LEFTWARDS_TWO_HEADED_ARROW_WITH_TAIL_WITH_VERTICAL_STROKE, + '⬽' => LEFTWARDS_TWO_HEADED_ARROW_WITH_TAIL_WITH_DOUBLE_VERTICAL_STROKE, + '⬾' => LEFTWARDS_ARROW_THROUGH_X, + '⬿' => WAVE_ARROW_POINTING_DIRECTLY_LEFT, + '⭀' => EQUALS_SIGN_ABOVE_LEFTWARDS_ARROW, + '⭁' => REVERSE_TILDE_OPERATOR_ABOVE_LEFTWARDS_ARROW, + '⭂' => LEFTWARDS_ARROW_ABOVE_REVERSE_ALMOST_EQUAL_TO, + '⭃' => RIGHTWARDS_ARROW_THROUGH_GREATER_THAN, + '⭄' => RIGHTWARDS_ARROW_THROUGH_SUPERSET, + '⭇' => REVERSE_TILDE_OPERATOR_ABOVE_RIGHTWARDS_ARROW, + '⭈' => RIGHTWARDS_ARROW_ABOVE_REVERSE_ALMOST_EQUAL_TO, + '⭉' => TILDE_OPERATOR_ABOVE_LEFTWARDS_ARROW, + '⭊' => LEFTWARDS_ARROW_ABOVE_ALMOST_EQUAL_TO, + '⭋' => LEFTWARDS_ARROW_ABOVE_REVERSE_TILDE_OPERATOR, + '⭌' => RIGHTWARDS_ARROW_ABOVE_REVERSE_TILDE_OPERATOR, + '←' => HALFWIDTH_LEFTWARDS_ARROW, + '→' => HALFWIDTH_RIGHTWARDS_ARROW, + '≥' => GREATER_THAN_OR_EQUAL_TO, + '≤' => LESS_THAN_OR_EQUAL_TO, + '≡' => IDENTICAL_TO, + '≠' => NOT_EQUAL_TO, + '≢' => NOT_IDENTICAL_TO, + '∈' => ELEMENT_OF, + '∉' => NOT_AN_ELEMENT_OF, + '∋' => CONTAINS_AS_MEMBER, + '∌' => DOES_NOT_CONTAIN_AS_MEMBER, + '⊆' => SUBSET_OF_OR_EQUAL_TO, + '⊈' => NEITHER_A_SUBSET_OF_NOR_EQUAL_TO, + '⊂' => SUBSET_OF, + '⊄' => NOT_A_SUBSET_OF, + '⊊' => SUBSET_OF_WITH_NOT_EQUAL_TO, + '∝' => PROPORTIONAL_TO, + '∊' => SMALL_ELEMENT_OF, + '∍' => SMALL_CONTAINS_AS_MEMBER, + '∥' => PARALLEL_TO, + '∦' => NOT_PARALLEL_TO, + '∷' => PROPORTION, + '∺' => GEOMETRIC_PROPORTION, + '∻' => HOMOTHETIC, + '∽' => REVERSED_TILDE, + '∾' => INVERTED_LAZY_S, + '≁' => NOT_TILDE, + '≃' => ASYMPTOTICALLY_EQUAL_TO, + '≄' => NOT_ASYMPTOTICALLY_EQUAL_TO, + '≅' => APPROXIMATELY_EQUAL_TO, + '≆' => APPROXIMATELY_BUT_NOT_ACTUALLY_EQUAL_TO, + '≇' => NEITHER_APPROXIMATELY_NOR_ACTUALLY_EQUAL_TO, + '≈' => ALMOST_EQUAL_TO, + '≉' => NOT_ALMOST_EQUAL_TO, + '≊' => ALMOST_EQUAL_OR_EQUAL_TO, + '≋' => TRIPLE_TILDE, + '≌' => ALL_EQUAL_TO, + '≍' => EQUIVALENT_TO, + '≎' => GEOMETRICALLY_EQUIVALENT_TO, + '≐' => APPROACHES_THE_LIMIT, + '≑' => GEOMETRICALLY_EQUAL_TO, + '≒' => APPROXIMATELY_EQUAL_TO_OR_THE_IMAGE_OF, + '≓' => IMAGE_OF_OR_APPROXIMATELY_EQUAL_TO, + '≔' => COLON_EQUALS, + '≕' => EQUALS_COLON, + '≖' => RING_IN_EQUAL_TO, + '≗' => RING_EQUAL_TO, + '≘' => CORRESPONDS_TO, + '≙' => ESTIMATES, + '≚' => EQUIANGULAR_TO, + '≛' => STAR_EQUALS, + '≜' => DELTA_EQUAL_TO, + '≝' => EQUAL_TO_BY_DEFINITION, + '≞' => MEASURED_BY, + '≟' => QUESTIONED_EQUAL_TO, + '≣' => STRICTLY_EQUIVALENT_TO, + '≦' => LESS_THAN_OVER_EQUAL_TO, + '≧' => GREATER_THAN_OVER_EQUAL_TO, + '≨' => LESS_THAN_BUT_NOT_EQUAL_TO, + '≩' => GREATER_THAN_BUT_NOT_EQUAL_TO, + '≪' => MUCH_LESS_THAN, + '≫' => MUCH_GREATER_THAN, + '≬' => BETWEEN, + '≭' => NOT_EQUIVALENT_TO, + '≮' => NOT_LESS_THAN, + '≯' => NOT_GREATER_THAN, + '≰' => NEITHER_LESS_THAN_NOR_EQUAL_TO, + '≱' => NEITHER_GREATER_THAN_NOR_EQUAL_TO, + '≲' => LESS_THAN_OR_EQUIVALENT_TO, + '≳' => GREATER_THAN_OR_EQUIVALENT_TO, + '≴' => NEITHER_LESS_THAN_NOR_EQUIVALENT_TO, + '≵' => NEITHER_GREATER_THAN_NOR_EQUIVALENT_TO, + '≶' => LESS_THAN_OR_GREATER_THAN, + '≷' => GREATER_THAN_OR_LESS_THAN, + '≸' => NEITHER_LESS_THAN_NOR_GREATER_THAN, + '≹' => NEITHER_GREATER_THAN_NOR_LESS_THAN, + '≺' => PRECEDES, + '≻' => SUCCEEDS, + '≼' => PRECEDES_OR_EQUAL_TO, + '≽' => SUCCEEDS_OR_EQUAL_TO, + '≾' => PRECEDES_OR_EQUIVALENT_TO, + '≿' => SUCCEEDS_OR_EQUIVALENT_TO, + '⊀' => DOES_NOT_PRECEDE, + '⊁' => DOES_NOT_SUCCEED, + '⊃' => SUPERSET_OF, + '⊅' => NOT_A_SUPERSET_OF, + '⊇' => SUPERSET_OF_OR_EQUAL_TO, + '⊉' => NEITHER_A_SUPERSET_OF_NOR_EQUAL_TO, + '⊋' => SUPERSET_OF_WITH_NOT_EQUAL_TO, + '⊏' => SQUARE_IMAGE_OF, + '⊐' => SQUARE_ORIGINAL_OF, + '⊑' => SQUARE_IMAGE_OF_OR_EQUAL_TO, + '⊒' => SQUARE_ORIGINAL_OF_OR_EQUAL_TO, + '⊜' => CIRCLED_EQUALS, + '⊩' => FORCES, + '⊬' => DOES_NOT_PROVE, + '⊮' => DOES_NOT_FORCE, + '⊰' => PRECEDES_UNDER_RELATION, + '⊱' => SUCCEEDS_UNDER_RELATION, + '⊲' => NORMAL_SUBGROUP_OF, + '⊳' => CONTAINS_AS_NORMAL_SUBGROUP, + '⊴' => NORMAL_SUBGROUP_OF_OR_EQUAL_TO, + '⊵' => CONTAINS_AS_NORMAL_SUBGROUP_OR_EQUAL_TO, + '⊶' => ORIGINAL_OF, + '⊷' => IMAGE_OF, + '⋍' => REVERSED_TILDE_EQUALS, + '⋐' => DOUBLE_SUBSET, + '⋑' => DOUBLE_SUPERSET, + '⋕' => EQUAL_AND_PARALLEL_TO, + '⋖' => LESS_THAN_WITH_DOT, + '⋗' => GREATER_THAN_WITH_DOT, + '⋘' => VERY_MUCH_LESS_THAN, + '⋙' => VERY_MUCH_GREATER_THAN, + '⋚' => LESS_THAN_EQUAL_TO_OR_GREATER_THAN, + '⋛' => GREATER_THAN_EQUAL_TO_OR_LESS_THAN, + '⋜' => EQUAL_TO_OR_LESS_THAN, + '⋝' => EQUAL_TO_OR_GREATER_THAN, + '⋞' => EQUAL_TO_OR_PRECEDES, + '⋟' => EQUAL_TO_OR_SUCCEEDS, + '⋠' => DOES_NOT_PRECEDE_OR_EQUAL, + '⋡' => DOES_NOT_SUCCEED_OR_EQUAL, + '⋢' => NOT_SQUARE_IMAGE_OF_OR_EQUAL_TO, + '⋣' => NOT_SQUARE_ORIGINAL_OF_OR_EQUAL_TO, + '⋤' => SQUARE_IMAGE_OF_OR_NOT_EQUAL_TO, + '⋥' => SQUARE_ORIGINAL_OF_OR_NOT_EQUAL_TO, + '⋦' => LESS_THAN_BUT_NOT_EQUIVALENT_TO, + '⋧' => GREATER_THAN_BUT_NOT_EQUIVALENT_TO, + '⋨' => PRECEDES_BUT_NOT_EQUIVALENT_TO, + '⋩' => SUCCEEDS_BUT_NOT_EQUIVALENT_TO, + '⋪' => NOT_NORMAL_SUBGROUP_OF, + '⋫' => DOES_NOT_CONTAIN_AS_NORMAL_SUBGROUP, + '⋬' => NOT_NORMAL_SUBGROUP_OF_OR_EQUAL_TO, + '⋭' => DOES_NOT_CONTAIN_AS_NORMAL_SUBGROUP_OR_EQUAL, + '⋲' => ELEMENT_OF_WITH_LONG_HORIZONTAL_STROKE, + '⋳' => ELEMENT_OF_WITH_VERTICAL_BAR_AT_END_OF_HORIZONTAL_STROKE, + '⋴' => SMALL_ELEMENT_OF_WITH_VERTICAL_BAR_AT_END_OF_HORIZONTAL_STROKE, + '⋵' => ELEMENT_OF_WITH_DOT_ABOVE, + '⋶' => ELEMENT_OF_WITH_OVERBAR, + '⋷' => SMALL_ELEMENT_OF_WITH_OVERBAR, + '⋸' => ELEMENT_OF_WITH_UNDERBAR, + '⋹' => ELEMENT_OF_WITH_TWO_HORIZONTAL_STROKES, + '⋺' => CONTAINS_WITH_LONG_HORIZONTAL_STROKE, + '⋻' => CONTAINS_WITH_VERTICAL_BAR_AT_END_OF_HORIZONTAL_STROKE, + '⋼' => SMALL_CONTAINS_WITH_VERTICAL_BAR_AT_END_OF_HORIZONTAL_STROKE, + '⋽' => CONTAINS_WITH_OVERBAR, + '⋾' => SMALL_CONTAINS_WITH_OVERBAR, + '⋿' => Z_NOTATION_BAG_MEMBERSHIP, + '⟈' => REVERSE_SOLIDUS_PRECEDING_SUBSET, + '⟉' => SUPERSET_PRECEDING_SOLIDUS, + '⟒' => ELEMENT_OF_OPENING_UPWARDS, + '⦷' => CIRCLED_PARALLEL, + '⧀' => CIRCLED_LESS_THAN, + '⧁' => CIRCLED_GREATER_THAN, + '⧡' => INCREASES_AS, + '⧣' => EQUALS_SIGN_AND_SLANTED_PARALLEL, + '⧤' => EQUALS_SIGN_AND_SLANTED_PARALLEL_WITH_TILDE_ABOVE, + '⧥' => IDENTICAL_TO_AND_SLANTED_PARALLEL, + '⩦' => EQUALS_SIGN_WITH_DOT_BELOW, + '⩧' => IDENTICAL_WITH_DOT_ABOVE, + '⩪' => TILDE_OPERATOR_WITH_DOT_ABOVE, + '⩫' => TILDE_OPERATOR_WITH_RISING_DOTS, + '⩬' => SIMILAR_MINUS_SIMILAR, + '⩭' => CONGRUENT_WITH_DOT_ABOVE, + '⩮' => EQUALS_WITH_ASTERISK, + '⩯' => ALMOST_EQUAL_TO_WITH_CIRCUMFLEX_ACCENT, + '⩰' => APPROXIMATELY_EQUAL_OR_EQUAL_TO, + '⩱' => EQUALS_SIGN_ABOVE_PLUS_SIGN, + '⩲' => PLUS_SIGN_ABOVE_EQUALS_SIGN, + '⩳' => EQUALS_SIGN_ABOVE_TILDE_OPERATOR, + '⩴' => DOUBLE_COLON_EQUAL, + '⩵' => TWO_CONSECUTIVE_EQUALS_SIGNS, + '⩶' => THREE_CONSECUTIVE_EQUALS_SIGNS, + '⩷' => EQUALS_SIGN_WITH_TWO_DOTS_ABOVE_AND_TWO_DOTS_BELOW, + '⩸' => EQUIVALENT_WITH_FOUR_DOTS_ABOVE, + '⩹' => LESS_THAN_WITH_CIRCLE_INSIDE, + '⩺' => GREATER_THAN_WITH_CIRCLE_INSIDE, + '⩻' => LESS_THAN_WITH_QUESTION_MARK_ABOVE, + '⩼' => GREATER_THAN_WITH_QUESTION_MARK_ABOVE, + '⩽' => LESS_THAN_OR_SLANTED_EQUAL_TO, + '⩾' => GREATER_THAN_OR_SLANTED_EQUAL_TO, + '⩿' => LESS_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_INSIDE, + '⪀' => GREATER_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_INSIDE, + '⪁' => LESS_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_ABOVE, + '⪂' => GREATER_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_ABOVE, + '⪃' => LESS_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_ABOVE_RIGHT, + '⪄' => GREATER_THAN_OR_SLANTED_EQUAL_TO_WITH_DOT_ABOVE_LEFT, + '⪅' => LESS_THAN_OR_APPROXIMATE, + '⪆' => GREATER_THAN_OR_APPROXIMATE, + '⪇' => LESS_THAN_AND_SINGLE_LINE_NOT_EQUAL_TO, + '⪈' => GREATER_THAN_AND_SINGLE_LINE_NOT_EQUAL_TO, + '⪉' => LESS_THAN_AND_NOT_APPROXIMATE, + '⪊' => GREATER_THAN_AND_NOT_APPROXIMATE, + '⪋' => LESS_THAN_ABOVE_DOUBLE_LINE_EQUAL_ABOVE_GREATER_THAN, + '⪌' => GREATER_THAN_ABOVE_DOUBLE_LINE_EQUAL_ABOVE_LESS_THAN, + '⪍' => LESS_THAN_ABOVE_SIMILAR_OR_EQUAL, + '⪎' => GREATER_THAN_ABOVE_SIMILAR_OR_EQUAL, + '⪏' => LESS_THAN_ABOVE_SIMILAR_ABOVE_GREATER_THAN, + '⪐' => GREATER_THAN_ABOVE_SIMILAR_ABOVE_LESS_THAN, + '⪑' => LESS_THAN_ABOVE_GREATER_THAN_ABOVE_DOUBLE_LINE_EQUAL, + '⪒' => GREATER_THAN_ABOVE_LESS_THAN_ABOVE_DOUBLE_LINE_EQUAL, + '⪓' => LESS_THAN_ABOVE_SLANTED_EQUAL_ABOVE_GREATER_THAN_ABOVE_SLANTED_EQUAL, + '⪔' => GREATER_THAN_ABOVE_SLANTED_EQUAL_ABOVE_LESS_THAN_ABOVE_SLANTED_EQUAL, + '⪕' => SLANTED_EQUAL_TO_OR_LESS_THAN, + '⪖' => SLANTED_EQUAL_TO_OR_GREATER_THAN, + '⪗' => SLANTED_EQUAL_TO_OR_LESS_THAN_WITH_DOT_INSIDE, + '⪘' => SLANTED_EQUAL_TO_OR_GREATER_THAN_WITH_DOT_INSIDE, + '⪙' => DOUBLE_LINE_EQUAL_TO_OR_LESS_THAN, + '⪚' => DOUBLE_LINE_EQUAL_TO_OR_GREATER_THAN, + '⪛' => DOUBLE_LINE_SLANTED_EQUAL_TO_OR_LESS_THAN, + '⪜' => DOUBLE_LINE_SLANTED_EQUAL_TO_OR_GREATER_THAN, + '⪝' => SIMILAR_OR_LESS_THAN, + '⪞' => SIMILAR_OR_GREATER_THAN, + '⪟' => SIMILAR_ABOVE_LESS_THAN_ABOVE_EQUALS_SIGN, + '⪠' => SIMILAR_ABOVE_GREATER_THAN_ABOVE_EQUALS_SIGN, + '⪡' => DOUBLE_NESTED_LESS_THAN, + '⪢' => DOUBLE_NESTED_GREATER_THAN, + '⪣' => DOUBLE_NESTED_LESS_THAN_WITH_UNDERBAR, + '⪤' => GREATER_THAN_OVERLAPPING_LESS_THAN, + '⪥' => GREATER_THAN_BESIDE_LESS_THAN, + '⪦' => LESS_THAN_CLOSED_BY_CURVE, + '⪧' => GREATER_THAN_CLOSED_BY_CURVE, + '⪨' => LESS_THAN_CLOSED_BY_CURVE_ABOVE_SLANTED_EQUAL, + '⪩' => GREATER_THAN_CLOSED_BY_CURVE_ABOVE_SLANTED_EQUAL, + '⪪' => SMALLER_THAN, + '⪫' => LARGER_THAN, + '⪬' => SMALLER_THAN_OR_EQUAL_TO, + '⪭' => LARGER_THAN_OR_EQUAL_TO, + '⪮' => EQUALS_SIGN_WITH_BUMPY_ABOVE, + '⪯' => PRECEDES_ABOVE_SINGLE_LINE_EQUALS_SIGN, + '⪰' => SUCCEEDS_ABOVE_SINGLE_LINE_EQUALS_SIGN, + '⪱' => PRECEDES_ABOVE_SINGLE_LINE_NOT_EQUAL_TO, + '⪲' => SUCCEEDS_ABOVE_SINGLE_LINE_NOT_EQUAL_TO, + '⪳' => PRECEDES_ABOVE_EQUALS_SIGN, + '⪴' => SUCCEEDS_ABOVE_EQUALS_SIGN, + '⪵' => PRECEDES_ABOVE_NOT_EQUAL_TO, + '⪶' => SUCCEEDS_ABOVE_NOT_EQUAL_TO, + '⪷' => PRECEDES_ABOVE_ALMOST_EQUAL_TO, + '⪸' => SUCCEEDS_ABOVE_ALMOST_EQUAL_TO, + '⪹' => PRECEDES_ABOVE_NOT_ALMOST_EQUAL_TO, + '⪺' => SUCCEEDS_ABOVE_NOT_ALMOST_EQUAL_TO, + '⪻' => DOUBLE_PRECEDES, + '⪼' => DOUBLE_SUCCEEDS, + '⪽' => SUBSET_WITH_DOT, + '⪾' => SUPERSET_WITH_DOT, + '⪿' => SUBSET_WITH_PLUS_SIGN_BELOW, + '⫀' => SUPERSET_WITH_PLUS_SIGN_BELOW, + '⫁' => SUBSET_WITH_MULTIPLICATION_SIGN_BELOW, + '⫂' => SUPERSET_WITH_MULTIPLICATION_SIGN_BELOW, + '⫃' => SUBSET_OF_OR_EQUAL_TO_WITH_DOT_ABOVE, + '⫄' => SUPERSET_OF_OR_EQUAL_TO_WITH_DOT_ABOVE, + '⫅' => SUBSET_OF_ABOVE_EQUALS_SIGN, + '⫆' => SUPERSET_OF_ABOVE_EQUALS_SIGN, + '⫇' => SUBSET_OF_ABOVE_TILDE_OPERATOR, + '⫈' => SUPERSET_OF_ABOVE_TILDE_OPERATOR, + '⫉' => SUBSET_OF_ABOVE_ALMOST_EQUAL_TO, + '⫊' => SUPERSET_OF_ABOVE_ALMOST_EQUAL_TO, + '⫋' => SUBSET_OF_ABOVE_NOT_EQUAL_TO, + '⫌' => SUPERSET_OF_ABOVE_NOT_EQUAL_TO, + '⫍' => SQUARE_LEFT_OPEN_BOX_OPERATOR, + '⫎' => SQUARE_RIGHT_OPEN_BOX_OPERATOR, + '⫏' => CLOSED_SUBSET, + '⫐' => CLOSED_SUPERSET, + '⫑' => CLOSED_SUBSET_OR_EQUAL_TO, + '⫒' => CLOSED_SUPERSET_OR_EQUAL_TO, + '⫓' => SUBSET_ABOVE_SUPERSET, + '⫔' => SUPERSET_ABOVE_SUBSET, + '⫕' => SUBSET_ABOVE_SUBSET, + '⫖' => SUPERSET_ABOVE_SUPERSET, + '⫗' => SUPERSET_BESIDE_SUBSET, + '⫘' => SUPERSET_BESIDE_AND_JOINED_BY_DASH_WITH_SUBSET, + '⫙' => ELEMENT_OF_OPENING_DOWNWARDS, + '⫷' => TRIPLE_NESTED_LESS_THAN, + '⫸' => TRIPLE_NESTED_GREATER_THAN, + '⫹' => DOUBLE_LINE_SLANTED_LESS_THAN_OR_EQUAL_TO, + '⫺' => DOUBLE_LINE_SLANTED_GREATER_THAN_OR_EQUAL_TO, + '⊢' => RIGHT_TACK, + '⊣' => LEFT_TACK, + '⟂' => PERP, + '⊕' => CIRCLED_PLUS, + '⊖' => CIRCLED_MINUS, + '⊞' => SQUARED_PLUS, + '⊟' => SQUARED_MINUS, + '|' => OR, + '∪' => UNION, + '∨' => LOGICAL_OR, + '⊔' => SQUARE_CUP, + '±' => PLUS_MINUS_SIGN, + '∓' => MINUS_OR_PLUS_SIGN, + '∔' => DOT_PLUS, + '∸' => DOT_MINUS, + '≂' => MINUS_TILDE, + '≏' => DIFFERENCE_BETWEEN, + '⊎' => MULTISET_UNION, + '⊻' => XOR, + '⊽' => NOR, + '⋎' => CURLY_LOGICAL_OR, + '⋓' => DOUBLE_UNION, + '⧺' => DOUBLE_PLUS, + '⧻' => TRIPLE_PLUS, + '⨈' => TWO_LOGICAL_OR_OPERATOR, + '⨢' => PLUS_SIGN_WITH_SMALL_CIRCLE_ABOVE, + '⨣' => PLUS_SIGN_WITH_CIRCUMFLEX_ACCENT_ABOVE, + '⨤' => PLUS_SIGN_WITH_TILDE_ABOVE, + '⨥' => PLUS_SIGN_WITH_DOT_BELOW, + '⨦' => PLUS_SIGN_WITH_TILDE_BELOW, + '⨧' => PLUS_SIGN_WITH_SUBSCRIPT_TWO, + '⨨' => PLUS_SIGN_WITH_BLACK_TRIANGLE, + '⨩' => MINUS_SIGN_WITH_COMMA_ABOVE, + '⨪' => MINUS_SIGN_WITH_DOT_BELOW, + '⨫' => MINUS_SIGN_WITH_FALLING_DOTS, + '⨬' => MINUS_SIGN_WITH_RISING_DOTS, + '⨭' => PLUS_SIGN_IN_LEFT_HALF_CIRCLE, + '⨮' => PLUS_SIGN_IN_RIGHT_HALF_CIRCLE, + '⨹' => PLUS_SIGN_IN_TRIANGLE, + '⨺' => MINUS_SIGN_IN_TRIANGLE, + '⩁' => UNION_WITH_MINUS_SIGN, + '⩂' => UNION_WITH_OVERBAR, + '⩅' => UNION_WITH_LOGICAL_OR, + '⩊' => UNION_BESIDE_AND_JOINED_WITH_UNION, + '⩌' => CLOSED_UNION_WITH_SERIFS, + '⩏' => DOUBLE_SQUARE_UNION, + '⩐' => CLOSED_UNION_WITH_SERIFS_AND_SMASH_PRODUCT, + '⩒' => LOGICAL_OR_WITH_DOT_ABOVE, + '⩔' => DOUBLE_LOGICAL_OR, + '⩖' => TWO_INTERSECTING_LOGICAL_OR, + '⩗' => SLOPING_LARGE_OR, + '⩛' => LOGICAL_OR_WITH_MIDDLE_STEM, + '⩝' => LOGICAL_OR_WITH_HORIZONTAL_DASH, + '⩡' => SMALL_VEE_WITH_UNDERBAR, + '⩢' => LOGICAL_OR_WITH_DOUBLE_OVERBAR, + '⩣' => LOGICAL_OR_WITH_DOUBLE_UNDERBAR, + '∘' => RING_OPERATOR, + '×' => MULTIPLICATION_SIGN, + '∩' => INTERSECTION, + '∧' => LOGICAL_AND, + '⊗' => CIRCLED_TIMES, + '⊘' => CIRCLED_DIVISION_SLASH, + '⊙' => CIRCLED_DOT_OPERATOR, + '⊚' => CIRCLED_RING_OPERATOR, + '⊛' => CIRCLED_ASTERISK_OPERATOR, + '⊠' => SQUARED_TIMES, + '⊡' => SQUARED_DOT_OPERATOR, + '⊓' => SQUARE_CAP, + '∗' => ASTERISK_OPERATOR, + '∙' => BULLET_OPERATOR, + '∤' => DOES_NOT_DIVIDE, + '⅋' => TURNED_AMPERSAND, + '≀' => WREATH_PRODUCT, + '⊼' => NAND, + '⋄' => DIAMOND_OPERATOR, + '⋆' => STAR_OPERATOR, + '⋇' => DIVISION_TIMES, + '⋉' => LEFT_NORMAL_FACTOR_SEMIDIRECT_PRODUCT, + '⋊' => RIGHT_NORMAL_FACTOR_SEMIDIRECT_PRODUCT, + '⋋' => LEFT_SEMIDIRECT_PRODUCT, + '⋌' => RIGHT_SEMIDIRECT_PRODUCT, + '⋏' => CURLY_LOGICAL_AND, + '⋒' => DOUBLE_INTERSECTION, + '⟑' => AND_WITH_DOT, + '⦸' => CIRCLED_REVERSE_SOLIDUS, + '⦼' => CIRCLED_ANTICLOCKWISE_ROTATED_DIVISION_SIGN, + '⦾' => CIRCLED_WHITE_BULLET, + '⦿' => CIRCLED_BULLET, + '⧶' => SOLIDUS_WITH_OVERBAR, + '⧷' => REVERSE_SOLIDUS_WITH_HORIZONTAL_STROKE, + '⨇' => TWO_LOGICAL_AND_OPERATOR, + '⨰' => MULTIPLICATION_SIGN_WITH_DOT_ABOVE, + '⨱' => MULTIPLICATION_SIGN_WITH_UNDERBAR, + '⨲' => SEMIDIRECT_PRODUCT_WITH_BOTTOM_CLOSED, + '⨳' => SMASH_PRODUCT, + '⨴' => MULTIPLICATION_SIGN_IN_LEFT_HALF_CIRCLE, + '⨵' => MULTIPLICATION_SIGN_IN_RIGHT_HALF_CIRCLE, + '⨶' => CIRCLED_MULTIPLICATION_SIGN_WITH_CIRCUMFLEX_ACCENT, + '⨷' => MULTIPLICATION_SIGN_IN_DOUBLE_CIRCLE, + '⨸' => CIRCLED_DIVISION_SIGN, + '⨻' => MULTIPLICATION_SIGN_IN_TRIANGLE, + '⨼' => INTERIOR_PRODUCT, + '⨽' => RIGHTHAND_INTERIOR_PRODUCT, + '⩀' => INTERSECTION_WITH_DOT, + '⩃' => INTERSECTION_WITH_OVERBAR, + '⩄' => INTERSECTION_WITH_LOGICAL_AND, + '⩋' => INTERSECTION_BESIDE_AND_JOINED_WITH_INTERSECTION, + '⩍' => CLOSED_INTERSECTION_WITH_SERIFS, + '⩎' => DOUBLE_SQUARE_INTERSECTION, + '⩑' => LOGICAL_AND_WITH_DOT_ABOVE, + '⩓' => DOUBLE_LOGICAL_AND, + '⩕' => TWO_INTERSECTING_LOGICAL_AND, + '⩘' => SLOPING_LARGE_AND, + '⩚' => LOGICAL_AND_WITH_MIDDLE_STEM, + '⩜' => LOGICAL_AND_WITH_HORIZONTAL_DASH, + '⩞' => LOGICAL_AND_WITH_DOUBLE_OVERBAR, + '⩟' => LOGICAL_AND_WITH_UNDERBAR, + '⩠' => LOGICAL_AND_WITH_DOUBLE_UNDERBAR, + '⫛' => TRANSVERSAL_INTERSECTION, + '⊍' => MULTISET_MULTIPLICATION, + '▷' => WHITE_RIGHT_POINTING_TRIANGLE, + '⨝' => JOIN, + '⟕' => LEFT_OUTER_JOIN, + '⟖' => RIGHT_OUTER_JOIN, + '⟗' => FULL_OUTER_JOIN, + '^' => CIRCUMFLEX_ACCENT, + '↑' => UPWARDS_ARROW, + '↓' => DOWNWARDS_ARROW, + '⇵' => DOWNWARDS_ARROW_LEFTWARDS_OF_UPWARDS_ARROW, + '⟰' => UPWARDS_QUADRUPLE_ARROW, + '⟱' => DOWNWARDS_QUADRUPLE_ARROW, + '⤈' => DOWNWARDS_ARROW_WITH_HORIZONTAL_STROKE, + '⤉' => UPWARDS_ARROW_WITH_HORIZONTAL_STROKE, + '⤊' => UPWARDS_TRIPLE_ARROW, + '⤋' => DOWNWARDS_TRIPLE_ARROW, + '⤒' => UPWARDS_ARROW_TO_BAR, + '⤓' => DOWNWARDS_ARROW_TO_BAR, + '⥉' => UPWARDS_TWO_HEADED_ARROW_FROM_SMALL_CIRCLE, + '⥌' => UP_BARB_RIGHT_DOWN_BARB_LEFT_HARPOON, + '⥍' => UP_BARB_LEFT_DOWN_BARB_RIGHT_HARPOON, + '⥏' => UP_BARB_RIGHT_DOWN_BARB_RIGHT_HARPOON, + '⥑' => UP_BARB_LEFT_DOWN_BARB_LEFT_HARPOON, + '⥔' => UPWARDS_HARPOON_WITH_BARB_RIGHT_TO_BAR, + '⥕' => DOWNWARDS_HARPOON_WITH_BARB_RIGHT_TO_BAR, + '⥘' => UPWARDS_HARPOON_WITH_BARB_LEFT_TO_BAR, + '⥙' => DOWNWARDS_HARPOON_WITH_BARB_LEFT_TO_BAR, + '⥜' => UPWARDS_HARPOON_WITH_BARB_RIGHT_FROM_BAR, + '⥝' => DOWNWARDS_HARPOON_WITH_BARB_RIGHT_FROM_BAR, + '⥠' => UPWARDS_HARPOON_WITH_BARB_LEFT_FROM_BAR, + '⥡' => DOWNWARDS_HARPOON_WITH_BARB_LEFT_FROM_BAR, + '⥣' => UPWARDS_HARPOON_WITH_BARB_LEFT_BESIDE_UPWARDS_HARPOON_WITH_BARB_RIGHT, + '⥥' => DOWNWARDS_HARPOON_WITH_BARB_LEFT_BESIDE_DOWNWARDS_HARPOON_WITH_BARB_RIGHT, + '⥮' => UPWARDS_HARPOON_WITH_BARB_LEFT_BESIDE_DOWNWARDS_HARPOON_WITH_BARB_RIGHT, + '⥯' => DOWNWARDS_HARPOON_WITH_BARB_LEFT_BESIDE_UPWARDS_HARPOON_WITH_BARB_RIGHT, + '↑' => HALFWIDTH_UPWARDS_ARROW, + '↓' => HALFWIDTH_DOWNWARDS_ARROW, + '·' => UNICODE_DOT, + '·' => UNICODE_DOT, + '⋅' => UNICODE_DOT, + '…' => LDOTS, + '⁝' => TRICOLON, + '⋮' => VDOTS, + '⋱' => DDOTS, + '⋰' => ADOTS, + '⋯' => CDOTS, + '↻' => CIRCLE_ARROW_RIGHT, + '⇜' => LEFT_SQUIGGLE_ARROW, + '⇝' => RIGHT_SQUIGGLE_ARROW, + '↜' => LEFT_WAVE_ARROW, + '↝' => RIGHT_WAVE_ARROW, + '↩' => LEFTWARDS_ARROW_WITH_HOOK, + '↪' => RIGHTWARDS_ARROW_WITH_HOOK, + '↫' => LOOP_ARROW_LEFT, + '↬' => LOOP_ARROW_RIGHT, + '↼' => LEFT_HARPOON_UP, + '↽' => LEFT_HARPOON_DOWN, + '⇀' => RIGHT_HARPOON_UP, + '⇁' => RIGHT_HARPOON_DOWN, + '⇄' => RIGHT_LEFT_ARROWS, + '⇆' => LEFT_RIGHT_ARROWS, + '⇇' => LEFT_LEFT_ARROWS, + '⇉' => RIGHT_RIGHT_ARROWS, + '⇋' => LEFT_RIGHT_HARPOONS, + '⇌' => RIGHT_LEFT_HARPOONS, + '⇚' => L_LEFT_ARROW, + '⇛' => R_RIGHT_ARROW, + '⇠' => LEFT_DASH_ARROW, + '⇢' => RIGHT_DASH_ARROW, + '↷' => CURVE_ARROW_RIGHT, + '↶' => CURVE_ARROW_LEFT, + '↺' => CIRCLE_ARROW_LEFT, + '¦' => BROKEN_BAR, + '⌿' => NOT_SLASH, + '⨟' => BB_SEMI, + '⫪' => TOP, + '⫫' => BOT, + '−' => MINUS) const UNICODE_OPS_REVERSE = Dict{Kind,Symbol}() diff --git a/packages/Tokenize/src/utilities.jl b/packages/Tokenize/src/utilities.jl index 3da5137..121d0c3 100644 --- a/packages/Tokenize/src/utilities.jl +++ b/packages/Tokenize/src/utilities.jl @@ -43,118 +43,118 @@ readchar(io::IO) = eof(io) ? EOF_CHAR : read(io, Char) c1 == EOF_CHAR && return false c = UInt32(c1) c == 0x00000021 || - c == 0x000000a6 || - c == 0x0000002e || - c == 0x0000007e || - c == 0x000000ac || - c == 0x000000b1 || - c == 0x000000d7 || - c == 0x00002026 || - c == 0x0000205d || - c == 0x0000214b || - 0x00002190 <= c <= 0x00002194 || - 0x0000219a <= c <= 0x0000219e || - c == 0x000021a0 || - 0x000021a2 <= c <= 0x000021a4 || - 0x000021aa <= c <= 0x000021ac || - c == 0x000021a6 || - c == 0x000021a9 || - c == 0x000021ae || - c == 0x000021c0 || - c == 0x000021c1 || - c == 0x000021c4 || - c == 0x000021c6 || - c == 0x000021c7 || - c == 0x000021c9 || - 0x000021cb <= c <= 0x000021cf || - c == 0x000021d2 || - c == 0x000021d4 || - c == 0x000021b6 || - c == 0x000021b7 || - 0x000021ba <= c <= 0x000021bd || - c == 0x000021d0 || - 0x000021da <= c <= 0x000021dd || - c == 0x000021e0 || - c == 0x000021e2 || - 0x000021f4 <= c <= 0x000021ff || - 0x00002208 <= c <= 0x0000220d || - 0x00002213 <= c <= 0x00002214 || - 0x00002217 <= c <= 0x00002219 || - 0x0000221a <= c <= 0x0000221d || - 0x00002224 <= c <= 0x0000222a || - 0x00002237 <= c <= 0x00002238 || - 0x0000223a <= c <= 0x0000223b || - 0x0000223d <= c <= 0x0000223e || - 0x00002240 <= c <= 0x0000228b || - 0x0000228d <= c <= 0x0000229c || - 0x0000229e <= c <= 0x000022a3 || - c == 0x000022a9 || - c == 0x000022ac || - c == 0x000022ae || - 0x000022b0 <= c <= 0x000022b7 || - 0x000022bc <= c <= 0x000022bd || - 0x000022c4 <= c <= 0x000022c7 || - 0x000022c9 <= c <= 0x000022d3 || - 0x000022d5 <= c <= 0x000022ff || - c == 0x0000233f || - c == 0x000025b7 || - c == 0x000027c2 || - 0x000027c8 <= c <= 0x000027c9 || - 0x000027d1 <= c <= 0x000027d2 || - 0x000027d5 <= c <= 0x000027d7 || - 0x000027f0 <= c <= 0x000027f1 || - 0x000027f5 <= c <= 0x000027f7 || - 0x000027f9 <= c <= 0x000027ff || - 0x00002900 <= c <= 0x00002918 || - 0x0000291d <= c <= 0x00002920 || - 0x00002944 <= c <= 0x00002970 || - 0x000029b7 <= c <= 0x000029b8 || - c == 0x000029bc || - 0x000029be <= c <= 0x000029c1 || - c == 0x000029e1 || - 0x000029e3 <= c <= 0x000029e5 || - c == 0x000029f4 || - 0x000029f6 <= c <= 0x000029f7 || - 0x000029fa <= c <= 0x000029fb || - 0x00002a07 <= c <= 0x00002a08 || - c == 0x00002a1d || - c == 0x00002a1f || - 0x00002a22 <= c <= 0x00002a2e || - 0x00002a30 <= c <= 0x00002a3d || - 0x00002a40 <= c <= 0x00002a45 || - 0x00002a4a <= c <= 0x00002a58 || - 0x00002a5a <= c <= 0x00002a63 || - 0x00002a66 <= c <= 0x00002a67 || - 0x00002a6a <= c <= 0x00002ad9 || - c == 0x00002adb || - 0x00002af7 <= c <= 0x00002afa || - 0x00002b30 <= c <= 0x00002b44 || - 0x00002b47 <= c <= 0x00002b4c || - 0x0000ffe9 <= c <= 0x0000ffec || - 0x00002aea <= c <= 0x00002aeb || - c == 0x00000387 || - c == 0x000000b7 + c == 0x000000a6 || + c == 0x0000002e || + c == 0x0000007e || + c == 0x000000ac || + c == 0x000000b1 || + c == 0x000000d7 || + c == 0x00002026 || + c == 0x0000205d || + c == 0x0000214b || + 0x00002190 <= c <= 0x00002194 || + 0x0000219a <= c <= 0x0000219e || + c == 0x000021a0 || + 0x000021a2 <= c <= 0x000021a4 || + 0x000021aa <= c <= 0x000021ac || + c == 0x000021a6 || + c == 0x000021a9 || + c == 0x000021ae || + c == 0x000021c0 || + c == 0x000021c1 || + c == 0x000021c4 || + c == 0x000021c6 || + c == 0x000021c7 || + c == 0x000021c9 || + 0x000021cb <= c <= 0x000021cf || + c == 0x000021d2 || + c == 0x000021d4 || + c == 0x000021b6 || + c == 0x000021b7 || + 0x000021ba <= c <= 0x000021bd || + c == 0x000021d0 || + 0x000021da <= c <= 0x000021dd || + c == 0x000021e0 || + c == 0x000021e2 || + 0x000021f4 <= c <= 0x000021ff || + 0x00002208 <= c <= 0x0000220d || + 0x00002213 <= c <= 0x00002214 || + 0x00002217 <= c <= 0x00002219 || + 0x0000221a <= c <= 0x0000221d || + 0x00002224 <= c <= 0x0000222a || + 0x00002237 <= c <= 0x00002238 || + 0x0000223a <= c <= 0x0000223b || + 0x0000223d <= c <= 0x0000223e || + 0x00002240 <= c <= 0x0000228b || + 0x0000228d <= c <= 0x0000229c || + 0x0000229e <= c <= 0x000022a3 || + c == 0x000022a9 || + c == 0x000022ac || + c == 0x000022ae || + 0x000022b0 <= c <= 0x000022b7 || + 0x000022bc <= c <= 0x000022bd || + 0x000022c4 <= c <= 0x000022c7 || + 0x000022c9 <= c <= 0x000022d3 || + 0x000022d5 <= c <= 0x000022ff || + c == 0x0000233f || + c == 0x000025b7 || + c == 0x000027c2 || + 0x000027c8 <= c <= 0x000027c9 || + 0x000027d1 <= c <= 0x000027d2 || + 0x000027d5 <= c <= 0x000027d7 || + 0x000027f0 <= c <= 0x000027f1 || + 0x000027f5 <= c <= 0x000027f7 || + 0x000027f9 <= c <= 0x000027ff || + 0x00002900 <= c <= 0x00002918 || + 0x0000291d <= c <= 0x00002920 || + 0x00002944 <= c <= 0x00002970 || + 0x000029b7 <= c <= 0x000029b8 || + c == 0x000029bc || + 0x000029be <= c <= 0x000029c1 || + c == 0x000029e1 || + 0x000029e3 <= c <= 0x000029e5 || + c == 0x000029f4 || + 0x000029f6 <= c <= 0x000029f7 || + 0x000029fa <= c <= 0x000029fb || + 0x00002a07 <= c <= 0x00002a08 || + c == 0x00002a1d || + c == 0x00002a1f || + 0x00002a22 <= c <= 0x00002a2e || + 0x00002a30 <= c <= 0x00002a3d || + 0x00002a40 <= c <= 0x00002a45 || + 0x00002a4a <= c <= 0x00002a58 || + 0x00002a5a <= c <= 0x00002a63 || + 0x00002a66 <= c <= 0x00002a67 || + 0x00002a6a <= c <= 0x00002ad9 || + c == 0x00002adb || + 0x00002af7 <= c <= 0x00002afa || + 0x00002b30 <= c <= 0x00002b44 || + 0x00002b47 <= c <= 0x00002b4c || + 0x0000ffe9 <= c <= 0x0000ffec || + 0x00002aea <= c <= 0x00002aeb || + c == 0x00000387 || + c == 0x000000b7 end function dotop2(pc, dpc) dotop1(pc) || - pc =='+' || - pc =='-' || - pc =='*' || - pc =='/' || - pc =='\\' || - pc =='^' || - pc =='<' || - pc =='>' || - pc =='&' && dpc === '=' || - pc =='&' || - pc =='%' || - pc == '=' && dpc != '>' || - pc == '|' && dpc != '|' || - pc == '!' && dpc == '=' || - pc == '⊻' || - pc == '÷' || - pc == '=' && dpc == '>' + pc == '+' || + pc == '-' || + pc == '*' || + pc == '/' || + pc == '\\' || + pc == '^' || + pc == '<' || + pc == '>' || + pc == '&' && dpc === '=' || + pc == '&' || + pc == '%' || + pc == '=' && dpc != '>' || + pc == '|' && dpc != '|' || + pc == '!' && dpc == '=' || + pc == '⊻' || + pc == '÷' || + pc == '=' && dpc == '>' end # suffix operators @@ -175,78 +175,322 @@ end return true end return 0x000000b2 <= c <= 0x000000b3 || - c == 0x000000b9 || - c == 0x000002b0 || - 0x000002b2 <= c <= 0x000002b3 || - 0x000002b7 <= c <= 0x000002b8 || - 0x000002e1 <= c <= 0x000002e3 || - c == 0x00000302 || - c == 0x00001d2c || - c == 0x00001d2e || - 0x00001d30 <= c <= 0x00001d31 || - 0x00001d33 <= c <= 0x00001d3a || - c == 0x00001d3c || - 0x00001d3e <= c <= 0x00001d43 || - 0x00001d47 <= c <= 0x00001d49 || - c == 0x00001d4d || - 0x00001d4f <= c <= 0x00001d50 || - c == 0x00001d52 || - 0x00001d56 <= c <= 0x00001d58 || - c == 0x00001d5b || - 0x00001d5d <= c <= 0x00001d6a || - c == 0x00001d9c || - c == 0x00001da0 || - 0x00001da5 <= c <= 0x00001da6 || - c == 0x00001dab || - c == 0x00001db0 || - c == 0x00001db8 || - c == 0x00001dbb || - c == 0x00001dbf || - c == 0x00002009 || - 0x00002032 <= c <= 0x00002037 || - c == 0x00002057 || - 0x00002070 <= c <= 0x00002071 || - 0x00002074 <= c <= 0x0000208e || - 0x00002090 <= c <= 0x00002093 || - 0x00002095 <= c <= 0x0000209c || - 0x00002c7c <= c <= 0x00002c7d || - 0x0000a71b <= c <= 0x0000a71d + c == 0x000000b9 || + c == 0x000002b0 || + 0x000002b2 <= c <= 0x000002b3 || + 0x000002b7 <= c <= 0x000002b8 || + 0x000002e1 <= c <= 0x000002e3 || + c == 0x00000302 || + c == 0x00001d2c || + c == 0x00001d2e || + 0x00001d30 <= c <= 0x00001d31 || + 0x00001d33 <= c <= 0x00001d3a || + c == 0x00001d3c || + 0x00001d3e <= c <= 0x00001d43 || + 0x00001d47 <= c <= 0x00001d49 || + c == 0x00001d4d || + 0x00001d4f <= c <= 0x00001d50 || + c == 0x00001d52 || + 0x00001d56 <= c <= 0x00001d58 || + c == 0x00001d5b || + 0x00001d5d <= c <= 0x00001d6a || + c == 0x00001d9c || + c == 0x00001da0 || + 0x00001da5 <= c <= 0x00001da6 || + c == 0x00001dab || + c == 0x00001db0 || + c == 0x00001db8 || + c == 0x00001dbb || + c == 0x00001dbf || + c == 0x00002009 || + 0x00002032 <= c <= 0x00002037 || + c == 0x00002057 || + 0x00002070 <= c <= 0x00002071 || + 0x00002074 <= c <= 0x0000208e || + 0x00002090 <= c <= 0x00002093 || + 0x00002095 <= c <= 0x0000209c || + 0x00002c7c <= c <= 0x00002c7d || + 0x0000a71b <= c <= 0x0000a71d end function optakessuffix(k) (Tokens.begin_ops < k < Tokens.end_ops) && - !( - k == Tokens.DDDOT || - Tokens.begin_assignments <= k <= Tokens.end_assignments || - k == Tokens.CONDITIONAL || - @static(if !CAN_DOT_LAZY_AND_OR - k == Tokens.LAZY_OR || - k == Tokens.LAZY_AND - else - false - end) || - k == Tokens.ISSUBTYPE || - k == Tokens.ISSUPERTYPE || - k == Tokens.IN || - k == Tokens.ISA || - k == Tokens.COLON_EQUALS || - k == Tokens.DOUBLE_COLON_EQUAL || - k == Tokens.COLON || - k == Tokens.DDOT || - k == Tokens.EX_OR || - k == Tokens.DECLARATION || - k == Tokens.WHERE || - k == Tokens.DOT || - k == Tokens.NOT || - k == Tokens.TRANSPOSE || - k == Tokens.ANON_FUNC || - Tokens.NOT_SIGN <= k <= Tokens.QUAD_ROOT - ) + !( + k == Tokens.DDDOT || + Tokens.begin_assignments <= k <= Tokens.end_assignments || + k == Tokens.CONDITIONAL || + @static(if !CAN_DOT_LAZY_AND_OR + k == Tokens.LAZY_OR || + k == Tokens.LAZY_AND + else + false + end) || + k == Tokens.ISSUBTYPE || + k == Tokens.ISSUPERTYPE || + k == Tokens.IN || + k == Tokens.ISA || + k == Tokens.COLON_EQUALS || + k == Tokens.DOUBLE_COLON_EQUAL || + k == Tokens.COLON || + k == Tokens.DDOT || + k == Tokens.EX_OR || + k == Tokens.DECLARATION || + k == Tokens.WHERE || + k == Tokens.DOT || + k == Tokens.NOT || + k == Tokens.TRANSPOSE || + k == Tokens.ANON_FUNC || + Tokens.NOT_SIGN <= k <= Tokens.QUAD_ROOT + ) end function is_operator_start_char(c::Char) eof(c) && return false is_operator_start_char(UInt32(c)) end -is_operator_start_char(u::UInt32) = u == 0x00000021 || (u == 0x00000024 || (u == 0x00000025 || (u == 0x00000026 || (u == 0x00000027 || (u == 0x0000002a || (u == 0x0000002b || (u == 0x0000002d || (u == 0x0000002e || (u == 0x0000002f || (u == 0x0000003a || (u == 0x0000003c || (u == 0x0000003d || (u == 0x0000003e || (u == 0x0000003f || (u == 0x0000005c || (u == 0x0000005e || (u == 0x00000069 || (u == 0x00000077 || (u == 0x0000007c || (u == 0x0000007e || (u == 0x000000ac || (u == 0x000000b1 || (u == 0x000000d7 || (u == 0x000000f7 || (u == 0x00002026 || (u == 0x0000205d || (u == 0x0000214b || (u == 0x00002190 || (u == 0x00002191 || (u == 0x00002192 || (u == 0x00002193 || (u == 0x00002194 || (u == 0x0000219a || (u == 0x0000219b || (u == 0x000021a0 || (u == 0x000021a3 || (u == 0x000021a6 || (u == 0x000021ae || (u == 0x000021ce || (u == 0x000021cf || (u == 0x000021d2 || (u == 0x000021d4 || (u == 0x000021f4 || (u == 0x000021f5 || (u == 0x000021f6 || (u == 0x000021f7 || (u == 0x000021f8 || (u == 0x000021f9 || (u == 0x000021fa || (u == 0x000021fb || (u == 0x000021fc || (u == 0x000021fd || (u == 0x000021fe || (u == 0x000021ff || (u == 0x00002208 || (u == 0x00002209 || (u == 0x0000220a || (u == 0x0000220b || (u == 0x0000220c || (u == 0x0000220d || (u == 0x00002213 || (u == 0x00002214 || (u == 0x00002217 || (u == 0x00002218 || (u == 0x00002219 || (u == 0x0000221a || (u == 0x0000221b || (u == 0x0000221c || (u == 0x0000221d || (u == 0x00002224 || (u == 0x00002225 || (u == 0x00002226 || (u == 0x00002227 || (u == 0x00002228 || (u == 0x00002229 || (u == 0x0000222a || (u == 0x00002237 || (u == 0x00002238 || (u == 0x0000223a || (u == 0x0000223b || (u == 0x0000223d || (u == 0x0000223e || (u == 0x00002240 || (u == 0x00002241 || (u == 0x00002242 || (u == 0x00002243 || (u == 0x00002244 || (u == 0x00002245 || (u == 0x00002246 || (u == 0x00002247 || (u == 0x00002248 || (u == 0x00002249 || (u == 0x0000224a || (u == 0x0000224b || (u == 0x0000224c || (u == 0x0000224d || (u == 0x0000224e || (u == 0x0000224f || (u == 0x00002250 || (u == 0x00002251 || (u == 0x00002252 || (u == 0x00002253 || (u == 0x00002254 || (u == 0x00002255 || (u == 0x00002256 || (u == 0x00002257 || (u == 0x00002258 || (u == 0x00002259 || (u == 0x0000225a || (u == 0x0000225b || (u == 0x0000225c || (u == 0x0000225d || (u == 0x0000225e || (u == 0x0000225f || (u == 0x00002260 || (u == 0x00002261 || (u == 0x00002262 || (u == 0x00002263 || (u == 0x00002264 || (u == 0x00002265 || (u == 0x00002266 || (u == 0x00002267 || (u == 0x00002268 || (u == 0x00002269 || (u == 0x0000226a || (u == 0x0000226b || (u == 0x0000226c || (u == 0x0000226d || (u == 0x0000226e || (u == 0x0000226f || (u == 0x00002270 || (u == 0x00002271 || (u == 0x00002272 || (u == 0x00002273 || (u == 0x00002274 || (u == 0x00002275 || (u == 0x00002276 || (u == 0x00002277 || (u == 0x00002278 || (u == 0x00002279 || (u == 0x0000227a || (u == 0x0000227b || (u == 0x0000227c || (u == 0x0000227d || (u == 0x0000227e || (u == 0x0000227f || (u == 0x00002280 || (u == 0x00002281 || (u == 0x00002282 || (u == 0x00002283 || (u == 0x00002284 || (u == 0x00002285 || (u == 0x00002286 || (u == 0x00002287 || (u == 0x00002288 || (u == 0x00002289 || (u == 0x0000228a || (u == 0x0000228b || (u == 0x0000228d || (u == 0x0000228e || (u == 0x0000228f || (u == 0x00002290 || (u == 0x00002291 || (u == 0x00002292 || (u == 0x00002293 || (u == 0x00002294 || (u == 0x00002295 || (u == 0x00002296 || (u == 0x00002297 || (u == 0x00002298 || (u == 0x00002299 || (u == 0x0000229a || (u == 0x0000229b || (u == 0x0000229c || (u == 0x0000229e || (u == 0x0000229f || (u == 0x000022a0 || (u == 0x000022a1 || (u == 0x000022a2 || (u == 0x000022a3 || (u == 0x000022a9 || (u == 0x000022ac || (u == 0x000022ae || (u == 0x000022b0 || (u == 0x000022b1 || (u == 0x000022b2 || (u == 0x000022b3 || (u == 0x000022b4 || (u == 0x000022b5 || (u == 0x000022b6 || (u == 0x000022b7 || (u == 0x000022bb || (u == 0x000022bc || (u == 0x000022bd || (u == 0x000022c4 || (u == 0x000022c5 || (u == 0x000022c6 || (u == 0x000022c7 || (u == 0x000022c9 || (u == 0x000022ca || (u == 0x000022cb || (u == 0x000022cc || (u == 0x000022cd || (u == 0x000022ce || (u == 0x000022cf || (u == 0x000022d0 || (u == 0x000022d1 || (u == 0x000022d2 || (u == 0x000022d3 || (u == 0x000022d5 || (u == 0x000022d6 || (u == 0x000022d7 || (u == 0x000022d8 || (u == 0x000022d9 || (u == 0x000022da || (u == 0x000022db || (u == 0x000022dc || (u == 0x000022dd || (u == 0x000022de || (u == 0x000022df || (u == 0x000022e0 || (u == 0x000022e1 || (u == 0x000022e2 || (u == 0x000022e3 || (u == 0x000022e4 || (u == 0x000022e5 || (u == 0x000022e6 || (u == 0x000022e7 || (u == 0x000022e8 || (u == 0x000022e9 || (u == 0x000022ea || (u == 0x000022eb || (u == 0x000022ec || (u == 0x000022ed || (u == 0x000022ee || (u == 0x000022ef || (u == 0x000022f0 || (u == 0x000022f1 || (u == 0x000022f2 || (u == 0x000022f3 || (u == 0x000022f4 || (u == 0x000022f5 || (u == 0x000022f6 || (u == 0x000022f7 || (u == 0x000022f8 || (u == 0x000022f9 || (u == 0x000022fa || (u == 0x000022fb || (u == 0x000022fc || (u == 0x000022fd || (u == 0x000022fe || (u == 0x000022ff || (u == 0x000025b7 || (u == 0x000027c2 || (u == 0x000027c8 || (u == 0x000027c9 || (u == 0x000027d1 || (u == 0x000027d2 || (u == 0x000027d5 || (u == 0x000027d6 || (u == 0x000027d7 || (u == 0x000027f0 || (u == 0x000027f1 || (u == 0x000027f5 || (u == 0x000027f6 || (u == 0x000027f7 || (u == 0x000027f9 || (u == 0x000027fa || (u == 0x000027fb || (u == 0x000027fc || (u == 0x000027fd || (u == 0x000027fe || (u == 0x000027ff || (u == 0x00002900 || (u == 0x00002901 || (u == 0x00002902 || (u == 0x00002903 || (u == 0x00002904 || (u == 0x00002905 || (u == 0x00002906 || (u == 0x00002907 || (u == 0x00002908 || (u == 0x00002909 || (u == 0x0000290a || (u == 0x0000290b || (u == 0x0000290c || (u == 0x0000290d || (u == 0x0000290e || (u == 0x0000290f || (u == 0x00002910 || (u == 0x00002911 || (u == 0x00002912 || (u == 0x00002913 || (u == 0x00002914 || (u == 0x00002915 || (u == 0x00002916 || (u == 0x00002917 || (u == 0x00002918 || (u == 0x0000291d || (u == 0x0000291e || (u == 0x0000291f || (u == 0x00002920 || (u == 0x00002944 || (u == 0x00002945 || (u == 0x00002946 || (u == 0x00002947 || (u == 0x00002948 || (u == 0x00002949 || (u == 0x0000294a || (u == 0x0000294b || (u == 0x0000294c || (u == 0x0000294d || (u == 0x0000294e || (u == 0x0000294f || (u == 0x00002950 || (u == 0x00002951 || (u == 0x00002952 || (u == 0x00002953 || (u == 0x00002954 || (u == 0x00002955 || (u == 0x00002956 || (u == 0x00002957 || (u == 0x00002958 || (u == 0x00002959 || (u == 0x0000295a || (u == 0x0000295b || (u == 0x0000295c || (u == 0x0000295d || (u == 0x0000295e || (u == 0x0000295f || (u == 0x00002960 || (u == 0x00002961 || (u == 0x00002962 || (u == 0x00002963 || (u == 0x00002964 || (u == 0x00002965 || (u == 0x00002966 || (u == 0x00002967 || (u == 0x00002968 || (u == 0x00002969 || (u == 0x0000296a || (u == 0x0000296b || (u == 0x0000296c || (u == 0x0000296d || (u == 0x0000296e || (u == 0x0000296f || (u == 0x00002970 || (u == 0x000029b7 || (u == 0x000029b8 || (u == 0x000029bc || (u == 0x000029be || (u == 0x000029bf || (u == 0x000029c0 || (u == 0x000029c1 || (u == 0x000029e1 || (u == 0x000029e3 || (u == 0x000029e4 || (u == 0x000029e5 || (u == 0x000029f4 || (u == 0x000029f6 || (u == 0x000029f7 || (u == 0x000029fa || (u == 0x000029fb || (u == 0x00002a07 || (u == 0x00002a08 || (u == 0x00002a1d || (u == 0x00002a22 || (u == 0x00002a23 || (u == 0x00002a24 || (u == 0x00002a25 || (u == 0x00002a26 || (u == 0x00002a27 || (u == 0x00002a28 || (u == 0x00002a29 || (u == 0x00002a2a || (u == 0x00002a2b || (u == 0x00002a2c || (u == 0x00002a2d || (u == 0x00002a2e || (u == 0x00002a30 || (u == 0x00002a31 || (u == 0x00002a32 || (u == 0x00002a33 || (u == 0x00002a34 || (u == 0x00002a35 || (u == 0x00002a36 || (u == 0x00002a37 || (u == 0x00002a38 || (u == 0x00002a39 || (u == 0x00002a3a || (u == 0x00002a3b || (u == 0x00002a3c || (u == 0x00002a3d || (u == 0x00002a40 || (u == 0x00002a41 || (u == 0x00002a42 || (u == 0x00002a43 || (u == 0x00002a44 || (u == 0x00002a45 || (u == 0x00002a4a || (u == 0x00002a4b || (u == 0x00002a4c || (u == 0x00002a4d || (u == 0x00002a4e || (u == 0x00002a4f || (u == 0x00002a50 || (u == 0x00002a51 || (u == 0x00002a52 || (u == 0x00002a53 || (u == 0x00002a54 || (u == 0x00002a55 || (u == 0x00002a56 || (u == 0x00002a57 || (u == 0x00002a58 || (u == 0x00002a5a || (u == 0x00002a5b || (u == 0x00002a5c || (u == 0x00002a5d || (u == 0x00002a5e || (u == 0x00002a5f || (u == 0x00002a60 || (u == 0x00002a61 || (u == 0x00002a62 || (u == 0x00002a63 || (u == 0x00002a66 || (u == 0x00002a67 || (u == 0x00002a6a || (u == 0x00002a6b || (u == 0x00002a6c || (u == 0x00002a6d || (u == 0x00002a6e || (u == 0x00002a6f || (u == 0x00002a70 || (u == 0x00002a71 || (u == 0x00002a72 || (u == 0x00002a73 || (u == 0x00002a74 || (u == 0x00002a75 || (u == 0x00002a76 || (u == 0x00002a77 || (u == 0x00002a78 || (u == 0x00002a79 || (u == 0x00002a7a || (u == 0x00002a7b || (u == 0x00002a7c || (u == 0x00002a7d || (u == 0x00002a7e || (u == 0x00002a7f || (u == 0x00002a80 || (u == 0x00002a81 || (u == 0x00002a82 || (u == 0x00002a83 || (u == 0x00002a84 || (u == 0x00002a85 || (u == 0x00002a86 || (u == 0x00002a87 || (u == 0x00002a88 || (u == 0x00002a89 || (u == 0x00002a8a || (u == 0x00002a8b || (u == 0x00002a8c || (u == 0x00002a8d || (u == 0x00002a8e || (u == 0x00002a8f || (u == 0x00002a90 || (u == 0x00002a91 || (u == 0x00002a92 || (u == 0x00002a93 || (u == 0x00002a94 || (u == 0x00002a95 || (u == 0x00002a96 || (u == 0x00002a97 || (u == 0x00002a98 || (u == 0x00002a99 || (u == 0x00002a9a || (u == 0x00002a9b || (u == 0x00002a9c || (u == 0x00002a9d || (u == 0x00002a9e || (u == 0x00002a9f || (u == 0x00002aa0 || (u == 0x00002aa1 || (u == 0x00002aa2 || (u == 0x00002aa3 || (u == 0x00002aa4 || (u == 0x00002aa5 || (u == 0x00002aa6 || (u == 0x00002aa7 || (u == 0x00002aa8 || (u == 0x00002aa9 || (u == 0x00002aaa || (u == 0x00002aab || (u == 0x00002aac || (u == 0x00002aad || (u == 0x00002aae || (u == 0x00002aaf || (u == 0x00002ab0 || (u == 0x00002ab1 || (u == 0x00002ab2 || (u == 0x00002ab3 || (u == 0x00002ab4 || (u == 0x00002ab5 || (u == 0x00002ab6 || (u == 0x00002ab7 || (u == 0x00002ab8 || (u == 0x00002ab9 || (u == 0x00002aba || (u == 0x00002abb || (u == 0x00002abc || (u == 0x00002abd || (u == 0x00002abe || (u == 0x00002abf || (u == 0x00002ac0 || (u == 0x00002ac1 || (u == 0x00002ac2 || (u == 0x00002ac3 || (u == 0x00002ac4 || (u == 0x00002ac5 || (u == 0x00002ac6 || (u == 0x00002ac7 || (u == 0x00002ac8 || (u == 0x00002ac9 || (u == 0x00002aca || (u == 0x00002acb || (u == 0x00002acc || (u == 0x00002acd || (u == 0x00002ace || (u == 0x00002acf || (u == 0x00002ad0 || (u == 0x00002ad1 || (u == 0x00002ad2 || (u == 0x00002ad3 || (u == 0x00002ad4 || (u == 0x00002ad5 || (u == 0x00002ad6 || (u == 0x00002ad7 || (u == 0x00002ad8 || (u == 0x00002ad9 || (u == 0x00002adb || (u == 0x00002af7 || (u == 0x00002af8 || (u == 0x00002af9 || (u == 0x00002afa || (u == 0x00002b30 || (u == 0x00002b31 || (u == 0x00002b32 || (u == 0x00002b33 || (u == 0x00002b34 || (u == 0x00002b35 || (u == 0x00002b36 || (u == 0x00002b37 || (u == 0x00002b38 || (u == 0x00002b39 || (u == 0x00002b3a || (u == 0x00002b3b || (u == 0x00002b3c || (u == 0x00002b3d || (u == 0x00002b3e || (u == 0x00002b3f || (u == 0x00002b40 || (u == 0x00002b41 || (u == 0x00002b42 || (u == 0x00002b43 || (u == 0x00002b44 || (u == 0x00002b47 || (u == 0x00002b48 || (u == 0x00002b49 || (u == 0x00002b4a || (u == 0x00002b4b || (u == 0x00002b4c || (u == 0x0000ffe9 || (u == 0x0000ffea || (u == 0x0000ffeb || u == 0x0000ffec))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +is_operator_start_char(u::UInt32) = + u == 0x00000021 || ( + u == 0x00000024 || ( + u == 0x00000025 || ( + u == 0x00000026 || ( + u == 0x00000027 || ( + u == 0x0000002a || ( + u == 0x0000002b || ( + u == 0x0000002d || ( + u == 0x0000002e || ( + u == 0x0000002f || ( + u == 0x0000003a || ( + u == 0x0000003c || ( + u == 0x0000003d || ( + u == 0x0000003e || ( + u == 0x0000003f || ( + u == 0x0000005c || ( + u == 0x0000005e || ( + u == 0x00000069 || ( + u == 0x00000077 || ( + u == 0x0000007c || ( + u == 0x0000007e || ( + u == 0x000000ac || ( + u == 0x000000b1 || ( + u == 0x000000d7 || ( + u == 0x000000f7 || ( + u == 0x00002026 || ( + u == 0x0000205d || ( + u == 0x0000214b || ( + u == 0x00002190 || ( + u == 0x00002191 || ( + u == 0x00002192 || ( + u == 0x00002193 || ( + u == 0x00002194 || ( + u == 0x0000219a || ( + u == 0x0000219b || ( + u == 0x000021a0 || ( + u == 0x000021a3 || ( + u == 0x000021a6 || ( + u == 0x000021ae || ( + u == 0x000021ce || ( + u == 0x000021cf || ( + u == 0x000021d2 || ( + u == 0x000021d4 || ( + u == 0x000021f4 || ( + u == 0x000021f5 || ( + u == 0x000021f6 || ( + u == 0x000021f7 || ( + u == 0x000021f8 || ( + u == 0x000021f9 || ( + u == 0x000021fa || ( + u == 0x000021fb || ( + u == 0x000021fc || ( + u == 0x000021fd || ( + u == 0x000021fe || ( + u == 0x000021ff || ( + u == 0x00002208 || ( + u == 0x00002209 || ( + u == 0x0000220a || ( + u == 0x0000220b || ( + u == 0x0000220c || ( + u == 0x0000220d || ( + u == 0x00002213 || ( + u == 0x00002214 || ( + u == 0x00002217 || ( + u == 0x00002218 || ( + u == 0x00002219 || ( + u == 0x0000221a || ( + u == 0x0000221b || ( + u == 0x0000221c || ( + u == 0x0000221d || ( + u == 0x00002224 || ( + u == 0x00002225 || ( + u == 0x00002226 || ( + u == 0x00002227 || ( + u == 0x00002228 || ( + u == 0x00002229 || ( + u == 0x0000222a || ( + u == 0x00002237 || ( + u == 0x00002238 || ( + u == 0x0000223a || ( + u == 0x0000223b || ( + u == 0x0000223d || ( + u == 0x0000223e || ( + u == 0x00002240 || ( + u == 0x00002241 || ( + u == 0x00002242 || ( + u == 0x00002243 || ( + u == 0x00002244 || ( + u == 0x00002245 || ( + u == 0x00002246 || ( + u == 0x00002247 || ( + u == 0x00002248 || ( + u == 0x00002249 || ( + u == 0x0000224a || ( + u == 0x0000224b || ( + u == 0x0000224c || ( + u == 0x0000224d || ( + u == 0x0000224e || ( + u == 0x0000224f || ( + u == 0x00002250 || ( + u == 0x00002251 || ( + u == 0x00002252 || ( + u == 0x00002253 || ( + u == 0x00002254 || ( + u == 0x00002255 || ( + u == 0x00002256 || ( + u == 0x00002257 || ( + u == 0x00002258 || ( + u == 0x00002259 || ( + u == 0x0000225a || ( + u == 0x0000225b || ( + u == 0x0000225c || ( + u == 0x0000225d || ( + u == 0x0000225e || ( + u == 0x0000225f || ( + u == 0x00002260 || ( + u == 0x00002261 || ( + u == 0x00002262 || ( + u == 0x00002263 || ( + u == 0x00002264 || ( + u == 0x00002265 || ( + u == 0x00002266 || + (u == 0x00002267 || (u == 0x00002268 || (u == 0x00002269 || (u == 0x0000226a || (u == 0x0000226b || (u == 0x0000226c || (u == 0x0000226d || (u == 0x0000226e || (u == 0x0000226f || (u == 0x00002270 || (u == 0x00002271 || (u == 0x00002272 || (u == 0x00002273 || (u == 0x00002274 || (u == 0x00002275 || (u == 0x00002276 || (u == 0x00002277 || (u == 0x00002278 || (u == 0x00002279 || (u == 0x0000227a || (u == 0x0000227b || (u == 0x0000227c || (u == 0x0000227d || (u == 0x0000227e || (u == 0x0000227f || (u == 0x00002280 || (u == 0x00002281 || (u == 0x00002282 || (u == 0x00002283 || (u == 0x00002284 || (u == 0x00002285 || (u == 0x00002286 || (u == 0x00002287 || (u == 0x00002288 || (u == 0x00002289 || (u == 0x0000228a || (u == 0x0000228b || (u == 0x0000228d || (u == 0x0000228e || (u == 0x0000228f || (u == 0x00002290 || (u == 0x00002291 || (u == 0x00002292 || (u == 0x00002293 || (u == 0x00002294 || (u == 0x00002295 || (u == 0x00002296 || (u == 0x00002297 || (u == 0x00002298 || (u == 0x00002299 || (u == 0x0000229a || (u == 0x0000229b || (u == 0x0000229c || (u == 0x0000229e || (u == 0x0000229f || (u == 0x000022a0 || (u == 0x000022a1 || (u == 0x000022a2 || (u == 0x000022a3 || (u == 0x000022a9 || (u == 0x000022ac || (u == 0x000022ae || (u == 0x000022b0 || (u == 0x000022b1 || (u == 0x000022b2 || (u == 0x000022b3 || (u == 0x000022b4 || (u == 0x000022b5 || (u == 0x000022b6 || (u == 0x000022b7 || (u == 0x000022bb || (u == 0x000022bc || (u == 0x000022bd || (u == 0x000022c4 || (u == 0x000022c5 || (u == 0x000022c6 || (u == 0x000022c7 || (u == 0x000022c9 || (u == 0x000022ca || (u == 0x000022cb || (u == 0x000022cc || (u == 0x000022cd || (u == 0x000022ce || (u == 0x000022cf || (u == 0x000022d0 || (u == 0x000022d1 || (u == 0x000022d2 || (u == 0x000022d3 || (u == 0x000022d5 || (u == 0x000022d6 || (u == 0x000022d7 || (u == 0x000022d8 || (u == 0x000022d9 || (u == 0x000022da || (u == 0x000022db || (u == 0x000022dc || (u == 0x000022dd || (u == 0x000022de || (u == 0x000022df || (u == 0x000022e0 || (u == 0x000022e1 || (u == 0x000022e2 || (u == 0x000022e3 || (u == 0x000022e4 || (u == 0x000022e5 || (u == 0x000022e6 || (u == 0x000022e7 || (u == 0x000022e8 || (u == 0x000022e9 || (u == 0x000022ea || (u == 0x000022eb || (u == 0x000022ec || (u == 0x000022ed || (u == 0x000022ee || (u == 0x000022ef || (u == 0x000022f0 || (u == 0x000022f1 || (u == 0x000022f2 || (u == 0x000022f3 || (u == 0x000022f4 || (u == 0x000022f5 || (u == 0x000022f6 || (u == 0x000022f7 || (u == 0x000022f8 || (u == 0x000022f9 || (u == 0x000022fa || (u == 0x000022fb || (u == 0x000022fc || (u == 0x000022fd || (u == 0x000022fe || (u == 0x000022ff || (u == 0x000025b7 || (u == 0x000027c2 || (u == 0x000027c8 || (u == 0x000027c9 || (u == 0x000027d1 || (u == 0x000027d2 || (u == 0x000027d5 || (u == 0x000027d6 || (u == 0x000027d7 || (u == 0x000027f0 || (u == 0x000027f1 || (u == 0x000027f5 || (u == 0x000027f6 || (u == 0x000027f7 || (u == 0x000027f9 || (u == 0x000027fa || (u == 0x000027fb || (u == 0x000027fc || (u == 0x000027fd || (u == 0x000027fe || (u == 0x000027ff || (u == 0x00002900 || (u == 0x00002901 || (u == 0x00002902 || (u == 0x00002903 || (u == 0x00002904 || (u == 0x00002905 || (u == 0x00002906 || (u == 0x00002907 || (u == 0x00002908 || (u == 0x00002909 || (u == 0x0000290a || (u == 0x0000290b || (u == 0x0000290c || (u == 0x0000290d || (u == 0x0000290e || (u == 0x0000290f || (u == 0x00002910 || (u == 0x00002911 || (u == 0x00002912 || (u == 0x00002913 || (u == 0x00002914 || (u == 0x00002915 || (u == 0x00002916 || (u == 0x00002917 || (u == 0x00002918 || (u == 0x0000291d || (u == 0x0000291e || (u == 0x0000291f || (u == 0x00002920 || (u == 0x00002944 || (u == 0x00002945 || (u == 0x00002946 || (u == 0x00002947 || (u == 0x00002948 || (u == 0x00002949 || (u == 0x0000294a || (u == 0x0000294b || (u == 0x0000294c || (u == 0x0000294d || (u == 0x0000294e || (u == 0x0000294f || (u == 0x00002950 || (u == 0x00002951 || (u == 0x00002952 || (u == 0x00002953 || (u == 0x00002954 || (u == 0x00002955 || (u == 0x00002956 || (u == 0x00002957 || (u == 0x00002958 || (u == 0x00002959 || (u == 0x0000295a || (u == 0x0000295b || (u == 0x0000295c || (u == 0x0000295d || (u == 0x0000295e || (u == 0x0000295f || (u == 0x00002960 || (u == 0x00002961 || (u == 0x00002962 || (u == 0x00002963 || (u == 0x00002964 || (u == 0x00002965 || (u == 0x00002966 || (u == 0x00002967 || (u == 0x00002968 || (u == 0x00002969 || (u == 0x0000296a || (u == 0x0000296b || (u == 0x0000296c || (u == 0x0000296d || (u == 0x0000296e || (u == 0x0000296f || (u == 0x00002970 || (u == 0x000029b7 || (u == 0x000029b8 || (u == 0x000029bc || (u == 0x000029be || (u == 0x000029bf || (u == 0x000029c0 || (u == 0x000029c1 || (u == 0x000029e1 || (u == 0x000029e3 || (u == 0x000029e4 || (u == 0x000029e5 || (u == 0x000029f4 || (u == 0x000029f6 || (u == 0x000029f7 || (u == 0x000029fa || (u == 0x000029fb || (u == 0x00002a07 || (u == 0x00002a08 || (u == 0x00002a1d || (u == 0x00002a22 || (u == 0x00002a23 || (u == 0x00002a24 || (u == 0x00002a25 || (u == 0x00002a26 || (u == 0x00002a27 || (u == 0x00002a28 || (u == 0x00002a29 || (u == 0x00002a2a || (u == 0x00002a2b || (u == 0x00002a2c || (u == 0x00002a2d || (u == 0x00002a2e || (u == 0x00002a30 || (u == 0x00002a31 || (u == 0x00002a32 || (u == 0x00002a33 || (u == 0x00002a34 || (u == 0x00002a35 || (u == 0x00002a36 || (u == 0x00002a37 || (u == 0x00002a38 || (u == 0x00002a39 || (u == 0x00002a3a || (u == 0x00002a3b || (u == 0x00002a3c || (u == 0x00002a3d || (u == 0x00002a40 || (u == 0x00002a41 || (u == 0x00002a42 || (u == 0x00002a43 || (u == 0x00002a44 || (u == 0x00002a45 || (u == 0x00002a4a || (u == 0x00002a4b || (u == 0x00002a4c || (u == 0x00002a4d || (u == 0x00002a4e || (u == 0x00002a4f || (u == 0x00002a50 || (u == 0x00002a51 || (u == 0x00002a52 || (u == 0x00002a53 || (u == 0x00002a54 || (u == 0x00002a55 || (u == 0x00002a56 || (u == 0x00002a57 || (u == 0x00002a58 || (u == 0x00002a5a || (u == 0x00002a5b || (u == 0x00002a5c || (u == 0x00002a5d || (u == 0x00002a5e || (u == 0x00002a5f || (u == 0x00002a60 || (u == 0x00002a61 || (u == 0x00002a62 || (u == 0x00002a63 || (u == 0x00002a66 || (u == 0x00002a67 || (u == 0x00002a6a || (u == 0x00002a6b || (u == 0x00002a6c || (u == 0x00002a6d || (u == 0x00002a6e || (u == 0x00002a6f || (u == 0x00002a70 || (u == 0x00002a71 || (u == 0x00002a72 || (u == 0x00002a73 || (u == 0x00002a74 || (u == 0x00002a75 || (u == 0x00002a76 || (u == 0x00002a77 || (u == 0x00002a78 || (u == 0x00002a79 || (u == 0x00002a7a || (u == 0x00002a7b || (u == 0x00002a7c || (u == 0x00002a7d || (u == 0x00002a7e || (u == 0x00002a7f || (u == 0x00002a80 || (u == 0x00002a81 || (u == 0x00002a82 || (u == 0x00002a83 || (u == 0x00002a84 || (u == 0x00002a85 || (u == 0x00002a86 || (u == 0x00002a87 || (u == 0x00002a88 || (u == 0x00002a89 || (u == 0x00002a8a || (u == 0x00002a8b || (u == 0x00002a8c || (u == 0x00002a8d || (u == 0x00002a8e || (u == 0x00002a8f || (u == 0x00002a90 || (u == 0x00002a91 || (u == 0x00002a92 || (u == 0x00002a93 || (u == 0x00002a94 || (u == 0x00002a95 || (u == 0x00002a96 || (u == 0x00002a97 || (u == 0x00002a98 || (u == 0x00002a99 || (u == 0x00002a9a || (u == 0x00002a9b || (u == 0x00002a9c || (u == 0x00002a9d || (u == 0x00002a9e || (u == 0x00002a9f || (u == 0x00002aa0 || (u == 0x00002aa1 || (u == 0x00002aa2 || (u == 0x00002aa3 || (u == 0x00002aa4 || (u == 0x00002aa5 || (u == 0x00002aa6 || (u == 0x00002aa7 || (u == 0x00002aa8 || (u == 0x00002aa9 || (u == 0x00002aaa || (u == 0x00002aab || (u == 0x00002aac || (u == 0x00002aad || (u == 0x00002aae || (u == 0x00002aaf || (u == 0x00002ab0 || (u == 0x00002ab1 || (u == 0x00002ab2 || (u == 0x00002ab3 || (u == 0x00002ab4 || (u == 0x00002ab5 || (u == 0x00002ab6 || (u == 0x00002ab7 || (u == 0x00002ab8 || (u == 0x00002ab9 || (u == 0x00002aba || (u == 0x00002abb || (u == 0x00002abc || (u == 0x00002abd || (u == 0x00002abe || (u == 0x00002abf || (u == 0x00002ac0 || (u == 0x00002ac1 || (u == 0x00002ac2 || (u == 0x00002ac3 || (u == 0x00002ac4 || (u == 0x00002ac5 || (u == 0x00002ac6 || (u == 0x00002ac7 || (u == 0x00002ac8 || (u == 0x00002ac9 || (u == 0x00002aca || (u == 0x00002acb || (u == 0x00002acc || (u == 0x00002acd || (u == 0x00002ace || (u == 0x00002acf || (u == 0x00002ad0 || (u == 0x00002ad1 || (u == 0x00002ad2 || (u == 0x00002ad3 || (u == 0x00002ad4 || (u == 0x00002ad5 || (u == 0x00002ad6 || (u == 0x00002ad7 || (u == 0x00002ad8 || (u == 0x00002ad9 || (u == 0x00002adb || (u == 0x00002af7 || (u == 0x00002af8 || (u == 0x00002af9 || (u == 0x00002afa || (u == 0x00002b30 || (u == 0x00002b31 || (u == 0x00002b32 || (u == 0x00002b33 || (u == 0x00002b34 || (u == 0x00002b35 || (u == 0x00002b36 || (u == 0x00002b37 || (u == 0x00002b38 || (u == 0x00002b39 || (u == 0x00002b3a || (u == 0x00002b3b || (u == 0x00002b3c || (u == 0x00002b3d || (u == 0x00002b3e || (u == 0x00002b3f || (u == 0x00002b40 || (u == 0x00002b41 || (u == 0x00002b42 || (u == 0x00002b43 || (u == 0x00002b44 || (u == 0x00002b47 || (u == 0x00002b48 || (u == 0x00002b49 || (u == 0x00002b4a || (u == 0x00002b4b || (u == 0x00002b4c || (u == 0x0000ffe9 || (u == 0x0000ffea || (u == 0x0000ffeb || u == 0x0000ffec)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) diff --git a/packages/Tokenize/test/lex_yourself.jl b/packages/Tokenize/test/lex_yourself.jl index bb88a31..9ad00bb 100644 --- a/packages/Tokenize/test/lex_yourself.jl +++ b/packages/Tokenize/test/lex_yourself.jl @@ -1,64 +1,64 @@ @testset "lex yourself" begin -PKGPATH = joinpath(dirname(@__FILE__), "..") + PKGPATH = joinpath(dirname(@__FILE__), "..") -global tot_files = 0 -global tot_time = 0.0 -global tot_tokens = 0 -global tot_errors = 0 -function testall(srcdir::AbstractString) - global tot_files, tot_time, tot_tokens, tot_errors - dirs, files = [], [] + global tot_files = 0 + global tot_time = 0.0 + global tot_tokens = 0 + global tot_errors = 0 + function testall(srcdir::AbstractString) + global tot_files, tot_time, tot_tokens, tot_errors + dirs, files = [], [] - for fname in sort(readdir(srcdir)) - path = joinpath(srcdir, fname) - if isdir(path) - push!(dirs, path) - continue - end - _, ext = splitext(fname) - if ext == ".jl" - push!(files, path) + for fname in sort(readdir(srcdir)) + path = joinpath(srcdir, fname) + if isdir(path) + push!(dirs, path) + continue + end + _, ext = splitext(fname) + if ext == ".jl" + push!(files, path) + end end - end - if !isempty(files) - for jlpath in files + if !isempty(files) + for jlpath in files - fname = splitdir(jlpath)[end] + fname = splitdir(jlpath)[end] - buf = IOBuffer() - print(buf, open(read, jlpath)) - seek(buf, 0) - tot_files += 1 - tot_time += @elapsed tokens = collect(Tokenize.tokenize(buf)) - tot_tokens += length(tokens) + buf = IOBuffer() + print(buf, open(read, jlpath)) + seek(buf, 0) + tot_files += 1 + tot_time += @elapsed tokens = collect(Tokenize.tokenize(buf)) + tot_tokens += length(tokens) - seek(buf, 0) - str = String(take!(buf)) + seek(buf, 0) + str = String(take!(buf)) - collect(Tokenize.tokenize(str)) + collect(Tokenize.tokenize(str)) - for token in tokens - if Tokenize.Tokens.kind(token) == Tokenize.Tokens.ERROR - tot_errors += 1 + for token in tokens + if Tokenize.Tokens.kind(token) == Tokenize.Tokens.ERROR + tot_errors += 1 + end end end end + for dir in dirs + testall(dir) + end end - for dir in dirs - testall(dir) - end -end -testall(joinpath(PKGPATH, "benchmark")) -testall(joinpath(PKGPATH, "src")) -testall(joinpath(PKGPATH, "test")) -testall(joinpath(Sys.BINDIR, Base.DATAROOTDIR)) + testall(joinpath(PKGPATH, "benchmark")) + testall(joinpath(PKGPATH, "src")) + testall(joinpath(PKGPATH, "test")) + testall(joinpath(Sys.BINDIR, Base.DATAROOTDIR)) -println("Lexed ", tot_files, " files in ", @sprintf("%3.4f", tot_time), + println("Lexed ", tot_files, " files in ", @sprintf("%3.4f", tot_time), " seconds with a total of ", tot_tokens, " tokens with ", tot_errors, " errors") -@test tot_errors == 0 + @test tot_errors == 0 end # testset diff --git a/packages/Tokenize/test/lexer.jl b/packages/Tokenize/test/lexer.jl index 4191be3..a7f15be 100644 --- a/packages/Tokenize/test/lexer.jl +++ b/packages/Tokenize/test/lexer.jl @@ -4,7 +4,7 @@ using Test const T = Tokenize.Tokens -tok(str, i = 1) = collect(tokenize(str))[i] +tok(str, i=1) = collect(tokenize(str))[i] @testset "tokens" begin for s in ["a", IOBuffer("a")] @@ -26,11 +26,11 @@ end # testset for s in [str, IOBuffer(str)] l = tokenize(s) kinds = [T.IDENTIFIER, T.WHITESPACE, T.OP, - T.INTEGER, T.IDENTIFIER, T.ENDMARKER] + T.INTEGER, T.IDENTIFIER, T.ENDMARKER] token_strs = ["𝘋", " ", "=", "2", "β", ""] for (i, n) in enumerate(l) @test T.kind(n) == kinds[i] - @test untokenize(n) == token_strs[i] + @test untokenize(n) == token_strs[i] @test T.startpos(n) == (1, i) @test T.endpos(n) == (1, i - 1 + length(token_strs[i])) end @@ -73,53 +73,19 @@ end # testset # ``` # and *check* it afterwards. - kinds = [T.KEYWORD,T.WHITESPACE,T.IDENTIFIER,T.LBRACE,T.IDENTIFIER, - T.OP,T.IDENTIFIER,T.RBRACE,T.LPAREN,T.IDENTIFIER,T.OP, - T.LBRACE,T.IDENTIFIER,T.RBRACE,T.OP,T.INTEGER,T.RPAREN, - - T.WHITESPACE,T.AT_SIGN,T.IDENTIFIER,T.WHITESPACE,T.LPAREN, - T.IDENTIFIER,T.OP,T.IDENTIFIER,T.COMMA,T.WHITESPACE, - T.IDENTIFIER,T.OP,T.IDENTIFIER,T.RPAREN,T.SEMICOLON, - - T.WHITESPACE,T.KEYWORD, - - T.WHITESPACE,T.KEYWORD, - T.WHITESPACE,T.IDENTIFIER, - T.WHITESPACE,T.KEYWORD, - T.WHITESPACE,T.IDENTIFIER, - T.WHITESPACE,T.KEYWORD, - - T.WHITESPACE,T.AT_SIGN,T.IDENTIFIER,T.WHITESPACE,T.IDENTIFIER, - T.OP,T.IDENTIFIER, - - T.WHITESPACE,T.IDENTIFIER,T.LSQUARE,T.LSQUARE,T.INTEGER,T.WHITESPACE, - T.INTEGER,T.WHITESPACE,T.INTEGER,T.RSQUARE,T.RSQUARE, - - T.WHITESPACE,T.LSQUARE,T.INTEGER,T.OP,T.INTEGER,T.COMMA,T.INTEGER, - T.SEMICOLON,T.INTEGER,T.COMMA,T.INTEGER,T.RSQUARE, - - T.WHITESPACE,T.STRING,T.SEMICOLON,T.WHITESPACE,T.CHAR, - - T.WHITESPACE,T.LPAREN,T.IDENTIFIER,T.OP,T.IDENTIFIER,T.RPAREN,T.OP, - T.LPAREN,T.IDENTIFIER,T.OP,T.IDENTIFIER,T.RPAREN, - - T.WHITESPACE,T.COMMENT, - - T.WHITESPACE,T.COMMENT, - - T.WHITESPACE,T.INTEGER,T.OP,T.INTEGER, - - T.WHITESPACE,T.IDENTIFIER,T.OP,T.OP,T.IDENTIFIER,T.OP, - - T.WHITESPACE,T.IDENTIFIER,T.OP,T.OP,T.OP,T.IDENTIFIER,T.OP,T.OP, - - T.WHITESPACE,T.CMD, - - T.WHITESPACE,T.INTEGER,T.IDENTIFIER,T.LPAREN,T.INTEGER,T.RPAREN, - - T.WHITESPACE,T.LBRACE,T.RBRACE, - - T.WHITESPACE,T.ERROR,T.ENDMARKER] + kinds = [T.KEYWORD, T.WHITESPACE, T.IDENTIFIER, T.LBRACE, T.IDENTIFIER, + T.OP, T.IDENTIFIER, T.RBRACE, T.LPAREN, T.IDENTIFIER, T.OP, + T.LBRACE, T.IDENTIFIER, T.RBRACE, T.OP, T.INTEGER, T.RPAREN, T.WHITESPACE, T.AT_SIGN, T.IDENTIFIER, T.WHITESPACE, T.LPAREN, + T.IDENTIFIER, T.OP, T.IDENTIFIER, T.COMMA, T.WHITESPACE, + T.IDENTIFIER, T.OP, T.IDENTIFIER, T.RPAREN, T.SEMICOLON, T.WHITESPACE, T.KEYWORD, T.WHITESPACE, T.KEYWORD, + T.WHITESPACE, T.IDENTIFIER, + T.WHITESPACE, T.KEYWORD, + T.WHITESPACE, T.IDENTIFIER, + T.WHITESPACE, T.KEYWORD, T.WHITESPACE, T.AT_SIGN, T.IDENTIFIER, T.WHITESPACE, T.IDENTIFIER, + T.OP, T.IDENTIFIER, T.WHITESPACE, T.IDENTIFIER, T.LSQUARE, T.LSQUARE, T.INTEGER, T.WHITESPACE, + T.INTEGER, T.WHITESPACE, T.INTEGER, T.RSQUARE, T.RSQUARE, T.WHITESPACE, T.LSQUARE, T.INTEGER, T.OP, T.INTEGER, T.COMMA, T.INTEGER, + T.SEMICOLON, T.INTEGER, T.COMMA, T.INTEGER, T.RSQUARE, T.WHITESPACE, T.STRING, T.SEMICOLON, T.WHITESPACE, T.CHAR, T.WHITESPACE, T.LPAREN, T.IDENTIFIER, T.OP, T.IDENTIFIER, T.RPAREN, T.OP, + T.LPAREN, T.IDENTIFIER, T.OP, T.IDENTIFIER, T.RPAREN, T.WHITESPACE, T.COMMENT, T.WHITESPACE, T.COMMENT, T.WHITESPACE, T.INTEGER, T.OP, T.INTEGER, T.WHITESPACE, T.IDENTIFIER, T.OP, T.OP, T.IDENTIFIER, T.OP, T.WHITESPACE, T.IDENTIFIER, T.OP, T.OP, T.OP, T.IDENTIFIER, T.OP, T.OP, T.WHITESPACE, T.CMD, T.WHITESPACE, T.INTEGER, T.IDENTIFIER, T.LPAREN, T.INTEGER, T.RPAREN, T.WHITESPACE, T.LBRACE, T.RBRACE, T.WHITESPACE, T.ERROR, T.ENDMARKER] for (i, n) in enumerate(tokenize(str)) @test Tokens.kind(n) == kinds[i] @@ -135,42 +101,42 @@ end # testset @test_throws ArgumentError untokenize("blabla") end - @test all((t.endbyte - t.startbyte + 1)==sizeof(untokenize(t)) for t in tokenize(str)) + @test all((t.endbyte - t.startbyte + 1) == sizeof(untokenize(t)) for t in tokenize(str)) end # testset @testset "issue 5, '..'" begin - @test Tokens.kind.(collect(tokenize("1.23..3.21"))) == [T.FLOAT,T.OP,T.FLOAT,T.ENDMARKER] + @test Tokens.kind.(collect(tokenize("1.23..3.21"))) == [T.FLOAT, T.OP, T.FLOAT, T.ENDMARKER] end @testset "issue 17, >>" begin - @test untokenize(tok(">> "))==">>" + @test untokenize(tok(">> ")) == ">>" end @testset "test added operators" begin - @test tok("1+=2", 2).kind == T.PLUS_EQ - @test tok("1-=2", 2).kind == T.MINUS_EQ - @test tok("1:=2", 2).kind == T.COLON_EQ - @test tok("1*=2", 2).kind == T.STAR_EQ - @test tok("1^=2", 2).kind == T.CIRCUMFLEX_EQ - @test tok("1÷=2", 2).kind == T.DIVISION_EQ + @test tok("1+=2", 2).kind == T.PLUS_EQ + @test tok("1-=2", 2).kind == T.MINUS_EQ + @test tok("1:=2", 2).kind == T.COLON_EQ + @test tok("1*=2", 2).kind == T.STAR_EQ + @test tok("1^=2", 2).kind == T.CIRCUMFLEX_EQ + @test tok("1÷=2", 2).kind == T.DIVISION_EQ @test tok("1\\=2", 2).kind == T.BACKSLASH_EQ @test tok("1\$=2", 2).kind == T.EX_OR_EQ @test tok("1-->2", 2).kind == T.RIGHT_ARROW @test tok("1<--2", 2).kind == T.LEFT_ARROW @test tok("1<-->2", 2).kind == T.DOUBLE_ARROW - @test tok("1>:2", 2).kind == T.ISSUPERTYPE + @test tok("1>:2", 2).kind == T.ISSUPERTYPE end @testset "infix" begin - @test tok("1 in 2", 3).kind == T.IN + @test tok("1 in 2", 3).kind == T.IN @test tok("1 in[1]", 3).kind == T.IN if VERSION >= v"0.6.0-dev.1471" - @test tok("1 isa 2", 3).kind == T.ISA + @test tok("1 isa 2", 3).kind == T.ISA @test tok("1 isa[2]", 3).kind == T.ISA else - @test tok("1 isa 2", 3).kind == T.IDENTIFIER + @test tok("1 isa 2", 3).kind == T.IDENTIFIER @test tok("1 isa[2]", 3).kind == T.IDENTIFIER end end @@ -184,18 +150,18 @@ end @testset "tokenizing juxtaposed numbers and dotted operators/identifiers" begin - @test (t->t.val=="1234" && t.kind == Tokens.INTEGER )(tok("1234 .+1")) - @test (t->t.val=="1234.0" && t.kind == Tokens.FLOAT )(tok("1234.0.+1")) - @test (t->t.val=="1234.0" && t.kind == Tokens.FLOAT )(tok("1234.0 .+1")) - @test (t->t.val=="1234." && t.kind == Tokens.FLOAT )(tok("1234.f(a)")) - @test (t->t.val=="1234" && t.kind == Tokens.INTEGER )(tok("1234 .f(a)")) - @test (t->t.val=="1234.0." && t.kind == Tokens.ERROR )(tok("1234.0.f(a)")) - @test (t->t.val=="1234.0" && t.kind == Tokens.FLOAT )(tok("1234.0 .f(a)")) + @test (t -> t.val == "1234" && t.kind == Tokens.INTEGER)(tok("1234 .+1")) + @test (t -> t.val == "1234.0" && t.kind == Tokens.FLOAT)(tok("1234.0.+1")) + @test (t -> t.val == "1234.0" && t.kind == Tokens.FLOAT)(tok("1234.0 .+1")) + @test (t -> t.val == "1234." && t.kind == Tokens.FLOAT)(tok("1234.f(a)")) + @test (t -> t.val == "1234" && t.kind == Tokens.INTEGER)(tok("1234 .f(a)")) + @test (t -> t.val == "1234.0." && t.kind == Tokens.ERROR)(tok("1234.0.f(a)")) + @test (t -> t.val == "1234.0" && t.kind == Tokens.FLOAT)(tok("1234.0 .f(a)")) end @testset "lexing anon functions '->' " begin - @test tok("a->b", 2).kind==Tokens.ANON_FUNC + @test tok("a->b", 2).kind == Tokens.ANON_FUNC end @testset "comments" begin @@ -208,20 +174,20 @@ end """)) kinds = [T.COMMENT, T.WHITESPACE, - T.TRIPLE_STRING, T.WHITESPACE, - T.INTEGER, T.WHITESPACE, - T.ENDMARKER] + T.TRIPLE_STRING, T.WHITESPACE, + T.INTEGER, T.WHITESPACE, + T.ENDMARKER] @test T.kind.(toks) == kinds end @testset "primes" begin tokens = collect(tokenize( - """ - ImageMagick.save(fn, reinterpret(ARGB32, [0xf0884422]'')) - D = ImageMagick.load(fn) - """)) - @test string(untokenize(tokens[16]))==string(untokenize(tokens[17]))=="'" + """ + ImageMagick.save(fn, reinterpret(ARGB32, [0xf0884422]'')) + D = ImageMagick.load(fn) + """)) + @test string(untokenize(tokens[16])) == string(untokenize(tokens[17])) == "'" @test tok("'a'").val == "'a'" @test tok("'a'").kind == Tokens.CHAR @test tok("''").val == "''" @@ -236,41 +202,41 @@ end end @testset "keywords" begin - for kw in ["function", - "abstract", - "baremodule", - "begin", - "break", - "catch", - "const", - "continue", - "do", - "else", - "elseif", - "end", - "export", - #"false", - "finally", - "for", - "function", - "global", - "let", - "local", - "if", - "import", - "importall", - "macro", - "module", - "mutable", - "primitive", - "quote", - "return", - "struct", - #"true", - "try", - "type", - "using", - "while"] + for kw in ["function", + "abstract", + "baremodule", + "begin", + "break", + "catch", + "const", + "continue", + "do", + "else", + "elseif", + "end", + "export", + #"false", + "finally", + "for", + "function", + "global", + "let", + "local", + "if", + "import", + "importall", + "macro", + "module", + "mutable", + "primitive", + "quote", + "return", + "struct", + #"true", + "try", + "type", + "using", + "while"] @test T.kind(tok(kw)) == T.KEYWORD end @@ -281,20 +247,20 @@ end end @testset "errors" begin - @test tok("#= #= =#", 1).kind == T.ERROR - @test tok("'dsadsa", 1).kind == T.ERROR - @test tok("aa **", 3).kind == T.ERROR - @test tok("aa \" ", 3).kind == T.ERROR - @test tok("aa \"\"\" \"dsad\" \"\"",3).kind == T.ERROR + @test tok("#= #= =#", 1).kind == T.ERROR + @test tok("'dsadsa", 1).kind == T.ERROR + @test tok("aa **", 3).kind == T.ERROR + @test tok("aa \" ", 3).kind == T.ERROR + @test tok("aa \"\"\" \"dsad\" \"\"", 3).kind == T.ERROR end @testset "xor_eq" begin - @test tok("1 ⊻= 2", 3).kind==T.XOR_EQ + @test tok("1 ⊻= 2", 3).kind == T.XOR_EQ end @testset "lex binary" begin - @test tok("0b0101").kind==T.BIN_INT + @test tok("0b0101").kind == T.BIN_INT end @testset "show" begin @@ -307,7 +273,7 @@ end @testset "interpolation" begin str = """"str: \$(g("str: \$(h("str"))"))" """ ts = collect(tokenize(str)) - @test length(ts)==3 + @test length(ts) == 3 @test ts[1].kind == Tokens.STRING @test ts[1].val == strip(str) ts = collect(tokenize("""\"\$\"""")) @@ -317,13 +283,13 @@ end t_err = tok("\"\$(fdsf\"") @test t_err.kind == Tokens.ERROR @test t_err.token_error == Tokens.EOF_STRING - @test Tokenize.Tokens.startpos(t_err) == (1,1) - @test Tokenize.Tokens.endpos(t_err) == (1,8) + @test Tokenize.Tokens.startpos(t_err) == (1, 1) + @test Tokenize.Tokens.endpos(t_err) == (1, 8) # issue 178: str = """"\$uₕx \$(uₕx - ux)" """ ts = collect(tokenize(str)) - @test length(ts)==3 + @test length(ts) == 3 @test ts[1].kind == Tokens.STRING @test ts[1].val == strip(str) end @@ -336,19 +302,19 @@ end end @testset "modifying function names (!) followed by operator" begin - @test tok("a!=b", 2).kind == Tokens.NOT_EQ + @test tok("a!=b", 2).kind == Tokens.NOT_EQ @test tok("a!!=b", 2).kind == Tokens.NOT_EQ - @test tok("!=b", 1).kind == Tokens.NOT_EQ + @test tok("!=b", 1).kind == Tokens.NOT_EQ end @testset "lex integers" begin - @test tok("1234").kind == T.INTEGER - @test tok("12_34").kind == T.INTEGER - @test tok("_1234").kind == T.IDENTIFIER - @test tok("1234_").kind == T.INTEGER - @test tok("1234_", 2).kind == T.IDENTIFIER - @test tok("1234x").kind == T.INTEGER - @test tok("1234x", 2).kind == T.IDENTIFIER + @test tok("1234").kind == T.INTEGER + @test tok("12_34").kind == T.INTEGER + @test tok("_1234").kind == T.IDENTIFIER + @test tok("1234_").kind == T.INTEGER + @test tok("1234_", 2).kind == T.IDENTIFIER + @test tok("1234x").kind == T.INTEGER + @test tok("1234x", 2).kind == T.IDENTIFIER end @testset "floats with trailing `.` " begin @@ -366,7 +332,7 @@ end @test tok("1.").kind == Tokens.FLOAT @test tok("1.\"text\" ").kind == Tokens.FLOAT - @test tok("1..").kind == Tokens.INTEGER + @test tok("1..").kind == Tokens.INTEGER @test T.kind.(collect(tokenize("1f0./1"))) == [T.FLOAT, T.OP, T.INTEGER, T.ENDMARKER] end @@ -377,13 +343,13 @@ end end @testset "lex float/bin/hex/oct w underscores" begin - @test tok("1_1.11").kind == T.FLOAT - @test tok("11.1_1").kind == T.FLOAT - @test tok("1_1.1_1").kind == T.FLOAT - @test tok("_1.1_1", 1).kind == T.IDENTIFIER - @test tok("_1.1_1", 2).kind == T.FLOAT - @test tok("0x0167_032").kind == T.HEX_INT - @test tok("0b0101001_0100_0101").kind == T.BIN_INT + @test tok("1_1.11").kind == T.FLOAT + @test tok("11.1_1").kind == T.FLOAT + @test tok("1_1.1_1").kind == T.FLOAT + @test tok("_1.1_1", 1).kind == T.IDENTIFIER + @test tok("_1.1_1", 2).kind == T.FLOAT + @test tok("0x0167_032").kind == T.HEX_INT + @test tok("0b0101001_0100_0101").kind == T.BIN_INT @test tok("0o01054001_0100_0101").kind == T.OCT_INT @test T.kind.(collect(tokenize("1.2."))) == [T.ERROR, T.ENDMARKER] @test tok("1__2").kind == T.INTEGER @@ -400,18 +366,18 @@ end end @testset "floating points" begin - @test tok("1.0e0").kind == Tokens.FLOAT + @test tok("1.0e0").kind == Tokens.FLOAT @test tok("1.0e-0").kind == Tokens.FLOAT - @test tok("1.0E0").kind == Tokens.FLOAT + @test tok("1.0E0").kind == Tokens.FLOAT @test tok("1.0E-0").kind == Tokens.FLOAT - @test tok("1.0f0").kind == Tokens.FLOAT + @test tok("1.0f0").kind == Tokens.FLOAT @test tok("1.0f-0").kind == Tokens.FLOAT - @test tok("0e0").kind == Tokens.FLOAT - @test tok("0e+0").kind == Tokens.FLOAT - @test tok("0E0").kind == Tokens.FLOAT + @test tok("0e0").kind == Tokens.FLOAT + @test tok("0e+0").kind == Tokens.FLOAT + @test tok("0E0").kind == Tokens.FLOAT @test tok("201E+0").kind == Tokens.FLOAT - @test tok("2f+0").kind == Tokens.FLOAT + @test tok("2f+0").kind == Tokens.FLOAT @test tok("2048f0").kind == Tokens.FLOAT @test tok("1.:0").kind == Tokens.FLOAT @test tok("0x00p2").kind == Tokens.FLOAT @@ -430,12 +396,12 @@ end end @testset "jl06types" begin - @test tok("mutable").kind == Tokens.MUTABLE + @test tok("mutable").kind == Tokens.MUTABLE @test tok("primitive").kind == Tokens.PRIMITIVE - @test tok("struct").kind == Tokens.STRUCT - @test tok("where").kind == Tokens.WHERE - @test tok("mutable struct s{T} where T", 1).kind == Tokens.MUTABLE - @test tok("mutable struct s{T} where T", 3).kind == Tokens.STRUCT + @test tok("struct").kind == Tokens.STRUCT + @test tok("where").kind == Tokens.WHERE + @test tok("mutable struct s{T} where T", 1).kind == Tokens.MUTABLE + @test tok("mutable struct s{T} where T", 3).kind == Tokens.STRUCT @test tok("mutable struct s{T} where T", 10).kind == Tokens.WHERE end @@ -470,74 +436,74 @@ end @testset "hex/bin/octal errors" begin -@test tok("0x").kind == T.ERROR -@test tok("0b").kind == T.ERROR -@test tok("0o").kind == T.ERROR -@test tok("0x 2", 1).kind == T.ERROR -@test tok("0x.1p1").kind == T.FLOAT + @test tok("0x").kind == T.ERROR + @test tok("0b").kind == T.ERROR + @test tok("0o").kind == T.ERROR + @test tok("0x 2", 1).kind == T.ERROR + @test tok("0x.1p1").kind == T.FLOAT end @testset "dotted and suffixed operators" begin -ops = collect(values(Main.Tokenize.Tokens.UNICODE_OPS_REVERSE)) - -for op in ops - op in (:isa, :in, :where, Symbol('\''), :?, :(:)) && continue - strs = [ - 1 => [ # unary - "$(op)b", - ".$(op)b", - ], - 2 => [ # binary - "a $op b", - "a .$op b", - "a $(op)₁ b", - "a $(op)\U0304 b", - "a .$(op)₁ b" + ops = collect(values(Main.Tokenize.Tokens.UNICODE_OPS_REVERSE)) + + for op in ops + op in (:isa, :in, :where, Symbol('\''), :?, :(:)) && continue + strs = [ + 1 => [ # unary + "$(op)b", + ".$(op)b", + ], + 2 => [ # binary + "a $op b", + "a .$op b", + "a $(op)₁ b", + "a $(op)\U0304 b", + "a .$(op)₁ b" + ] ] - ] - for (arity, container) in strs - for str in container - expr = Meta.parse(str, raise = false) - if expr isa Expr && (expr.head != :error && expr.head != :incomplete) - tokens = collect(tokenize(str)) - exop = expr.head == :call ? expr.args[1] : expr.head - @test Symbol(Tokenize.Tokens.untokenize(tokens[arity == 1 ? 1 : 3])) == exop - else - break + for (arity, container) in strs + for str in container + expr = Meta.parse(str, raise=false) + if expr isa Expr && (expr.head != :error && expr.head != :incomplete) + tokens = collect(tokenize(str)) + exop = expr.head == :call ? expr.args[1] : expr.head + @test Symbol(Tokenize.Tokens.untokenize(tokens[arity == 1 ? 1 : 3])) == exop + else + break + end end end end end -end @testset "perp" begin - @test tok("1 ⟂ 2", 3).kind==T.PERP + @test tok("1 ⟂ 2", 3).kind == T.PERP end @testset "outer" begin - @test tok("outer", 1).kind==T.OUTER + @test tok("outer", 1).kind == T.OUTER end @testset "dot startpos" begin - @test Tokenize.Tokens.startpos(tok("./")) == (1,1) + @test Tokenize.Tokens.startpos(tok("./")) == (1, 1) @test Tokenize.Tokens.startbyte(tok(".≤")) == 0 end @testset "token errors" begin - @test tok("1.2e2.3",1).token_error === Tokens.INVALID_NUMERIC_CONSTANT - @test tok("1.2.",1).token_error === Tokens.INVALID_NUMERIC_CONSTANT - @test tok("1.2.f",1).token_error === Tokens.INVALID_NUMERIC_CONSTANT - @test tok("0xv",1).token_error === Tokens.INVALID_NUMERIC_CONSTANT - @test tok("0b3",1).token_error === Tokens.INVALID_NUMERIC_CONSTANT - @test tok("0op",1).token_error === Tokens.INVALID_NUMERIC_CONSTANT - @test tok("--",1).token_error === Tokens.INVALID_OPERATOR - @test tok("1**2",2).token_error === Tokens.INVALID_OPERATOR + @test tok("1.2e2.3", 1).token_error === Tokens.INVALID_NUMERIC_CONSTANT + @test tok("1.2.", 1).token_error === Tokens.INVALID_NUMERIC_CONSTANT + @test tok("1.2.f", 1).token_error === Tokens.INVALID_NUMERIC_CONSTANT + @test tok("0xv", 1).token_error === Tokens.INVALID_NUMERIC_CONSTANT + @test tok("0b3", 1).token_error === Tokens.INVALID_NUMERIC_CONSTANT + @test tok("0op", 1).token_error === Tokens.INVALID_NUMERIC_CONSTANT + @test tok("--", 1).token_error === Tokens.INVALID_OPERATOR + @test tok("1**2", 2).token_error === Tokens.INVALID_OPERATOR end @testset "hat suffix" begin - @test tok("ŝ", 1).kind==Tokens.IDENTIFIER + @test tok("ŝ", 1).kind == Tokens.IDENTIFIER @test untokenize(collect(tokenize("ŝ", Tokens.RawToken))[1], "ŝ") == "ŝ" end @@ -551,9 +517,9 @@ end s = "1.+2" @test tok(s, 1).kind == Tokens.ERROR @test Tokens.isoperator(tok(s, 2).kind) - @test (t->t.val=="1234." && t.kind == Tokens.ERROR )(tok("1234.+1")) # requires space before '.' + @test (t -> t.val == "1234." && t.kind == Tokens.ERROR)(tok("1234.+1")) # requires space before '.' @test tok("1.+ ").kind == Tokens.ERROR - @test tok("1.⤋").kind == Tokens.ERROR + @test tok("1.⤋").kind == Tokens.ERROR @test tok("1.?").kind == Tokens.ERROR end @@ -615,7 +581,7 @@ end push!(ops, raw"<-- <-->") end allops = split(join(ops, " "), " ") - @test all(s->Base.isoperator(Symbol(s)) == Tokens.isoperator(first(collect(tokenize(s))).kind), allops) + @test all(s -> Base.isoperator(Symbol(s)) == Tokens.isoperator(first(collect(tokenize(s))).kind), allops) end @testset "simple_hash" begin diff --git a/packages/Tokenize/test/profile.jl b/packages/Tokenize/test/profile.jl index fd6cd61..8793eba 100644 --- a/packages/Tokenize/test/profile.jl +++ b/packages/Tokenize/test/profile.jl @@ -6,7 +6,7 @@ println("First run took $(nt.time) seconds with $(nt.bytes/1e6) MB allocated") srcdir = joinpath(Sys.BINDIR, Base.DATAROOTDIR, "..") allfiles = [] -for (root, dirs, files) in walkdir(srcdir, follow_symlinks = true) +for (root, dirs, files) in walkdir(srcdir, follow_symlinks=true) for file in files splitext(file)[2] == ".jl" || continue push!(allfiles, joinpath(root, file)) @@ -17,7 +17,8 @@ end let time_taken = 0.0, allocated = 0.0 for file in allfiles content = IOBuffer(read(file, String)) - nt = @timed for t in Tokenize.tokenize(content, Tokens.RawToken) end + nt = @timed for t in Tokenize.tokenize(content, Tokens.RawToken) + end time_taken += nt.time allocated += nt.bytes end @@ -27,7 +28,8 @@ end let time_taken = 0.0, allocated = 0.0 for file in allfiles content = IOBuffer(read(file, String)) - nt = @timed for t in Tokenize.tokenize(content, Tokens.RawToken) end + nt = @timed for t in Tokenize.tokenize(content, Tokens.RawToken) + end time_taken += nt.time allocated += nt.bytes end diff --git a/packages/Tokenize/test/runtests.jl b/packages/Tokenize/test/runtests.jl index 77fc777..ba1a60a 100644 --- a/packages/Tokenize/test/runtests.jl +++ b/packages/Tokenize/test/runtests.jl @@ -4,5 +4,5 @@ import Tokenize include("lex_yourself.jl") @testset "lexer" begin -include("lexer.jl") + include("lexer.jl") end diff --git a/src/TestItemRunner.jl b/src/TestItemRunner.jl index d628582..3d4842b 100644 --- a/src/TestItemRunner.jl +++ b/src/TestItemRunner.jl @@ -3,19 +3,19 @@ module TestItemRunner include("../packages/Tokenize/src/Tokenize.jl") module CSTParser - using ..Tokenize - import ..Tokenize.Tokens - import ..Tokenize.Tokens: RawToken, AbstractToken, iskeyword, isliteral, isoperator, untokenize - import ..Tokenize.Lexers: Lexer, peekchar, iswhitespace, readchar, emit, emit_error, accept_batch, eof +using ..Tokenize +import ..Tokenize.Tokens +import ..Tokenize.Tokens: RawToken, AbstractToken, iskeyword, isliteral, isoperator, untokenize +import ..Tokenize.Lexers: Lexer, peekchar, iswhitespace, readchar, emit, emit_error, accept_batch, eof - include("../packages/CSTParser/src/packagedef.jl") +include("../packages/CSTParser/src/packagedef.jl") end module TestItemDetection - import ..CSTParser - using ..CSTParser: EXPR +import ..CSTParser +using ..CSTParser: EXPR - include("../packages/TestItemDetection/src/packagedef.jl") +include("../packages/TestItemDetection/src/packagedef.jl") end import .CSTParser, Test, TestItems, TOML @@ -65,7 +65,7 @@ function run_testitem(filepath, use_default_usings, package_name, original_code, if use_default_usings Core.eval(mod, :(using Test)) - if package_name!="" + if package_name != "" Core.eval(mod, :(using $(Symbol(package_name)))) end end @@ -81,7 +81,7 @@ function run_tests(path; filter=nothing, verbose=false) # Find package name package_name = "" package_filename = isfile(joinpath(path, "Project.toml")) ? joinpath(path, "Project.toml") : isfile(joinpath(path, "JuliaProject.toml")) ? joinpath(path, "JuliaProject.toml") : nothing - if package_filename!==nothing + if package_filename !== nothing try project_content = TOML.parsefile(package_filename) @@ -149,7 +149,7 @@ macro run_package_tests(ex...) kwargs = [] for i in ex - if i isa Expr && i.head==:(=) && length(i.args)==2 && i.args[1] in (:filter, :verbose) + if i isa Expr && i.head == :(=) && length(i.args) == 2 && i.args[1] in (:filter, :verbose) push!(kwargs, esc(i)) else error("Invalid argument") diff --git a/test/runtests.jl b/test/runtests.jl index f2efada..7fa5738 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,3 +1,3 @@ using TestItemRunner -@run_package_tests filter=i->endswith(i.filename, "TestItemRunner.jl") verbose=true +@run_package_tests filter = i -> endswith(i.filename, "TestItemRunner.jl") verbose = true