From 48c057338b3822f40b80e4851f70e92f5d77934f Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 28 Jan 2021 01:15:27 -0500 Subject: Escape null character in cjs.bqn --- src/cjs.bqn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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 \ -- cgit v1.2.3