diff roundup/token_r.py @ 7859:9a74dfeb8620

feat: can use escaped tokens inside quotes including quotes. Change tokenizer to support: cmd with arg "string with embedded \" double quote" works for single quotes too. Mixed quotes can skip the \" or \' escaping. Also: quoted cmds args "can include \n newline, \t tab and \r return" Added a doc example, also tests for new feature.
author John Rouillard <rouilj@ieee.org>
date Sat, 06 Apr 2024 20:37:45 -0400
parents 07ce4e4110f5
children
line wrap: on
line diff
--- a/roundup/token_r.py	Wed Apr 03 16:53:13 2024 -0400
+++ b/roundup/token_r.py	Sat Apr 06 20:37:45 2024 -0400
@@ -96,6 +96,12 @@
                 oldstate = state
                 state = ESCAPE
                 continue
+        elif state == QUOTE and c == '\\':
+            # in a quoted token and found an escape sequence
+            pos = pos + 1
+            oldstate = state
+            state = ESCAPE
+            continue
         elif state == QUOTE and c == quotechar:
             # in a quoted token and found a matching quote char
             pos = pos + 1

Roundup Issue Tracker: http://roundup-tracker.org/