Add hex escape sequences (\xNN) to string literals #279
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
rust
technical-debt
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/patch-seq#279
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Seq string literals only support a limited set of escape sequences:
\" \\ \n \r \tThis makes it awkward to write terminal control codes (ANSI escapes) which require the ESC character (0x1B):
Proposal
Add
\xNNhex escape sequences to string literals:Use Cases
Implementation
In the lexer, when parsing string literals and encountering
\x:Optional: Unicode Escapes
Could also add
\u{NNNN}for Unicode code points:But hex escapes alone would unblock terminal work.
Related
This came up while implementing vim-style line editing for seq-lisp (#52). The terminal FFI (patch-seq#274) enables raw terminal access, but writing escape codes is cumbersome without
\xsupport.https://github.com/navicore/patch-seq/pull/280