Skip to content

Commit

Permalink
When constructing lists, \{ are special only when counting braces,
Browse files Browse the repository at this point in the history
but are still passed through literally.
  • Loading branch information
coke committed Apr 13, 2010
1 parent 6fba342 commit 294435d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Partcl/Actions.pm
Expand Up @@ -79,8 +79,8 @@ method word:sym<bare>($/) { make concat_atoms($<bare_atom>); }
method braced_word($/) { make concat_atoms($<braced_atom>); }
method braced_atom:sym<{ }>($/) { make '{' ~ $<braced_word>.ast ~ '}'; }
method braced_atom:sym<backnl>($/) { make ' '; }
method braced_atom:sym<back{>($/) { make '{'; }
method braced_atom:sym<back}>($/) { make '}'; }
method braced_atom:sym<back{>($/) { make "\\" ~ '{'; }
method braced_atom:sym<back}>($/) { make "\\" ~ '}'; }
method braced_atom:sym<back>($/) { make "\\"; }
method braced_atom:sym<chr>($/) { make ~$/; }
Expand Down
6 changes: 3 additions & 3 deletions t/cmd_list.t
Expand Up @@ -12,8 +12,8 @@ is [list a b {c {d e}}] {a b {c {d e}}} {spaces with braces}
is [list a b "c {d e}"] {a b {c {d e}}} {spaces with quotes}
is [list {1 2} {3 4}] {{1 2} {3 4}} {spaces in two elements}

is [list "} {"] {\}\ \{} {braces with spaces} {TODO NQPRX}
is [list \{ \}] {\{ \}} {braces} {TODO NQPRX}
is [list "} {"] {\}\ \{} {braces with spaces}
is [list \{ \}] {\{ \}} {braces}

is [list "\n"] "{\n}" {newline}
is [list ";"] {{;}} {semicolon}
Expand All @@ -36,6 +36,6 @@ is [list {"}] {{"}} {single quote}
is [list "{ab}xy"] "{{ab}xy}" {braces that don't wrap exactly}
is [list "{ab}\\"] "\\{ab\\}\\\\" {braces that don't wrap exactly, trailing backslash}
is [list \{\r] "\\\{\\r" {use standard \foo escapes when stringifying a list}
is [list \{"] {\{\"} {escape quotes} {TODO NQP}
is [list \{"] {\{\"} {escape quotes}
# vim: filetype=tcl:
2 changes: 1 addition & 1 deletion t/tcl_conversion.t
Expand Up @@ -36,7 +36,7 @@ eval_is {lindex {"a b"3} 1} \
{non space after "} {TODO NQPRX}
is [list \{\[] {\{\[} {[ in list} {TODO NQPRX}
is [list \{\[] {\{\[} {[ in list}
is [lindex {"a \" b"} 0] {a " b} {escaped quote in quotes in list} {TODO NQPRX}

Expand Down

0 comments on commit 294435d

Please sign in to comment.