opened
mathiasbynens
username_0
Why is `\a` special (i.e. marked as `meta`)? https://github.com/username_1/regexp-tree/blob/f4c21f12888efff7088fc7734db3273920150bcd/src/generator/__tests__/generator-basic-test.js#L51

```
$ regexp-tree -e '/\a/'
{
  "type": "RegExp",
  "body": {
    "type": "Char",
    "value": "\\a",
    "kind": "meta"
  },
  "flags": []
}
```

Is it not just a simple escape like e.g. `\e`?

```
$ regexp-tree -e '/\e/'
{
  "type": "RegExp",
  "body": {
    "type": "Char",
    "value": "e",
    "kind": "simple",
    "escaped": true
  },
  "flags": []
}
```
Why is `\a` special-cased?
issue
created
DmitrySoshnikov
username_1
Ah, seems I had in mind Ruby's `\A` (same as `^`) when made this typo. In any case `\a` is not correct, and we're not going to support `\A` either yet, so we should remove `a` from [special chars](https://github.com/username_1/regexp-tree/blob/master/src/parser/regexp.bnf#L65). Thanks for the catch!
comment
created
DmitrySoshnikov
username_1
Fixed in https://github.com/username_1/regexp-tree/commit/499d82673fd71307d2cec96521e6ca5f15ad07de (and in `0.0.14`).
comment
closed
DmitrySoshnikov
username_1
issue
created
mathiasbynens
username_0
499d82673fd71307d2cec96521e6ca5f15ad07de removed `b` and `B` too. Was that intentional?
comment
created
DmitrySoshnikov
username_1
Yeah, they were unnecessary there, since `\b`, and `\B` are [handled separately](https://github.com/username_1/regexp-tree/blob/master/src/parser/regexp.bnf#L51-L52) yielding different token types, and are [parsed](https://github.com/username_1/regexp-tree/blob/master/src/parser/regexp.bnf#L279-L280) as `Assertion`, not as a meta `Char`. And in a character class `[\b]` it's handled as well, and is [parsed](https://github.com/username_1/regexp-tree/blob/master/src/parser/regexp.bnf#L529-L530) as a meta `Char` (backspace).
comment