Skip to content
This repository was archived by the owner on Sep 20, 2021. It is now read-only.
This repository was archived by the owner on Sep 20, 2021. It is now read-only.

Incomplete support for internal option setting #29

@ju1ius

Description

@ju1ius

Hi !

What works

  • Setting a single option: a(?i)b
  • Unsetting a single option: a(?-i)b

All the above work only for the i, m, s and x options.

What doesn't work:

  1. Setting / unsetting the U, X, and J options
  2. Setting several options: a(?im)b
  3. Unsetting several options: a(?-i-m)b
  4. Mixing the above two: a(?i-m)b
  5. Setting options for a non-capturing group: a(?i:b)c
  6. The grammar allows the (?+i) syntax, but according to the documentation and the PHP implementation this is invalid.

All the above fail with: Unexpected token "?" (zero_or_one) at line 1 and column 3

Possible fixes

Changing the grammar to:

// Internal options.
%token internal_option \(\?(-?[imsxJUX])+\)

solves n° 1, 2, 3, 4 & 6.
n° 5 is a bit more complex... 😉


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions