diff options
| author | Aaron Patterson <tenderlove@ruby-lang.org> | 2024-02-25 16:45:08 -0800 |
|---|---|---|
| committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2024-02-26 15:54:54 +0900 |
| commit | 164e464b042239cdbd14d3751a7f907754d580ce (patch) | |
| tree | 6e4afbb42ab04688a0baa125ba3831bbc568c7ef /include/ruby/internal/variable.h | |
| parent | 7176c186d0d794bf89eac0645205c3f3d2d40f2d (diff) | |
[ruby/strscan] Add a method for peeking and reading bytes as
integers
(https://github.com/ruby/strscan/pull/89)
This commit adds `scan_byte` and `peek_byte`. `scan_byte` will scan the
current byte, return it as an integer, and advance the cursor.
`peek_byte` will return the current byte as an integer without advancing
the cursor.
Currently `StringScanner#get_byte` returns a string, but I want to get
the current byte without allocating a string. I think this will help
with writing high performance lexers.
---------
https://github.com/ruby/strscan/commit/873aba2e5d
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Diffstat (limited to 'include/ruby/internal/variable.h')
0 files changed, 0 insertions, 0 deletions
