Skip to content

Commit

Permalink
Merge pull request #210 from JuliaLang/sp/add-some-more-arrows
Browse files Browse the repository at this point in the history
feat: add some more arrow ops
  • Loading branch information
pfitzseb authored Jan 8, 2024
2 parents 3b40331 + 7f8fef2 commit 13396b8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Tokenize"
uuid = "0796e94c-ce3b-5d07-9a54-7f471281c624"
version = "0.5.27"
version = "0.5.28"

[compat]
julia = "1"
Expand Down
4 changes: 4 additions & 0 deletions src/token_kinds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@
LEFTWARDS_ARROW_ABOVE_REVERSE_ALMOST_EQUAL_TO, #
RIGHTWARDS_ARROW_THROUGH_GREATER_THAN, #
RIGHTWARDS_ARROW_THROUGH_SUPERSET, #
LEFTWARDS_ARROW_THROUGH_SUPERSET, #
LEFTWARDS_ARROW_THROUGH_LESS_THAN, #
REVERSE_TILDE_OPERATOR_ABOVE_RIGHTWARDS_ARROW, #
RIGHTWARDS_ARROW_ABOVE_REVERSE_ALMOST_EQUAL_TO, #
TILDE_OPERATOR_ABOVE_LEFTWARDS_ARROW, #
Expand Down Expand Up @@ -929,6 +931,8 @@ const UNICODE_OPS = Dict{Char, Kind}(
'' => LEFTWARDS_ARROW_ABOVE_REVERSE_ALMOST_EQUAL_TO,
'' => RIGHTWARDS_ARROW_THROUGH_GREATER_THAN,
'' => RIGHTWARDS_ARROW_THROUGH_SUPERSET,
'' => LEFTWARDS_ARROW_THROUGH_SUPERSET,
'' => LEFTWARDS_ARROW_THROUGH_LESS_THAN,
'' => REVERSE_TILDE_OPERATOR_ABOVE_RIGHTWARDS_ARROW,
'' => RIGHTWARDS_ARROW_ABOVE_REVERSE_ALMOST_EQUAL_TO,
'' => TILDE_OPERATOR_ABOVE_LEFTWARDS_ARROW,
Expand Down
6 changes: 4 additions & 2 deletions src/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ readchar(io::IO) = eof(io) ? EOF_CHAR : read(io, Char)
0x0000ffe9 <= c <= 0x0000ffec ||
0x00002aea <= c <= 0x00002aeb ||
c == 0x00000387 ||
c == 0x000000b7
c == 0x000000b7 ||
c == 0x0000297A ||
c == 0x00002977
end

function dotop2(pc, dpc)
Expand Down Expand Up @@ -246,7 +248,7 @@ function optakessuffix(k)
end

# It is unknown where this array comes from...
const startchars = ['!', '$', '%', '&', '\'', '*', '+', '-', '.', '/', ':', '<', '=', '>', '?', '\\', '^', 'i', 'w', '|', '~', '¬', '±', '×', '÷', '…', '⁝', '⅋', '←', '↑', '→', '↓', '↔', '↚', '↛', '↠', '↣', '↦', '↮', '⇎', '⇏', '⇒', '⇔', '⇴', '⇵', '⇶', '⇷', '⇸', '⇹', '⇺', '⇻', '⇼', '⇽', '⇾', '⇿', '∈', '∉', '∊', '∋', '∌', '∍', '∓', '∔', '∗', '∘', '∙', '√', '∛', '∜', '∝', '∤', '∥', '∦', '∧', '∨', '∩', '∪', '∷', '∸', '∺', '∻', '∽', '∾', '≀', '≁', '≂', '≃', '≄', '≅', '≆', '≇', '≈', '≉', '≊', '≋', '≌', '≍', '≎', '≏', '≐', '≑', '≒', '≓', '≔', '≕', '≖', '≗', '≘', '≙', '≚', '≛', '≜', '≝', '≞', '≟', '≠', '≡', '≢', '≣', '≤', '≥', '≦', '≧', '≨', '≩', '≪', '≫', '≬', '≭', '≮', '≯', '≰', '≱', '≲', '≳', '≴', '≵', '≶', '≷', '≸', '≹', '≺', '≻', '≼', '≽', '≾', '≿', '⊀', '⊁', '⊂', '⊃', '⊄', '⊅', '⊆', '⊇', '⊈', '⊉', '⊊', '⊋', '⊍', '⊎', '⊏', '⊐', '⊑', '⊒', '⊓', '⊔', '⊕', '⊖', '⊗', '⊘', '⊙', '⊚', '⊛', '⊜', '⊞', '⊟', '⊠', '⊡', '⊢', '⊣', '⊩', '⊬', '⊮', '⊰', '⊱', '⊲', '⊳', '⊴', '⊵', '⊶', '⊷', '⊻', '⊼', '⊽', '⋄', '⋅', '⋆', '⋇', '⋉', '⋊', '⋋', '⋌', '⋍', '⋎', '⋏', '⋐', '⋑', '⋒', '⋓', '⋕', '⋖', '⋗', '⋘', '⋙', '⋚', '⋛', '⋜', '⋝', '⋞', '⋟', '⋠', '⋡', '⋢', '⋣', '⋤', '⋥', '⋦', '⋧', '⋨', '⋩', '⋪', '⋫', '⋬', '⋭', '⋮', '⋯', '⋰', '⋱', '⋲', '⋳', '⋴', '⋵', '⋶', '⋷', '⋸', '⋹', '⋺', '⋻', '⋼', '⋽', '⋾', '⋿', '▷', '⟂', '⟈', '⟉', '⟑', '⟒', '⟕', '⟖', '⟗', '⟰', '⟱', '⟵', '⟶', '⟷', '⟹', '⟺', '⟻', '⟼', '⟽', '⟾', '⟿', '⤀', '⤁', '⤂', '⤃', '⤄', '⤅', '⤆', '⤇', '⤈', '⤉', '⤊', '⤋', '⤌', '⤍', '⤎', '⤏', '⤐', '⤑', '⤒', '⤓', '⤔', '⤕', '⤖', '⤗', '⤘', '⤝', '⤞', '⤟', '⤠', '⥄', '⥅', '⥆', '⥇', '⥈', '⥉', '⥊', '⥋', '⥌', '⥍', '⥎', '⥏', '⥐', '⥑', '⥒', '⥓', '⥔', '⥕', '⥖', '⥗', '⥘', '⥙', '⥚', '⥛', '⥜', '⥝', '⥞', '⥟', '⥠', '⥡', '⥢', '⥣', '⥤', '⥥', '⥦', '⥧', '⥨', '⥩', '⥪', '⥫', '⥬', '⥭', '⥮', '⥯', '⥰', '⥷', '⦷', '⦸', '⦼', '⦾', '⦿', '⧀', '⧁', '⧡', '⧣', '⧤', '⧥', '⧴', '⧶', '⧷', '⧺', '⧻', '⨇', '⨈', '⨝', '⨢', '⨣', '⨤', '⨥', '⨦', '⨧', '⨨', '⨩', '⨪', '⨫', '⨬', '⨭', '⨮', '⨰', '⨱', '⨲', '⨳', '⨴', '⨵', '⨶', '⨷', '⨸', '⨹', '⨺', '⨻', '⨼', '⨽', '⩀', '⩁', '⩂', '⩃', '⩄', '⩅', '⩊', '⩋', '⩌', '⩍', '⩎', '⩏', '⩐', '⩑', '⩒', '⩓', '⩔', '⩕', '⩖', '⩗', '⩘', '⩚', '⩛', '⩜', '⩝', '⩞', '⩟', '⩠', '⩡', '⩢', '⩣', '⩦', '⩧', '⩪', '⩫', '⩬', '⩭', '⩮', '⩯', '⩰', '⩱', '⩲', '⩳', '⩴', '⩵', '⩶', '⩷', '⩸', '⩹', '⩺', '⩻', '⩼', '⩽', '⩾', '⩿', '⪀', '⪁', '⪂', '⪃', '⪄', '⪅', '⪆', '⪇', '⪈', '⪉', '⪊', '⪋', '⪌', '⪍', '⪎', '⪏', '⪐', '⪑', '⪒', '⪓', '⪔', '⪕', '⪖', '⪗', '⪘', '⪙', '⪚', '⪛', '⪜', '⪝', '⪞', '⪟', '⪠', '⪡', '⪢', '⪣', '⪤', '⪥', '⪦', '⪧', '⪨', '⪩', '⪪', '⪫', '⪬', '⪭', '⪮', '⪯', '⪰', '⪱', '⪲', '⪳', '⪴', '⪵', '⪶', '⪷', '⪸', '⪹', '⪺', '⪻', '⪼', '⪽', '⪾', '⪿', '⫀', '⫁', '⫂', '⫃', '⫄', '⫅', '⫆', '⫇', '⫈', '⫉', '⫊', '⫋', '⫌', '⫍', '⫎', '⫏', '⫐', '⫑', '⫒', '⫓', '⫔', '⫕', '⫖', '⫗', '⫘', '⫙', '⫛', '⫷', '⫸', '⫹', '⫺', '⬰', '⬱', '⬲', '⬳', '⬴', '⬵', '⬶', '⬷', '⬸', '⬹', '⬺', '⬻', '⬼', '⬽', '⬾', '⬿', '⭀', '⭁', '⭂', '⭃', '⭄', '⭇', '⭈', '⭉', '⭊', '⭋', '⭌', '←', '↑', '→', '↓']
const startchars = ['!', '$', '%', '&', '\'', '*', '+', '-', '.', '/', ':', '<', '=', '>', '?', '\\', '^', 'i', 'w', '|', '~', '¬', '±', '×', '÷', '…', '⁝', '⅋', '←', '↑', '→', '↓', '↔', '↚', '↛', '↠', '↣', '↦', '↮', '⇎', '⇏', '⇒', '⇔', '⇴', '⇵', '⇶', '⇷', '⇸', '⇹', '⇺', '⇻', '⇼', '⇽', '⇾', '⇿', '∈', '∉', '∊', '∋', '∌', '∍', '∓', '∔', '∗', '∘', '∙', '√', '∛', '∜', '∝', '∤', '∥', '∦', '∧', '∨', '∩', '∪', '∷', '∸', '∺', '∻', '∽', '∾', '≀', '≁', '≂', '≃', '≄', '≅', '≆', '≇', '≈', '≉', '≊', '≋', '≌', '≍', '≎', '≏', '≐', '≑', '≒', '≓', '≔', '≕', '≖', '≗', '≘', '≙', '≚', '≛', '≜', '≝', '≞', '≟', '≠', '≡', '≢', '≣', '≤', '≥', '≦', '≧', '≨', '≩', '≪', '≫', '≬', '≭', '≮', '≯', '≰', '≱', '≲', '≳', '≴', '≵', '≶', '≷', '≸', '≹', '≺', '≻', '≼', '≽', '≾', '≿', '⊀', '⊁', '⊂', '⊃', '⊄', '⊅', '⊆', '⊇', '⊈', '⊉', '⊊', '⊋', '⊍', '⊎', '⊏', '⊐', '⊑', '⊒', '⊓', '⊔', '⊕', '⊖', '⊗', '⊘', '⊙', '⊚', '⊛', '⊜', '⊞', '⊟', '⊠', '⊡', '⊢', '⊣', '⊩', '⊬', '⊮', '⊰', '⊱', '⊲', '⊳', '⊴', '⊵', '⊶', '⊷', '⊻', '⊼', '⊽', '⋄', '⋅', '⋆', '⋇', '⋉', '⋊', '⋋', '⋌', '⋍', '⋎', '⋏', '⋐', '⋑', '⋒', '⋓', '⋕', '⋖', '⋗', '⋘', '⋙', '⋚', '⋛', '⋜', '⋝', '⋞', '⋟', '⋠', '⋡', '⋢', '⋣', '⋤', '⋥', '⋦', '⋧', '⋨', '⋩', '⋪', '⋫', '⋬', '⋭', '⋮', '⋯', '⋰', '⋱', '⋲', '⋳', '⋴', '⋵', '⋶', '⋷', '⋸', '⋹', '⋺', '⋻', '⋼', '⋽', '⋾', '⋿', '▷', '⟂', '⟈', '⟉', '⟑', '⟒', '⟕', '⟖', '⟗', '⟰', '⟱', '⟵', '⟶', '⟷', '⟹', '⟺', '⟻', '⟼', '⟽', '⟾', '⟿', '⤀', '⤁', '⤂', '⤃', '⤄', '⤅', '⤆', '⤇', '⤈', '⤉', '⤊', '⤋', '⤌', '⤍', '⤎', '⤏', '⤐', '⤑', '⤒', '⤓', '⤔', '⤕', '⤖', '⤗', '⤘', '⤝', '⤞', '⤟', '⤠', '⥄', '⥅', '⥆', '⥇', '⥈', '⥉', '⥊', '⥋', '⥌', '⥍', '⥎', '⥏', '⥐', '⥑', '⥒', '⥓', '⥔', '⥕', '⥖', '⥗', '⥘', '⥙', '⥚', '⥛', '⥜', '⥝', '⥞', '⥟', '⥠', '⥡', '⥢', '⥣', '⥤', '⥥', '⥦', '⥧', '⥨', '⥩', '⥪', '⥫', '⥬', '⥭', '⥮', '⥯', '⥰', '⥷', '⥺', '⦷', '⦸', '⦼', '⦾', '⦿', '⧀', '⧁', '⧡', '⧣', '⧤', '⧥', '⧴', '⧶', '⧷', '⧺', '⧻', '⨇', '⨈', '⨝', '⨢', '⨣', '⨤', '⨥', '⨦', '⨧', '⨨', '⨩', '⨪', '⨫', '⨬', '⨭', '⨮', '⨰', '⨱', '⨲', '⨳', '⨴', '⨵', '⨶', '⨷', '⨸', '⨹', '⨺', '⨻', '⨼', '⨽', '⩀', '⩁', '⩂', '⩃', '⩄', '⩅', '⩊', '⩋', '⩌', '⩍', '⩎', '⩏', '⩐', '⩑', '⩒', '⩓', '⩔', '⩕', '⩖', '⩗', '⩘', '⩚', '⩛', '⩜', '⩝', '⩞', '⩟', '⩠', '⩡', '⩢', '⩣', '⩦', '⩧', '⩪', '⩫', '⩬', '⩭', '⩮', '⩯', '⩰', '⩱', '⩲', '⩳', '⩴', '⩵', '⩶', '⩷', '⩸', '⩹', '⩺', '⩻', '⩼', '⩽', '⩾', '⩿', '⪀', '⪁', '⪂', '⪃', '⪄', '⪅', '⪆', '⪇', '⪈', '⪉', '⪊', '⪋', '⪌', '⪍', '⪎', '⪏', '⪐', '⪑', '⪒', '⪓', '⪔', '⪕', '⪖', '⪗', '⪘', '⪙', '⪚', '⪛', '⪜', '⪝', '⪞', '⪟', '⪠', '⪡', '⪢', '⪣', '⪤', '⪥', '⪦', '⪧', '⪨', '⪩', '⪪', '⪫', '⪬', '⪭', '⪮', '⪯', '⪰', '⪱', '⪲', '⪳', '⪴', '⪵', '⪶', '⪷', '⪸', '⪹', '⪺', '⪻', '⪼', '⪽', '⪾', '⪿', '⫀', '⫁', '⫂', '⫃', '⫄', '⫅', '⫆', '⫇', '⫈', '⫉', '⫊', '⫋', '⫌', '⫍', '⫎', '⫏', '⫐', '⫑', '⫒', '⫓', '⫔', '⫕', '⫖', '⫗', '⫘', '⫙', '⫛', '⫷', '⫸', '⫹', '⫺', '⬰', '⬱', '⬲', '⬳', '⬴', '⬵', '⬶', '⬷', '⬸', '⬹', '⬺', '⬻', '⬼', '⬽', '⬾', '⬿', '⭀', '⭁', '⭂', '⭃', '⭄', '⭇', '⭈', '⭉', '⭊', '⭋', '⭌', '←', '↑', '→', '↓']

@assert issorted(startchars)

Expand Down
3 changes: 3 additions & 0 deletions test/lexer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,9 @@ end
if VERSION >= v"1.6.0"
push!(ops, raw"<-- <-->")
end
if VERSION >= v"1.10.0-"
push!(ops, raw"⥺ ⥷")
end
allops = split(join(ops, " "), " ")
@test all(s->Base.isoperator(Symbol(s)) == Tokens.isoperator(first(collect(tokenize(s))).kind), allops)
end
Expand Down

2 comments on commit 13396b8

@pfitzseb
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/98445

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.5.28 -m "<description of version>" 13396b85c2847544e9231cebb509de5c5674e46b
git push origin v0.5.28

Please sign in to comment.