Created
September 15, 2014 21:37
-
-
Save lizmat/4f31120e7ca6bbebc16d to your computer and use it in GitHub Desktop.
diff for adding CCLASS_CRLF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/docs/ops.markdown b/docs/ops.markdown | |
index 30554c7..a71c968 100755 | |
--- a/docs/ops.markdown | |
+++ b/docs/ops.markdown | |
@@ -1685,6 +1685,7 @@ constants below can be used in nqp as (e.g.) `nqp::const::CCLASS_ANY`. | |
* CCLASS_ALPHANUMERIC | |
* CCLASS_NEWLINE | |
* CCLASS_WORD | |
+ * CCLASS_CRLF | |
* HLL_ROLE_NONE | |
* HLL_ROLE_INT | |
diff --git a/src/QRegex/NFA.nqp b/src/QRegex/NFA.nqp | |
index c8aad8b..45d492a 100755 | |
--- a/src/QRegex/NFA.nqp | |
+++ b/src/QRegex/NFA.nqp | |
@@ -98,6 +98,7 @@ class QRegex::NFA { | |
%cclass_code<w> := nqp::const::CCLASS_WORD; | |
%cclass_code<n> := nqp::const::CCLASS_NEWLINE; | |
%cclass_code<nl> := nqp::const::CCLASS_NEWLINE; | |
+ %cclass_code<cl> := nqp::const::CCLASS_CRLF; | |
} | |
method cclass($node, $from, $to) { | |
diff --git a/src/vm/jvm/QAST/Compiler.nqp b/src/vm/jvm/QAST/Compiler.nqp | |
index a2307c3..c2927c1 100644 | |
--- a/src/vm/jvm/QAST/Compiler.nqp | |
+++ b/src/vm/jvm/QAST/Compiler.nqp | |
@@ -1923,6 +1923,7 @@ my %const_map := nqp::hash( | |
'CCLASS_ALPHANUMERIC', 2048, | |
'CCLASS_NEWLINE', 4096, | |
'CCLASS_WORD', 8192, | |
+ 'CCLASS_CRLF', 16384, | |
'HLL_ROLE_NONE', 0, | |
'HLL_ROLE_INT', 1, | |
@@ -5091,6 +5092,7 @@ class QAST::CompilerJAST { | |
%cclass_code<s> := nqp::const::CCLASS_WHITESPACE; | |
%cclass_code<w> := nqp::const::CCLASS_WORD; | |
%cclass_code<n> := nqp::const::CCLASS_NEWLINE; | |
+ %cclass_code<cl> := nqp::const::CCLASS_CRLF; | |
} | |
method cclass($node) { | |
diff --git a/src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java b/src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java | |
index ce318ee..48561dd 100644 | |
--- a/src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java | |
+++ b/src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java | |
@@ -3406,6 +3406,7 @@ public final class Ops { | |
private static final int CCLASS_ALPHANUMERIC = 2048; | |
private static final int CCLASS_NEWLINE = 4096; | |
private static final int CCLASS_WORD = 8192; | |
+ private static final int CCLASS_CRLF = 16384; | |
private static final int PUNCT_TYPES = | |
(1 << Character.CONNECTOR_PUNCTUATION) | (1 << Character.DASH_PUNCTUATION) | | |
(1 << Character.END_PUNCTUATION) | (1 << Character.FINAL_QUOTE_PUNCTUATION) | | |
@@ -3440,6 +3441,8 @@ public final class Ops { | |
(test == '\n' || test == '\u000b' || test == '\f' || test == '\r' || | |
test == '\u0085' || test == '\u2029') | |
? 1 : 0; | |
+ case CCLASS_CRLF: | |
+ return (test == '\r' || test == '\n') ? 1 : 0; | |
case CCLASS_ALPHABETIC: | |
return Character.isAlphabetic(test) ? 1 : 0; | |
case CCLASS_UPPERCASE: | |
diff --git a/src/vm/moar/QAST/QASTOperationsMAST.nqp b/src/vm/moar/QAST/QASTOperationsMAST.nqp | |
index 6854846..c69f213 100644 | |
--- a/src/vm/moar/QAST/QASTOperationsMAST.nqp | |
+++ b/src/vm/moar/QAST/QASTOperationsMAST.nqp | |
@@ -1838,6 +1838,7 @@ my %const_map := nqp::hash( | |
'CCLASS_ALPHANUMERIC', 2048, | |
'CCLASS_NEWLINE', 4096, | |
'CCLASS_WORD', 8192, | |
+ 'CCLASS_CRLF', 16384, | |
'HLL_ROLE_NONE', 0, | |
'HLL_ROLE_INT', 1, | |
diff --git a/src/vm/moar/QAST/QASTRegexCompilerMAST.nqp b/src/vm/moar/QAST/QASTRegexCompilerMAST.nqp | |
index eae9d83..0f727e1 100644 | |
--- a/src/vm/moar/QAST/QASTRegexCompilerMAST.nqp | |
+++ b/src/vm/moar/QAST/QASTRegexCompilerMAST.nqp | |
@@ -421,6 +421,7 @@ class QAST::MASTRegexCompiler { | |
%cclass_code<s> := nqp::const::CCLASS_WHITESPACE; | |
%cclass_code<w> := nqp::const::CCLASS_WORD; | |
%cclass_code<n> := nqp::const::CCLASS_NEWLINE; | |
+ %cclass_code<cl> := nqp::const::CCLASS_CRLF; | |
} | |
method cclass($node) { | |
diff --git a/src/vm/parrot/QAST/Compiler.nqp b/src/vm/parrot/QAST/Compiler.nqp | |
index 32abe79..cf61339 100644 | |
--- a/src/vm/parrot/QAST/Compiler.nqp | |
+++ b/src/vm/parrot/QAST/Compiler.nqp | |
@@ -1429,6 +1429,7 @@ class QAST::Compiler is HLL::Compiler { | |
%cclass_code<s> := '.CCLASS_WHITESPACE'; | |
%cclass_code<w> := '.CCLASS_WORD'; | |
%cclass_code<n> := '.CCLASS_NEWLINE'; | |
+ %cclass_code<cl> := '.CCLASS_CRLF'; | |
} | |
method cclass($node) { | |
diff --git a/src/vm/parrot/QAST/Operations.nqp b/src/vm/parrot/QAST/Operations.nqp | |
index 24d0d93..42fd642 100644 | |
--- a/src/vm/parrot/QAST/Operations.nqp | |
+++ b/src/vm/parrot/QAST/Operations.nqp | |
@@ -1233,6 +1233,7 @@ my %const_map := nqp::hash( | |
'CCLASS_GRAPHICAL', pir::const::CCLASS_GRAPHICAL, | |
'CCLASS_WORD', pir::const::CCLASS_WORD, | |
'CCLASS_NEWLINE', pir::const::CCLASS_NEWLINE, | |
+ 'CCLASS_CRLF', pir::const::CCLASS_CRLF, | |
'CCLASS_ALPHABETIC', pir::const::CCLASS_ALPHABETIC, | |
'CCLASS_UPPERCASE', pir::const::CCLASS_UPPERCASE, | |
'CCLASS_LOWERCASE', pir::const::CCLASS_LOWERCASE, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment