Fixed bug with string interpolation
This commit is contained in:
+3
-5
@@ -2006,11 +2006,9 @@ class Parser {
|
||||
if(valid) {
|
||||
if(interpString == null)
|
||||
interpString = [];
|
||||
if(interpString.length > 0) { // store the current string
|
||||
if(b.length > 0)
|
||||
interpString.push(getTokenList(TConst(CString(b.toString()))));
|
||||
b = new StringBuf();
|
||||
}
|
||||
if(b.length > 0) // store the current string
|
||||
interpString.push(getTokenList(TConst(CString(b.toString()))));
|
||||
b = new StringBuf();
|
||||
interpolation = true;
|
||||
} else {
|
||||
b.addChar(c);
|
||||
|
||||
@@ -15,6 +15,10 @@ class Util {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((a is String) && (b is String)) {
|
||||
return a == b;
|
||||
}
|
||||
|
||||
if ((a is Array) && (b is Array)) {
|
||||
var aArray:Array<Dynamic> = cast a;
|
||||
var bArray:Array<Dynamic> = cast b;
|
||||
|
||||
@@ -150,6 +150,9 @@ class StringCase extends TestCase {
|
||||
assertEq("'$a+5 Hello ${a+5}'", '$a+5 Hello ${a+5}');
|
||||
//assertEq("'$a+5 Hello ${a+5}'", "" + a + "+5 Hello " + a + 5);
|
||||
headerCode = '';
|
||||
|
||||
assertEq("'hello ${5} world'", 'hello ${5} world');
|
||||
assertEq("'hello ${5}'", 'hello ${5}');
|
||||
}
|
||||
|
||||
override function teardown() {
|
||||
|
||||
Reference in New Issue
Block a user