Module: Prism::RegularExpressionOptions
Do not use. This module is for internal use only.
| Relationships & Source Files | |
| Defined in: | lib/prism/node_ext.rb |
Class Method Summary
-
.options(flags)
Returns a numeric value that represents the flags that were used to create the regular expression.
Class Method Details
.options(flags)
Returns a numeric value that represents the flags that were used to create the regular expression.
# File 'lib/prism/node_ext.rb', line 30
def self.(flags) o = 0 o |= Regexp::IGNORECASE if flags.anybits?(RegularExpressionFlags::IGNORE_CASE) o |= Regexp::EXTENDED if flags.anybits?(RegularExpressionFlags::EXTENDED) o |= Regexp::MULTILINE if flags.anybits?(RegularExpressionFlags::MULTI_LINE) o |= Regexp::FIXEDENCODING if flags.anybits?(RegularExpressionFlags::EUC_JP | RegularExpressionFlags::WINDOWS_31J | RegularExpressionFlags::UTF_8) o |= Regexp::NOENCODING if flags.anybits?(RegularExpressionFlags::ASCII_8BIT) o end