Class PythonFlags

All Implemented Interfaces:
com.oracle.truffle.api.interop.TruffleObject

public final class PythonFlags extends AbstractConstantKeysObject
An immutable representation of a set of Python regular expression flags.
  • Field Details

    • EMPTY_INSTANCE

      public static final PythonFlags EMPTY_INSTANCE
    • TYPE_FLAGS_INSTANCE

      public static final PythonFlags TYPE_FLAGS_INSTANCE
  • Constructor Details

    • PythonFlags

      public PythonFlags(String source)
  • Method Details

    • isIgnoreCase

      public boolean isIgnoreCase()
    • isLocale

      public boolean isLocale()
    • isMultiLine

      public boolean isMultiLine()
    • isDotAll

      public boolean isDotAll()
    • isVerbose

      public boolean isVerbose()
    • isAscii

      public boolean isAscii()
    • isTemplate

      public boolean isTemplate()
    • isUnicodeExplicitlySet

      public boolean isUnicodeExplicitlySet()
    • isUnicode

      public boolean isUnicode(PythonREMode mode)
      Returns true if the Unicode flag is set or if it would be set by default.
    • addFlag

      public PythonFlags addFlag(int flagChar)
    • addFlags

      public PythonFlags addFlags(PythonFlags otherFlags)
    • delFlags

      public PythonFlags delFlags(PythonFlags otherFlags)
    • fixFlags

      public PythonFlags fixFlags(RegexSource source, PythonREMode mode)
      Verifies that there is at most one type flag and that the type flag is compatible with the chosen regular expression mode. If a string pattern is used, ensures that the unicode flag is set by default.
    • isValidFlagChar

      public static boolean isValidFlagChar(int candidateChar)
    • isTypeFlagChar

      public static boolean isTypeFlagChar(int candidateChar)
    • numberOfTypeFlags

      public int numberOfTypeFlags()
    • includesGlobalFlags

      public boolean includesGlobalFlags()
    • overlaps

      public boolean overlaps(PythonFlags otherFlags)
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toDisplayString

      public Object toDisplayString(boolean allowSideEffects)
      Overrides:
      toDisplayString in class AbstractRegexObject
    • getKeys

      public TruffleReadOnlyKeysArray getKeys()
      Specified by:
      getKeys in class AbstractConstantKeysObject
    • isMemberReadableImpl

      public boolean isMemberReadableImpl(String symbol)
      Specified by:
      isMemberReadableImpl in class AbstractConstantKeysObject
    • readMemberImpl

      public Object readMemberImpl(String symbol) throws com.oracle.truffle.api.interop.UnknownIdentifierException
      Specified by:
      readMemberImpl in class AbstractConstantKeysObject
      Throws:
      com.oracle.truffle.api.interop.UnknownIdentifierException