PRINTの構文解析を修正
This commit is contained in:
@@ -2,6 +2,7 @@ module otya.smilebasic.vm;
|
|||||||
import otya.smilebasic.type;
|
import otya.smilebasic.type;
|
||||||
import otya.smilebasic.token;
|
import otya.smilebasic.token;
|
||||||
import std.uni;
|
import std.uni;
|
||||||
|
import std.utf;
|
||||||
import std.conv;
|
import std.conv;
|
||||||
import std.stdio;
|
import std.stdio;
|
||||||
class VM
|
class VM
|
||||||
@@ -64,7 +65,7 @@ class PrintCode : Code
|
|||||||
write(arg.integerValue);
|
write(arg.integerValue);
|
||||||
break;
|
break;
|
||||||
case ValueType.String:
|
case ValueType.String:
|
||||||
write(cast(string)arg.stringValue);
|
write(arg.stringValue.to!string);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//type missmatch
|
//type missmatch
|
||||||
|
|||||||
@@ -314,7 +314,11 @@ class Parser
|
|||||||
}
|
}
|
||||||
print.addArgument(exp);
|
print.addArgument(exp);
|
||||||
token = lex.front();
|
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)
|
if(token.type != TokenType.Colon && token.type != TokenType.NewLine && token.type != TokenType.Semicolon && token.type != TokenType.Comma)
|
||||||
{
|
{
|
||||||
syntaxError();
|
syntaxError();
|
||||||
|
|||||||
Reference in New Issue
Block a user