erl_scan:string ignores /' and /"
Roger Price
rprice@REDACTED
Sun Aug 17 00:55:22 CEST 2003
"Concurrent Programming in Erlang", chapter 2.1.2 says "Within a quoted
atom the following conventions apply"... Chapter 2.1.4 says "Within a
string the quoting conventions used within an atom also apply." However
erl_scan:string/1 seems to ignore \' and \". Here are the results for all
the conventions:
15> erl_scan:string("\b") .
{ok,[],1}
16> erl_scan:string("\d") .
{ok,[{'\d',1}],1}
17> erl_scan:string("\e") .
{ok,[],1}
18> erl_scan:string("\f") .
{ok,[],1}
19> erl_scan:string("\n") .
{ok,[],2}
20> erl_scan:string("\r") .
{ok,[],1}
21> erl_scan:string("\t") .
{ok,[],1}
22> erl_scan:string("\v") .
{ok,[],1}
23> erl_scan:string("\\") .
{ok,[{'\\',1}],1}
24> erl_scan:string("\^A") .
{ok,[],1}
25> erl_scan:string("\'") .
{error,{1,erl_scan,{string,39,[]}},1}
26> erl_scan:string("\"") .
{error,{1,erl_scan,{string,34,[]}},1}
27> erl_scan:string("\266") .
{ok,[{'¶',1}],1}
28> erl_scan:string("\266\
28> \266") .
{ok,[{'¶',1},{'¶',2}],2}
Roger
More information about the erlang-questions
mailing list