Skip to content

Pretty-print regular expression options #62

@flavorjones

Description

@flavorjones

Given the trivial program

/asdf/
/asdf/i
/asdf/m
/asdf/x
/asdf/o
/asdf/imxo

the pretty-print for each of these regular expressions literals is identical:

(program
  (statements
    ((regexp_literal ((tstring_content "asdf"))),
      (regexp_literal ((tstring_content "asdf"))),
      (regexp_literal ((tstring_content "asdf"))),
      (regexp_literal ((tstring_content "asdf"))),
      (regexp_literal ((tstring_content "asdf"))),
      (regexp_literal ((tstring_content "asdf"))))))

even though they have different options (which are present in the AST node as part of the ending attribute).

I'm happy to submit a PR to change this behavior if you a) think it would be valuable, and b) would be so kind as to suggest the sexp structure you'd like to emit in this case.

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