Ticket #42: stringTermin1.patch
File stringTermin1.patch, 1.7 KB (added by hopscc, 16 years ago) |
---|
-
Source/CobraTokenizer.cobra
767 767 branch c 768 768 # TODO: any other codes? 769 769 on c'n', next = c'\n' 770 # chars.append(Environment.newLine) # alternative \n-> Env.nl 770 771 on c'r', next = c'\r' 771 772 on c't', next = c'\t' 772 773 on c'0', next = c'\0' 774 on c'N' # platfrom indep line termin 775 chars.append(Environment.newLine) 776 # next = c'\n' # alternative \N-> nl 773 777 on c'\\' 774 778 chars.append(c'\\') 775 779 # cannot have `last` being a backslash anymore--it's considered consumed now -
Tests/100-basics/068-string-termin.cobra
1 # Test for platform independent line terminator in strings 2 class Test 3 def main is shared 4 assert "\N" == Environment.newLine 5 assert '\N' == Environment.newLine 6 s = "\\N" 7 assert not s == Environment.newLine 8 assert s.length == 2 9 assert s == r'\N' 10 assert not r'\N' == Environment.newLine -
Developer/IntermediateReleaseNotes.text
1 1 Post 0.8 2 * Add \N metacharacter in strings for platform line terminator 2 3 3 4 * Added support for "extended initializers" which allow you to set properties of the object in the same call being used to create the object: 4 5 .code