From 35086e62db9462167f1e6f810ae8f5b0a1c112d1 Mon Sep 17 00:00:00 2001 From: otya128 Date: Wed, 3 Jun 2015 19:56:34 +0900 Subject: [PATCH] =?UTF-8?q?=E5=8D=98=E4=BD=93=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SMILEBASIC/SMILEBASIC.visualdproj | 15 ++++++--------- SMILEBASIC/main.d | 1 + SMILEBASIC/parser.d | 18 ++++++++++++++++-- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/SMILEBASIC/SMILEBASIC.visualdproj b/SMILEBASIC/SMILEBASIC.visualdproj index 177f927..a8d9522 100644 --- a/SMILEBASIC/SMILEBASIC.visualdproj +++ b/SMILEBASIC/SMILEBASIC.visualdproj @@ -33,7 +33,7 @@ 0 0 0 - 0 + 1 0 0 0 @@ -44,7 +44,7 @@ 0 0 0 - 2.043 + 2 0 0 0 @@ -205,13 +205,10 @@ *.obj;*.cmd;*.build;*.json;*.dep - - - - - - - + + + + diff --git a/SMILEBASIC/main.d b/SMILEBASIC/main.d index 5c41e9f..a3a7d60 100644 --- a/SMILEBASIC/main.d +++ b/SMILEBASIC/main.d @@ -2,5 +2,6 @@ import std.stdio; int main(string[] argv) { writeln("Hello D-World!"); + readln(); return 0; } diff --git a/SMILEBASIC/parser.d b/SMILEBASIC/parser.d index 0cfbc60..426040c 100644 --- a/SMILEBASIC/parser.d +++ b/SMILEBASIC/parser.d @@ -51,8 +51,22 @@ class Lexical } unittest { - auto lex = new Lexical("1"); - + { + auto lex = new Lexical("1"); + assert(lex.empty() == false); + lex.popFront(); + auto token = lex.front(); + assert(token.type == TokenType.Integer); + assert(token.value.integerValue == 1); + } + { + auto lex = new Lexical("12345"); + assert(lex.empty() == false); + lex.popFront(); + auto token = lex.front(); + assert(token.type == TokenType.Integer); + assert(token.value.integerValue == 12345); + } } class Parser {