Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from upstream, including fixes for ITRK-1584 #24

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions share/ucd/CaseFolding.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CaseFolding-15.0.0.txt
# Date: 2022-02-02, 23:35:35 GMT
# © 2022 Unicode®, Inc.
# CaseFolding-15.1.0.txt
# Date: 2023-05-12, 21:53:10 GMT
# © 2023 Unicode®, Inc.
# Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries.
# For terms of use, see https://www.unicode.org/terms_of_use.html
#
Expand Down Expand Up @@ -929,6 +929,7 @@
1FCC; S; 1FC3; # GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI
1FD2; F; 03B9 0308 0300; # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA
1FD3; F; 03B9 0308 0301; # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA
1FD3; S; 0390; # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA
1FD6; F; 03B9 0342; # GREEK SMALL LETTER IOTA WITH PERISPOMENI
1FD7; F; 03B9 0308 0342; # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
1FD8; C; 1FD0; # GREEK CAPITAL LETTER IOTA WITH VRACHY
Expand All @@ -937,6 +938,7 @@
1FDB; C; 1F77; # GREEK CAPITAL LETTER IOTA WITH OXIA
1FE2; F; 03C5 0308 0300; # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA
1FE3; F; 03C5 0308 0301; # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA
1FE3; S; 03B0; # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA
1FE4; F; 03C1 0313; # GREEK SMALL LETTER RHO WITH PSILI
1FE6; F; 03C5 0342; # GREEK SMALL LETTER UPSILON WITH PERISPOMENI
1FE7; F; 03C5 0308 0342; # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
Expand Down Expand Up @@ -1328,6 +1330,7 @@ FB02; F; 0066 006C; # LATIN SMALL LIGATURE FL
FB03; F; 0066 0066 0069; # LATIN SMALL LIGATURE FFI
FB04; F; 0066 0066 006C; # LATIN SMALL LIGATURE FFL
FB05; F; 0073 0074; # LATIN SMALL LIGATURE LONG S T
FB05; S; FB06; # LATIN SMALL LIGATURE LONG S T
FB06; F; 0073 0074; # LATIN SMALL LIGATURE ST
FB13; F; 0574 0576; # ARMENIAN SMALL LIGATURE MEN NOW
FB14; F; 0574 0565; # ARMENIAN SMALL LIGATURE MEN ECH
Expand Down
2 changes: 1 addition & 1 deletion share/ucd/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
UCD_URL ?= https://www.unicode.org/Public/15.0.0/ucd/
UCD_URL ?= https://www.unicode.org/Public/15.1.0/ucd/

WGET ?= wget

Expand Down
14 changes: 8 additions & 6 deletions share/ucd/Scripts.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Scripts-15.0.0.txt
# Date: 2022-04-26, 23:15:02 GMT
# © 2022 Unicode®, Inc.
# Scripts-15.1.0.txt
# Date: 2023-07-28, 16:01:07 GMT
# © 2023 Unicode®, Inc.
# Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries.
# For terms of use, see https://www.unicode.org/terms_of_use.html
#
Expand Down Expand Up @@ -357,7 +357,7 @@
2E5B ; Common # Ps BOTTOM HALF LEFT PARENTHESIS
2E5C ; Common # Pe BOTTOM HALF RIGHT PARENTHESIS
2E5D ; Common # Pd OBLIQUE HYPHEN
2FF0..2FFB ; Common # So [12] IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO RIGHT..IDEOGRAPHIC DESCRIPTION CHARACTER OVERLAID
2FF0..2FFF ; Common # So [16] IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO RIGHT..IDEOGRAPHIC DESCRIPTION CHARACTER ROTATION
3000 ; Common # Zs IDEOGRAPHIC SPACE
3001..3003 ; Common # Po [3] IDEOGRAPHIC COMMA..DITTO MARK
3004 ; Common # So JAPANESE INDUSTRIAL STANDARD SYMBOL
Expand Down Expand Up @@ -399,6 +399,7 @@
3192..3195 ; Common # No [4] IDEOGRAPHIC ANNOTATION ONE MARK..IDEOGRAPHIC ANNOTATION FOUR MARK
3196..319F ; Common # So [10] IDEOGRAPHIC ANNOTATION TOP MARK..IDEOGRAPHIC ANNOTATION MAN MARK
31C0..31E3 ; Common # So [36] CJK STROKE T..CJK STROKE Q
31EF ; Common # So IDEOGRAPHIC DESCRIPTION CHARACTER SUBTRACTION
3220..3229 ; Common # No [10] PARENTHESIZED IDEOGRAPH ONE..PARENTHESIZED IDEOGRAPH TEN
322A..3247 ; Common # So [30] PARENTHESIZED IDEOGRAPH MOON..CIRCLED IDEOGRAPH KOTO
3248..324F ; Common # No [8] CIRCLED NUMBER TEN ON BLACK SQUARE..CIRCLED NUMBER EIGHTY ON BLACK SQUARE
Expand Down Expand Up @@ -629,7 +630,7 @@ FFFC..FFFD ; Common # So [2] OBJECT REPLACEMENT CHARACTER..REPLACEMENT CHAR
E0001 ; Common # Cf LANGUAGE TAG
E0020..E007F ; Common # Cf [96] TAG SPACE..CANCEL TAG

# Total code points: 8301
# Total code points: 8306

# ================================================

Expand Down Expand Up @@ -1593,11 +1594,12 @@ FA70..FAD9 ; Han # Lo [106] CJK COMPATIBILITY IDEOGRAPH-FA70..CJK COMPATIBILI
2B740..2B81D ; Han # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D
2B820..2CEA1 ; Han # Lo [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1
2CEB0..2EBE0 ; Han # Lo [7473] CJK UNIFIED IDEOGRAPH-2CEB0..CJK UNIFIED IDEOGRAPH-2EBE0
2EBF0..2EE5D ; Han # Lo [622] CJK UNIFIED IDEOGRAPH-2EBF0..CJK UNIFIED IDEOGRAPH-2EE5D
2F800..2FA1D ; Han # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D
30000..3134A ; Han # Lo [4939] CJK UNIFIED IDEOGRAPH-30000..CJK UNIFIED IDEOGRAPH-3134A
31350..323AF ; Han # Lo [4192] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-323AF

# Total code points: 98408
# Total code points: 99030

# ================================================

Expand Down
7 changes: 7 additions & 0 deletions share/ucd/UnicodeData.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11231,6 +11231,10 @@
2FF9;IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM UPPER RIGHT;So;0;ON;;;;;N;;;;;
2FFA;IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM LOWER LEFT;So;0;ON;;;;;N;;;;;
2FFB;IDEOGRAPHIC DESCRIPTION CHARACTER OVERLAID;So;0;ON;;;;;N;;;;;
2FFC;IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM RIGHT;So;0;ON;;;;;N;;;;;
2FFD;IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM LOWER RIGHT;So;0;ON;;;;;N;;;;;
2FFE;IDEOGRAPHIC DESCRIPTION CHARACTER HORIZONTAL REFLECTION;So;0;ON;;;;;N;;;;;
2FFF;IDEOGRAPHIC DESCRIPTION CHARACTER ROTATION;So;0;ON;;;;;N;;;;;
3000;IDEOGRAPHIC SPACE;Zs;0;WS;<wide> 0020;;;;N;;;;;
3001;IDEOGRAPHIC COMMA;Po;0;ON;;;;;N;;;;;
3002;IDEOGRAPHIC FULL STOP;Po;0;ON;;;;;N;IDEOGRAPHIC PERIOD;;;;
Expand Down Expand Up @@ -11705,6 +11709,7 @@
31E1;CJK STROKE HZZZG;So;0;ON;;;;;N;;;;;
31E2;CJK STROKE PG;So;0;ON;;;;;N;;;;;
31E3;CJK STROKE Q;So;0;ON;;;;;N;;;;;
31EF;IDEOGRAPHIC DESCRIPTION CHARACTER SUBTRACTION;So;0;ON;;;;;N;;;;;
31F0;KATAKANA LETTER SMALL KU;Lo;0;L;;;;;N;;;;;
31F1;KATAKANA LETTER SMALL SI;Lo;0;L;;;;;N;;;;;
31F2;KATAKANA LETTER SMALL SU;Lo;0;L;;;;;N;;;;;
Expand Down Expand Up @@ -34035,6 +34040,8 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
2CEA1;<CJK Ideograph Extension E, Last>;Lo;0;L;;;;;N;;;;;
2CEB0;<CJK Ideograph Extension F, First>;Lo;0;L;;;;;N;;;;;
2EBE0;<CJK Ideograph Extension F, Last>;Lo;0;L;;;;;N;;;;;
2EBF0;<CJK Ideograph Extension I, First>;Lo;0;L;;;;;N;;;;;
2EE5D;<CJK Ideograph Extension I, Last>;Lo;0;L;;;;;N;;;;;
2F800;CJK COMPATIBILITY IDEOGRAPH-2F800;Lo;0;L;4E3D;;;;N;;;;;
2F801;CJK COMPATIBILITY IDEOGRAPH-2F801;Lo;0;L;4E38;;;;N;;;;;
2F802;CJK COMPATIBILITY IDEOGRAPH-2F802;Lo;0;L;4E41;;;;N;;;;;
Expand Down
22 changes: 20 additions & 2 deletions src/libre/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -997,13 +997,31 @@ ast_expr_is_literal(const struct ast_expr *e,
*anchor_end = 1;
}

done:

for (i = 0; i < count; i++) {
if (nodes[i] == NULL || nodes[i]->type != AST_EXPR_LITERAL) {
return 0;
}
}

done:
/* mask out AST flags that we don't care about; these may be present or not */
int ast_flags = nodes[i]->flags
& ~(AST_FLAG_FIRST | AST_FLAG_LAST | AST_FLAG_ALWAYS_CONSUMES | AST_FLAG_CAN_CONSUME);

/* we reject anything else */
if (ast_flags != 0) {
return 0;
}

/* mask out re flags that we don't handle here yet (the caller is responsible for these) */
int re_flags = nodes[i]->re_flags
& ~(RE_END_NL);

/* and we don't permit any other re_flags */
if (re_flags != 0) {
return 0;
}
}

*n = count + is_end_nl;

Expand Down
4 changes: 2 additions & 2 deletions src/libre/class/utf8_Common.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/libre/class/utf8_Han.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/libre/class/utf8_L.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/libre/class/utf8_Lo.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/libre/class/utf8_S.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/libre/class/utf8_So.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/libre/class/utf8_assigned.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/re_literal/in13.re
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
^(?i)a$
1 change: 1 addition & 0 deletions tests/re_literal/in14.re
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(?:x(?i)a)
1 change: 1 addition & 0 deletions tests/re_literal/in15.re
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(?i)
1 change: 1 addition & 0 deletions tests/re_literal/in16.re
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(?i)xy
1 change: 1 addition & 0 deletions tests/re_literal/in17.re
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a(?i)xy
1 change: 1 addition & 0 deletions tests/re_literal/in18.re
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a(?:x(?i)xy)
1 change: 1 addition & 0 deletions tests/re_literal/in19.re
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a(?:x(?-i)xy)
1 change: 1 addition & 0 deletions tests/re_literal/in20.re
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(?i)(?:(?-i)a)(?:x(?-i)xy)
1 change: 1 addition & 0 deletions tests/re_literal/in21.re
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(?i)(?:(?-i)a)(?:(?-i)x(?-i)xy)
1 change: 1 addition & 0 deletions tests/re_literal/in22.re
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(?s)a
1 change: 1 addition & 0 deletions tests/re_literal/in23.re
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(?x)a
1 change: 1 addition & 0 deletions tests/re_literal/in24.re
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(?n)a
1 change: 1 addition & 0 deletions tests/re_literal/out13.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
non-literal
1 change: 1 addition & 0 deletions tests/re_literal/out14.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
non-literal
2 changes: 2 additions & 0 deletions tests/re_literal/out15.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
anchors:
literal:
1 change: 1 addition & 0 deletions tests/re_literal/out16.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
non-literal
1 change: 1 addition & 0 deletions tests/re_literal/out17.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
non-literal
1 change: 1 addition & 0 deletions tests/re_literal/out18.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
non-literal
2 changes: 2 additions & 0 deletions tests/re_literal/out19.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
anchors:
literal: axxy
1 change: 1 addition & 0 deletions tests/re_literal/out20.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
non-literal
2 changes: 2 additions & 0 deletions tests/re_literal/out21.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
anchors:
literal: axxy
1 change: 1 addition & 0 deletions tests/re_literal/out22.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
non-literal
1 change: 1 addition & 0 deletions tests/re_literal/out23.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
non-literal
2 changes: 2 additions & 0 deletions tests/re_literal/out24.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
anchors:
literal: a
Loading