Software /
code /
prosody
Comparison
tools/erlparse.lua @ 5079:2ab99e239d45
tools/erlparse: Fix erlang string escape sequences.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sat, 04 Aug 2012 23:23:49 +0500 |
parent | 2947:ff7f6668b34f |
child | 5080:52767b1f057b |
comparison
equal
deleted
inserted
replaced
5078:cba0b426b542 | 5079:2ab99e239d45 |
---|---|
49 local function isSpace(ch) | 49 local function isSpace(ch) |
50 ch = string_byte(ch) or "x"; | 50 ch = string_byte(ch) or "x"; |
51 return ch <= _space; | 51 return ch <= _space; |
52 end | 52 end |
53 | 53 |
54 local escapes = {["\\b"]="\b", ["\\d"]="\d", ["\\e"]="\e", ["\\f"]="\f", ["\\n"]="\n", ["\\r"]="\r", ["\\s"]="\s", ["\\t"]="\t", ["\\v"]="\v", ["\\\""]="\"", ["\\'"]="'", ["\\\\"]="\\"}; | 54 local escapes = {["\\b"]="\b", ["\\d"]="\127", ["\\e"]="\27", ["\\f"]="\f", ["\\n"]="\n", ["\\r"]="\r", ["\\s"]=" ", ["\\t"]="\t", ["\\v"]="\v", ["\\\""]="\"", ["\\'"]="'", ["\\\\"]="\\"}; |
55 local function readString() | 55 local function readString() |
56 read("\""); -- skip quote | 56 read("\""); -- skip quote |
57 local slash = nil; | 57 local slash = nil; |
58 local str = {}; | 58 local str = {}; |
59 while true do | 59 while true do |