[Git][java-team/jruby-joni][master] 8 commits: bump jcodings
Hideki Yamane
gitlab at salsa.debian.org
Mon Apr 27 11:25:46 BST 2020
Hideki Yamane pushed to branch master at Debian Java Maintainers / jruby-joni
Commits:
0eb2a543 by Marcin Mielzynski at 2020-04-04T22:28:07+02:00
bump jcodings
- - - - -
61c20285 by Marcin Mielzynski at 2020-04-04T22:44:48+02:00
use code range enums in grapheme clusters
- - - - -
fe7a1126 by Charles Oliver Nutter at 2020-04-07T15:47:47-05:00
Update to lated jcodings
- - - - -
f76a8933 by Charles Oliver Nutter at 2020-04-07T15:48:22-05:00
[maven-release-plugin] prepare release joni-2.1.32
- - - - -
c1ddaf7b by Charles Oliver Nutter at 2020-04-07T15:48:31-05:00
[maven-release-plugin] prepare for next development iteration
- - - - -
56cade51 by Charles Oliver Nutter at 2020-04-21T14:44:16-05:00
Update jcodings
- - - - -
7879c175 by Charles Oliver Nutter at 2020-04-21T15:07:55-05:00
[maven-release-plugin] prepare release joni-2.1.33
- - - - -
61f332ce by Charles Oliver Nutter at 2020-04-21T15:08:04-05:00
[maven-release-plugin] prepare for next development iteration
- - - - -
2 changed files:
- pom.xml
- src/org/joni/Parser.java
Changes:
=====================================
pom.xml
=====================================
@@ -4,7 +4,7 @@
<groupId>org.jruby.joni</groupId>
<artifactId>joni</artifactId>
<packaging>jar</packaging>
- <version>2.1.32-SNAPSHOT</version>
+ <version>2.1.34-SNAPSHOT</version>
<name>Joni</name>
<description>
Java port of Oniguruma: http://www.geocities.jp/kosako3/oniguruma
@@ -66,7 +66,7 @@
<dependency>
<groupId>org.jruby.jcodings</groupId>
<artifactId>jcodings</artifactId>
- <version>1.0.46</version>
+ <version>1.0.49</version>
</dependency>
<dependency>
<groupId>junit</groupId>
=====================================
src/org/joni/Parser.java
=====================================
@@ -31,6 +31,7 @@ import org.jcodings.Ptr;
import org.jcodings.constants.CharacterType;
import org.jcodings.constants.PosixBracket;
import org.jcodings.exception.InternalException;
+import org.jcodings.unicode.UnicodeCodeRange;
import org.joni.ast.AnchorNode;
import org.joni.ast.AnyCharNode;
import org.joni.ast.BackRefNode;
@@ -898,28 +899,13 @@ class Parser extends Lexer {
return en;
}
- private static class GraphemeNames {
- static final byte[] Grapheme_Cluster_Break_Extend = "Grapheme_Cluster_Break=Extend".getBytes();
- static final byte[] Grapheme_Cluster_Break_Control = "Grapheme_Cluster_Break=Control".getBytes();
- static final byte[] Grapheme_Cluster_Break_Prepend = "Grapheme_Cluster_Break=Prepend".getBytes();
- static final byte[] Grapheme_Cluster_Break_L = "Grapheme_Cluster_Break=L".getBytes();
- static final byte[] Grapheme_Cluster_Break_V = "Grapheme_Cluster_Break=V".getBytes();
- static final byte[] Grapheme_Cluster_Break_LV = "Grapheme_Cluster_Break=LV".getBytes();
- static final byte[] Grapheme_Cluster_Break_LVT = "Grapheme_Cluster_Break=LVT".getBytes();
- static final byte[] Grapheme_Cluster_Break_T = "Grapheme_Cluster_Break=T".getBytes();
- static final byte[] Regional_Indicator = "Regional_Indicator".getBytes();
- static final byte[] Extended_Pictographic = "Extended_Pictographic".getBytes();
- static final byte[] Grapheme_Cluster_Break_SpacingMark = "Grapheme_Cluster_Break=SpacingMark".getBytes();
+ private void addPropertyToCC(CClassNode cc, UnicodeCodeRange range, boolean not) {
+ cc.addCType(range.getCType(), not, false, env, this);
}
- private void addPropertyToCC(CClassNode cc, byte[] propName, boolean not) {
- int ctype = enc.propertyNameToCType(propName, 0, propName.length);
- cc.addCType(ctype, not, false, env, this);
- }
-
- private void createPropertyNode(Node[]nodes, int np, byte[] propName) {
+ private void createPropertyNode(Node[]nodes, int np, UnicodeCodeRange range) {
CClassNode cc = new CClassNode();
- addPropertyToCC(cc, propName, false);
+ addPropertyToCC(cc, range, false);
nodes[np] = cc;
}
@@ -929,11 +915,11 @@ class Parser extends Lexer {
nodes[np] = qnf;
}
- private void quantifierPropertyNode(Node[]nodes, int np, byte[] propName, char repetitions) {
+ private void quantifierPropertyNode(Node[]nodes, int np, UnicodeCodeRange range, char repetitions) {
int lower = 0;
int upper = QuantifierNode.REPEAT_INFINITE;
- createPropertyNode(nodes, np, propName);
+ createPropertyNode(nodes, np, range);
switch (repetitions) {
case '?': upper = 1; break;
case '+': lower = 1; break;
@@ -984,7 +970,7 @@ class Parser extends Lexer {
CClassNode cc;
cc = new CClassNode();
nodes[alts + 1] = cc;
- addPropertyToCC(cc, GraphemeNames.Grapheme_Cluster_Break_Control, false);
+ addPropertyToCC(cc, UnicodeCodeRange.GRAPHEMECLUSTERBREAK_CONTROL, false);
if (enc.minLength() > 1) {
cc.addCodeRange(env, 0x000A, 0x000A);
cc.addCodeRange(env, 0x000D, 0x000D);
@@ -995,41 +981,41 @@ class Parser extends Lexer {
{
int list = alts + 3;
- quantifierPropertyNode(nodes, list + 0, GraphemeNames.Grapheme_Cluster_Break_Prepend, '*');
+ quantifierPropertyNode(nodes, list + 0, UnicodeCodeRange.GRAPHEMECLUSTERBREAK_PREPEND, '*');
{
int coreAlts = list + 2;
{
int HList = coreAlts + 1;
- quantifierPropertyNode(nodes, HList + 0, GraphemeNames.Grapheme_Cluster_Break_L, '*');
+ quantifierPropertyNode(nodes, HList + 0, UnicodeCodeRange.GRAPHEMECLUSTERBREAK_L, '*');
{
int HAlt2 = HList + 2;
- quantifierPropertyNode(nodes, HAlt2 + 0, GraphemeNames.Grapheme_Cluster_Break_V, '+');
+ quantifierPropertyNode(nodes, HAlt2 + 0, UnicodeCodeRange.GRAPHEMECLUSTERBREAK_V, '+');
{
int HList2 = HAlt2 + 2;
- createPropertyNode(nodes, HList2 + 0, GraphemeNames.Grapheme_Cluster_Break_LV);
- quantifierPropertyNode(nodes, HList2 + 1, GraphemeNames.Grapheme_Cluster_Break_V, '*');
+ createPropertyNode(nodes, HList2 + 0, UnicodeCodeRange.GRAPHEMECLUSTERBREAK_LV);
+ quantifierPropertyNode(nodes, HList2 + 1, UnicodeCodeRange.GRAPHEMECLUSTERBREAK_V, '*');
createNodeFromArray(true, nodes, HAlt2 + 1, HList2);
}
- createPropertyNode(nodes, HAlt2 + 2, GraphemeNames.Grapheme_Cluster_Break_LVT);
+ createPropertyNode(nodes, HAlt2 + 2, UnicodeCodeRange.GRAPHEMECLUSTERBREAK_LVT);
createNodeFromArray(false, nodes, HList + 1, HAlt2);
}
- quantifierPropertyNode(nodes, HList + 2, GraphemeNames.Grapheme_Cluster_Break_T, '*');
+ quantifierPropertyNode(nodes, HList + 2, UnicodeCodeRange.GRAPHEMECLUSTERBREAK_T, '*');
createNodeFromArray(true, nodes, coreAlts + 0, HList);
}
- quantifierPropertyNode(nodes, coreAlts + 1, GraphemeNames.Grapheme_Cluster_Break_L, '+');
- quantifierPropertyNode(nodes, coreAlts + 2, GraphemeNames.Grapheme_Cluster_Break_T, '+');
- quantifierPropertyNode(nodes, coreAlts + 3, GraphemeNames.Regional_Indicator, '2');
+ quantifierPropertyNode(nodes, coreAlts + 1, UnicodeCodeRange.GRAPHEMECLUSTERBREAK_L, '+');
+ quantifierPropertyNode(nodes, coreAlts + 2, UnicodeCodeRange.GRAPHEMECLUSTERBREAK_T, '+');
+ quantifierPropertyNode(nodes, coreAlts + 3, UnicodeCodeRange.REGIONALINDICATOR, '2');
{
int XPList = coreAlts + 5;
- createPropertyNode(nodes, XPList + 0, GraphemeNames.Extended_Pictographic);
+ createPropertyNode(nodes, XPList + 0, UnicodeCodeRange.EXTENDEDPICTOGRAPHIC);
{
int ExList = XPList + 2;
- quantifierPropertyNode(nodes, ExList + 0, GraphemeNames.Grapheme_Cluster_Break_Extend, '*');
+ quantifierPropertyNode(nodes, ExList + 0, UnicodeCodeRange.GRAPHEMECLUSTERBREAK_EXTEND, '*');
strNode = new StringNode(Config.ENC_CODE_TO_MBC_MAXLEN);
strNode.setRaw();
strNode.catCode(0x200D, enc);
nodes[ExList + 1] = strNode;
- createPropertyNode(nodes, ExList + 2, GraphemeNames.Extended_Pictographic);
+ createPropertyNode(nodes, ExList + 2, UnicodeCodeRange.EXTENDEDPICTOGRAPHIC);
createNodeFromArray(true, nodes, XPList + 1, ExList);
}
quantifierNode(nodes, XPList + 1, 0, QuantifierNode.REPEAT_INFINITE);
@@ -1038,20 +1024,20 @@ class Parser extends Lexer {
cc = new CClassNode();
nodes[coreAlts + 5] = cc;
if (enc.minLength() > 1) {
- addPropertyToCC(cc, GraphemeNames.Grapheme_Cluster_Break_Control, false);
+ addPropertyToCC(cc, UnicodeCodeRange.GRAPHEMECLUSTERBREAK_CONTROL, false);
cc.addCodeRange(env, 0x000A, 0x000A);
cc.addCodeRange(env, 0x000D, 0x000D);
cc.mbuf = CodeRangeBuffer.notCodeRangeBuff(env, cc.mbuf);
} else {
- addPropertyToCC(cc, GraphemeNames.Grapheme_Cluster_Break_Control, true);
+ addPropertyToCC(cc, UnicodeCodeRange.GRAPHEMECLUSTERBREAK_CONTROL, true);
cc.bs.clear(0x0A);
cc.bs.clear(0x0D);
}
createNodeFromArray(false, nodes, list + 1, coreAlts);
}
- createPropertyNode(nodes, list + 2, GraphemeNames.Grapheme_Cluster_Break_Extend);
+ createPropertyNode(nodes, list + 2, UnicodeCodeRange.GRAPHEMECLUSTERBREAK_EXTEND);
cc = (CClassNode)nodes[list + 2];
- addPropertyToCC(cc, GraphemeNames.Grapheme_Cluster_Break_SpacingMark, false);
+ addPropertyToCC(cc, UnicodeCodeRange.GRAPHEMECLUSTERBREAK_SPACINGMARK, false);
cc.addCodeRange(env, 0x200D, 0x200D);
quantifierNode(nodes, list + 2, 0, QuantifierNode.REPEAT_INFINITE);
createNodeFromArray(true, nodes, alts + 2, list);
View it on GitLab: https://salsa.debian.org/java-team/jruby-joni/-/compare/e2765a452e6cacd90cb916739771fc78de606847...61f332ce3fcb22e1e097ed417b888faddf65a9e2
--
View it on GitLab: https://salsa.debian.org/java-team/jruby-joni/-/compare/e2765a452e6cacd90cb916739771fc78de606847...61f332ce3fcb22e1e097ed417b888faddf65a9e2
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20200427/980438ed/attachment.html>
More information about the pkg-java-commits
mailing list