Skip to content

Commit

Permalink
fix: expose the unicode emoji builtin rules (#874)
Browse files Browse the repository at this point in the history
ref: #872
  • Loading branch information
tomtau authored Jun 21, 2023
1 parent 73327b3 commit 047c27e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions derive/tests/grammar.pest
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ han = { HAN+ }
hangul = { HANGUL+ }
hiragana = { HIRAGANA+ }
arabic = { ARABIC+ }
emoji = { EMOJI+ }

WHITESPACE = _{ " " }
COMMENT = _{ "$"+ }
Expand Down
1 change: 1 addition & 0 deletions pest/src/unicode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ char_property_functions! {
ALPHABETIC, BIDI_CONTROL, CASE_IGNORABLE, CASED, CHANGES_WHEN_CASEFOLDED,
CHANGES_WHEN_CASEMAPPED, CHANGES_WHEN_LOWERCASED, CHANGES_WHEN_TITLECASED,
CHANGES_WHEN_UPPERCASED, DASH, DEFAULT_IGNORABLE_CODE_POINT, DEPRECATED, DIACRITIC,
EMOJI, EMOJI_COMPONENT, EMOJI_MODIFIER, EMOJI_MODIFIER_BASE, EMOJI_PRESENTATION, EXTENDED_PICTOGRAPHIC,
EXTENDER, GRAPHEME_BASE, GRAPHEME_EXTEND, GRAPHEME_LINK, HEX_DIGIT, HYPHEN,
IDS_BINARY_OPERATOR, IDS_TRINARY_OPERATOR, ID_CONTINUE, ID_START, IDEOGRAPHIC, JOIN_CONTROL,
LOGICAL_ORDER_EXCEPTION, LOWERCASE, MATH, NONCHARACTER_CODE_POINT, OTHER_ALPHABETIC,
Expand Down
12 changes: 12 additions & 0 deletions vm/tests/grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1005,3 +1005,15 @@ fn arabic() {
]
}
}

#[test]
fn emoji() {
parses_to! {
parser: vm(),
input: "👶",
rule: "emoji",
tokens: [
emoji(0, 4)
]
}
}

0 comments on commit 047c27e

Please sign in to comment.