123456789_123456789_123456789_123456789_123456789_

Module: Prism::RegularExpressionOptions

Do not use. This module is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/prism/node_ext.rb

Instance Method Summary

  • #options

    Returns a numeric value that represents the flags that were used to create the regular expression.

Instance Method Details

#options

Returns a numeric value that represents the flags that were used to create the regular expression.

[ GitHub ]

  
# File 'lib/prism/node_ext.rb', line 20

def options
  o = flags & (RegularExpressionFlags::IGNORE_CASE | RegularExpressionFlags::EXTENDED | 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