public class RegexpSupport extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RegexpSupport.ErrorMode |
Constructor and Description |
---|
RegexpSupport() |
Modifier and Type | Method and Description |
---|---|
static void |
appendOptions(org.jruby.util.ByteList to,
RegexpOptions options) |
static void |
appendRegexpString19(Ruby runtime,
org.jruby.util.ByteList to,
byte[] bytes,
int start,
int len,
org.jcodings.Encoding enc,
org.jcodings.Encoding resEnc) |
static org.jruby.util.ByteList |
preprocess(Ruby runtime,
org.jruby.util.ByteList str,
org.jcodings.Encoding enc,
org.jcodings.Encoding[] fixedEnc,
RegexpSupport.ErrorMode mode)
Preprocess the given string for use in regexp, raising errors for encoding
incompatibilities that arise.
|
static int |
raisePreprocessError(Ruby runtime,
org.jruby.util.ByteList str,
String err,
RegexpSupport.ErrorMode mode) |
static void |
raiseRegexpError19(Ruby runtime,
org.jruby.util.ByteList bytes,
org.jcodings.Encoding enc,
RegexpOptions options,
String err) |
static int |
readEscapedByte(Ruby runtime,
byte[] to,
int toP,
byte[] bytes,
int p,
int end,
org.jruby.util.ByteList str,
RegexpSupport.ErrorMode mode) |
static org.jruby.util.ByteList |
regexpDescription19(Ruby runtime,
org.jruby.util.ByteList bytes,
RegexpOptions options,
org.jcodings.Encoding enc) |
static boolean |
unescapeNonAscii(Ruby runtime,
org.jruby.util.ByteList to,
byte[] bytes,
int p,
int end,
org.jcodings.Encoding enc,
org.jcodings.Encoding[] encp,
org.jruby.util.ByteList str,
RegexpSupport.ErrorMode mode)
Unescape non-ascii elements in the given string, appending the results
to the given bytelist if provided.
|
public static org.jruby.util.ByteList preprocess(Ruby runtime, org.jruby.util.ByteList str, org.jcodings.Encoding enc, org.jcodings.Encoding[] fixedEnc, RegexpSupport.ErrorMode mode)
runtime
- current runtimestr
- string to preprocessenc
- string's encodingfixedEnc
- new encoding after fixingmode
- mode of errorspublic static boolean unescapeNonAscii(Ruby runtime, org.jruby.util.ByteList to, byte[] bytes, int p, int end, org.jcodings.Encoding enc, org.jcodings.Encoding[] encp, org.jruby.util.ByteList str, RegexpSupport.ErrorMode mode)
runtime
- current runtimeto
- output bytelist; if null, no appending will be donebytes
- the bytes to unescapep
- starting positionend
- ending positionenc
- bytes' encodingencp
- out param for fixed encodingstr
- original wrapper for the bytesmode
- error modepublic static int raisePreprocessError(Ruby runtime, org.jruby.util.ByteList str, String err, RegexpSupport.ErrorMode mode)
public static void raiseRegexpError19(Ruby runtime, org.jruby.util.ByteList bytes, org.jcodings.Encoding enc, RegexpOptions options, String err)
public static org.jruby.util.ByteList regexpDescription19(Ruby runtime, org.jruby.util.ByteList bytes, RegexpOptions options, org.jcodings.Encoding enc)
public static void appendRegexpString19(Ruby runtime, org.jruby.util.ByteList to, byte[] bytes, int start, int len, org.jcodings.Encoding enc, org.jcodings.Encoding resEnc)
public static void appendOptions(org.jruby.util.ByteList to, RegexpOptions options)
public static int readEscapedByte(Ruby runtime, byte[] to, int toP, byte[] bytes, int p, int end, org.jruby.util.ByteList str, RegexpSupport.ErrorMode mode)
Copyright © 2001-2016 JRuby. All Rights Reserved.