datalog.lua
datalog.lua copied to clipboard
parser: support extra escape characters in strings
Other escape characters can be used to improve the readability of the input. If a string is too long to fit conveniently on one line, all but the final line containing the string can be ended with a backslash character, and each backslash newline pair is ignored. The character escape codes from the C programming language are allowed—‘\a’, ‘\b’, ‘\f’, ‘\n’, ‘\r’, ‘\t’, ‘\v’, ‘'’, and ‘?’. The numeric escape codes consist of one, two, or three octal digits. Thus the ASCII character newline is ‘\012’, and zero is ‘\000’. A printed Datalog string is also a string constant in C.