Skip to content

Commit

Permalink
Fix stack error in string escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
evanphx committed Sep 8, 2011
1 parent 8adf9b4 commit 7e76e2f
Show file tree
Hide file tree
Showing 2 changed files with 189 additions and 263 deletions.
10 changes: 2 additions & 8 deletions lib/kpeg/string_escape.kpeg
Expand Up @@ -12,15 +12,9 @@ segment = < /[\w ]+/ > { text } # Don't use \s because that matchs \n
| "\"" { "\\\"" }
| < . > { text }

segments = segment:s segments:r { "#{s}#{r}" }
| segment

root = segments:s { @text = s }
root = segment*:s { @text = s.join }

embed_seg = "#" { "\\#" }
| segment

embed_segs = embed_seg:s embed_segs:r { "#{s}#{r}" }
| embed_seg

embed = embed_segs:s { @text = s }
embed = embed_seg*:s { @text = s.join }

0 comments on commit 7e76e2f

Please sign in to comment.