aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-28 01:15:27 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-28 01:17:19 -0500
commit48c057338b3822f40b80e4851f70e92f5d77934f (patch)
treefe48531f7c1972a9a3af1bdd484115c4c07ba514 /src
parent22daab1f5eae23dd03fcfa84375de9193063ad47 (diff)
Escape null character in cjs.bqn
Diffstat (limited to 'src')
-rwxr-xr-xsrc/cjs.bqn4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cjs.bqn b/src/cjs.bqn
index b2cf597f..afa9adc7 100755
--- a/src/cjs.bqn
+++ b/src/cjs.bqn
@@ -6,8 +6,8 @@ Ind ← {∾𝕨‿"["‿𝕩‿"]"} # Native list/array indexing
Cat ← {∾𝕨‿".concat("‿𝕩‿")"} # Native list/array concatenation (like ∾)
# Escape the special characters that appear in BQN sources.
Esc←{
- in ← (@+9‿10‿13)∾"'""" # Tab, LF, CR, and quotes
- out ← "tnr" # Whitespace characters changed to letters
+ in ← (@+0‿9‿10‿13)∾"'""" # Null, Tab, LF, CR, and quotes
+ out ← "0tnr" # Whitespace characters changed to letters
i ← in⊐𝕩
𝕩 ↩ i ⊏⟜out⌾((i<≠out)⊸/) 𝕩 # Replace
∾(i<≠in) /⟜"\"⊸∾¨ 𝕩 # Insert \