From 9b36cd29611384830a57254797178e05add2180f Mon Sep 17 00:00:00 2001 From: otya128 Date: Thu, 4 Jun 2015 23:03:37 +0900 Subject: [PATCH] =?UTF-8?q?PRINT=E3=81=AE=E6=A7=8B=E6=96=87=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SMILEBASIC/VM.d | 3 ++- SMILEBASIC/parser.d | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/SMILEBASIC/VM.d b/SMILEBASIC/VM.d index 18b44fa..e05e6d8 100644 --- a/SMILEBASIC/VM.d +++ b/SMILEBASIC/VM.d @@ -2,6 +2,7 @@ module otya.smilebasic.vm; import otya.smilebasic.type; import otya.smilebasic.token; import std.uni; +import std.utf; import std.conv; import std.stdio; class VM @@ -64,7 +65,7 @@ class PrintCode : Code write(arg.integerValue); break; case ValueType.String: - write(cast(string)arg.stringValue); + write(arg.stringValue.to!string); break; default: //type missmatch diff --git a/SMILEBASIC/parser.d b/SMILEBASIC/parser.d index a315c6e..ccdc913 100644 --- a/SMILEBASIC/parser.d +++ b/SMILEBASIC/parser.d @@ -314,7 +314,11 @@ class Parser } print.addArgument(exp); token = lex.front(); - if(lex.empty()) break; + if(lex.empty()) + { + print.addLine(); + break; + } if(token.type != TokenType.Colon && token.type != TokenType.NewLine && token.type != TokenType.Semicolon && token.type != TokenType.Comma) { syntaxError();