compiler,runtime: implement string to []rune conversion

Commit message by aykevl
This commit is contained in:
scriptonist
2019-06-11 21:56:28 +05:30
committed by Ayke van Laethem
parent fa5855bff5
commit e9f6e51fc8
4 changed files with 35 additions and 1 deletions
+3 -1
View File
@@ -2458,8 +2458,10 @@ func (c *Compiler) parseConvert(typeFrom, typeTo types.Type, value llvm.Value, p
switch elemType.Kind() {
case types.Byte:
return c.createRuntimeCall("stringToBytes", []llvm.Value{value}, ""), nil
case types.Rune:
return c.createRuntimeCall("stringToRunes", []llvm.Value{value}, ""), nil
default:
return llvm.Value{}, c.makeError(pos, "todo: convert from string: "+elemType.String())
panic("unexpected type in string to slice conversion")
}
default: