Browse Source

Move simple_dice/main.cxx to correct location

Sam Jaffe 7 năm trước cách đây
mục cha
commit
07c7c1696d

+ 12 - 6
dice-roll.xcodeproj/project.pbxproj

@@ -18,7 +18,7 @@
 		CD38F53921C922E2007A732C /* roll_test.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CD38F53821C922E2007A732C /* roll_test.cxx */; };
 		CD38F53B21C928B4007A732C /* exception_test.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CD38F53A21C928B4007A732C /* exception_test.cxx */; };
 		CD38F54F21C945C2007A732C /* terminal_helper.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CD38F54E21C945C2007A732C /* terminal_helper.cxx */; };
-		CDED6A2721B2F28A00AB91D0 /* simple_main.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CDED6A2621B2F28A00AB91D0 /* simple_main.cxx */; };
+		CDED6A2721B2F28A00AB91D0 /* main.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CDED6A2621B2F28A00AB91D0 /* main.cxx */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -99,7 +99,7 @@
 		CD8F1ABC21B31E9E00CBB3CA /* roll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = roll.h; sourceTree = "<group>"; };
 		CD8F1ABD21B31E9E00CBB3CA /* roll.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = roll.cxx; sourceTree = "<group>"; };
 		CDED6A2321B2F28A00AB91D0 /* simple_dice */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = simple_dice; sourceTree = BUILT_PRODUCTS_DIR; };
-		CDED6A2621B2F28A00AB91D0 /* simple_main.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = simple_main.cxx; sourceTree = "<group>"; };
+		CDED6A2621B2F28A00AB91D0 /* main.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cxx; sourceTree = "<group>"; };
 		CDED6A2F21B2F2DC00AB91D0 /* die.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = die.h; sourceTree = "<group>"; };
 		CDED6A3021B2F2DC00AB91D0 /* die.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = die.cxx; sourceTree = "<group>"; };
 		CDED6A5821B2F6E800AB91D0 /* random.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = random.h; sourceTree = "<group>"; };
@@ -163,6 +163,7 @@
 				CDED6A2D21B2F2B200AB91D0 /* test */,
 				CDED6A2521B2F28A00AB91D0 /* src */,
 				CD38F52721C87771007A732C /* dice-td */,
+				CD38F55E21C9485F007A732C /* simple_dice */,
 				CDED6A2421B2F28A00AB91D0 /* Products */,
 				CDED6A5F21B2F89900AB91D0 /* Frameworks */,
 			);
@@ -181,7 +182,6 @@
 		CDED6A2521B2F28A00AB91D0 /* src */ = {
 			isa = PBXGroup;
 			children = (
-				CDED6A2621B2F28A00AB91D0 /* simple_main.cxx */,
 				CD38F54D21C945C2007A732C /* terminal_helper.h */,
 				CD38F54E21C945C2007A732C /* terminal_helper.cxx */,
 				CDED6A3021B2F2DC00AB91D0 /* die.cxx */,
@@ -398,7 +398,7 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				CDED6A2721B2F28A00AB91D0 /* simple_main.cxx in Sources */,
+				CDED6A2721B2F28A00AB91D0 /* main.cxx in Sources */,
 				CD38F54F21C945C2007A732C /* terminal_helper.cxx in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -540,7 +540,10 @@
 				MTL_FAST_MATH = YES;
 				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = macosx;
-				USER_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/include/";
+				USER_HEADER_SEARCH_PATHS = (
+					"$(PROJECT_DIR)/include/",
+					"$(PROJECT_DIR)/src/",
+				);
 			};
 			name = Debug;
 		};
@@ -597,7 +600,10 @@
 				MTL_ENABLE_DEBUG_INFO = NO;
 				MTL_FAST_MATH = YES;
 				SDKROOT = macosx;
-				USER_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/include/";
+				USER_HEADER_SEARCH_PATHS = (
+					"$(PROJECT_DIR)/include/",
+					"$(PROJECT_DIR)/src/",
+				);
 			};
 			name = Release;
 		};

+ 0 - 3
src/simple_main.cxx

@@ -6,13 +6,10 @@
 //  Copyright © 2018 Sam Jaffe. All rights reserved.
 //
 
-#include "die.h"
 #include "exception.h"
-#include "roll.h"
 #include "terminal_helper.h"
 
 #include <iostream>
-#include <sstream>
 
 void eval(std::string const & str) {
   try {

+ 6 - 0
src/terminal_helper.cxx

@@ -8,6 +8,12 @@
 
 #include "terminal_helper.h"
 
+#include "die.h"
+#include "exception.h"
+#include "roll.h"
+
+#include <iostream>
+
 namespace terminal { namespace {
   void print(dice::dice_roll const & r) {
     std::cout << int(r) << " (" << r << ")\n";

+ 6 - 0
src/terminal_helper.h

@@ -8,6 +8,12 @@
 
 #pragma once
 
+#include <string>
+
+namespace dice {
+  class unexpected_token;
+}
+
 namespace terminal {
   /**
    * @param str {@see make_dice(std::string const &)}