Skip to content

Commit

Permalink
Versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
SingularityT3 committed Dec 3, 2023
1 parent 89fde8a commit 68d43d2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ cmake_minimum_required(VERSION 3.16)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)

project(PseudoEngine2 VERSION 0.5.1)
project(PseudoEngine2 VERSION 1.0.0)

configure_file(PsConfig.h.in PsConfig.h)
add_executable(PseudoEngine2)

target_include_directories(PseudoEngine2 PRIVATE src)
target_include_directories(PseudoEngine2 PRIVATE "${PROJECT_BINARY_DIR}")

if(MSVC)
string(REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
Expand Down
5 changes: 5 additions & 0 deletions PsConfig.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#define PseudoEngine2_VERSION_MAJOR @PseudoEngine2_VERSION_MAJOR@
#define PseudoEngine2_VERSION_MINOR @PseudoEngine2_VERSION_MINOR@
#define PseudoEngine2_VERSION_PATCH @PseudoEngine2_VERSION_PATCH@
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The REPL stands for Read Execute Print Loop and is an interface where pseudocode
```
./PseudoEngine2 [filename]
```
NOTE: `PseudoEngine2` would be replaced by the name of the executable which may be something like `Pseudoengine2-v0.5.exe` if it is downloaded from the releases
NOTE: `PseudoEngine2` would be replaced by the name of the executable which may be something like `Pseudoengine2-v0.5.exe` if it is downloaded from the [releases](https://github.com/SingularityT3/PseudoEngine2/releases)

Filename is an optional arguement. If it is provided the program in the corresponding file is run otherwise the REPL is launched.

Expand Down
4 changes: 2 additions & 2 deletions src/launch/repl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <string>
#include "launch/run.h"

#include "PsConfig.h"
#include "line_util.h"

extern std::string psfilename;
Expand All @@ -20,7 +20,7 @@ static const std::string multilineKeywords[] = {
};

bool startREPL() {
std::cout << "PseudoEngine2 v0.5.1 REPL\nEnter 'EXIT' to quit\n";
std::cout << "PseudoEngine2 v" << PseudoEngine2_VERSION_MAJOR << '.' << PseudoEngine2_VERSION_MINOR << '.' << PseudoEngine2_VERSION_PATCH << " REPL\nEnter 'EXIT' to quit\n";

Lexer lexer;
Parser parser;
Expand Down
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <stdlib.h>

#include "launch/run.h"
#include "PsConfig.h"

#include "line_util.h"
#ifdef READLINE
Expand All @@ -23,7 +24,7 @@ int main(int argc, char **argv) {
std::cout << "Usage: " << argv[0] << " [options] [filename]\n\nOptions:\n -h\t--help\n -v\t--version\n -p\t--pedantic\tForce variable declarations and disallow `CONTINUE`, `BREAK`, `ELSE IF` and type casting" << std::endl;
return EXIT_SUCCESS;
} else if (strcmp(argv[1], "-v") == 0 || strcmp(argv[1], "--version") == 0) {
std::cout << "PseudoEngine2 v0.5.1" << std::endl;
std::cout << "PseudoEngine2 v" << PseudoEngine2_VERSION_MAJOR << '.' << PseudoEngine2_VERSION_MINOR << '.' << PseudoEngine2_VERSION_PATCH << std::endl;
return EXIT_SUCCESS;
} else if (strcmp(argv[1], "-p") == 0 || strcmp(argv[1], "--pedantic") == 0) {
pedantic = true;
Expand Down

0 comments on commit 68d43d2

Please sign in to comment.