Avoid potential use-after-free in regex scanner (#90)
Avoid potential use-after-free in regex scanner (#90)

* Avoid potential use-after-free in regex scanner

`literal` is a reference to the last element so it is invalidated after we call
`literal.pop_back()`. Use a temporary so we don't use `literal` after it has
been popped:

```
==14==ERROR: AddressSanitizer: container-overflow on address 0x603000000160 at pc 0x00000051bfe2 bp 0x7ffca8ec7980 sp 0x7ffca8ec7978
READ of size 4 at 0x603000000160 thread T0
SCARINESS: 17 (4-byte-read-container-overflow)
    #0 0x51bfe1 in (anonymous namespace)::Scanner::scan_literal_content(TSLexer*) /src/octofuzz/tree-sitter/test/fixtures/grammars/ruby/src/scanner.cc:669:25
    #1 0x51884f in (anonymous namespace)::Scanner::scan(TSLexer*, bool const*) /src/octofuzz/tree-sitter/test/fixtures/grammars/ruby/src/scanner.cc:726:16
    #2 0x66cda7 in ts_parser__lex /src/octofuzz/tree-sitter/src/runtime/parser.c:324:11
```

* Simplify regex literal logic

tree-sitter/tree-sitter-ruby,tree-sitter/tree-sitter-ruby,tree-sitter/tree-sitter-ruby,tree-sitter/tree-sitter-ruby,tree-sitter/tree-sitter-ruby,tree-sitter/tree-sitter-ruby,tree-sitter/tree-sitter-ruby,tree-sitter/tree-sitter-ruby