Skip to content

Commit

Permalink
adds version constant
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbekarlsson committed Jan 6, 2023
1 parent b316180 commit 65bf9ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions include/glms/version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef GLMS_VERSION_H
#define GLMS_VERSION_H

#define GLMS_VERSION_MAJOR 0
#define GLMS_VERSION_MINOR 0
#define GLMS_VERSION_PATCH 1

#define GLMS_VERSION_STRING "0.0.1"

#endif
6 changes: 5 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <glms/glms.h>
#include <glms/io.h>
#include <glms/macros.h>
#include <glms/version.h>
#include <hashy/hashy.h>
#include <stdio.h>
#include <string.h>
Expand Down Expand Up @@ -56,7 +57,7 @@ static int glms_interactive() {
fgets(input_source, 1024, stdin);
fflush(stdin);

GLMSAST *result = glms_env_exec_source(&env, input_source);
glms_env_exec_source(&env, input_source);
glms_env_reset(&env);
}

Expand All @@ -78,6 +79,9 @@ int main(int argc, char *argv[]) {
glms_env_clear(&env);
cli_args_destroy(&cli);
return 0;
} else if (cli_args_has(&cli, "--version")) {
printf("GLMS Version %s\n", GLMS_VERSION_STRING);
return 0;
}

char *source = glms_get_file_contents(argv[1]);
Expand Down

0 comments on commit 65bf9ad

Please sign in to comment.