mirror of
https://github.com/janet-lang/janet
synced 2025-11-01 08:03:02 +00:00
Update version schema - now have version number
and build number.
This commit is contained in:
@@ -779,6 +779,8 @@ JanetTable *janet_core_env(void) {
|
||||
/* Platform detection */
|
||||
janet_def(env, "janet/version", janet_cstringv(JANET_VERSION),
|
||||
"The version number of the running janet program.");
|
||||
janet_def(env, "janet/build", janet_cstringv(JANET_BUILD),
|
||||
"The build identifier of the running janet program.");
|
||||
|
||||
/* Set as gc root */
|
||||
janet_gcroot(janet_wrap_table(env));
|
||||
|
||||
@@ -29,8 +29,10 @@ extern "C" {
|
||||
|
||||
/***** START SECTION CONFIG *****/
|
||||
|
||||
#ifndef JANET_VERSION
|
||||
#define JANET_VERSION "0.0.0 alpha"
|
||||
#define JANET_VERSION "0.0.0"
|
||||
|
||||
#ifndef JANET_BUILD
|
||||
#define JANET_BUILD "local"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
-- Stop handling options`)
|
||||
(os/exit 0)
|
||||
1)
|
||||
"v" (fn [&] (print janet/version) (os/exit 0) 1)
|
||||
"v" (fn [&] (print janet/version "-" janet/build) (os/exit 0) 1)
|
||||
"s" (fn [&] (:= *raw-stdin* true) (:= *should-repl* true) 1)
|
||||
"r" (fn [&] (:= *should-repl* true) 1)
|
||||
"p" (fn [&] (:= *exit-on-error* false) 1)
|
||||
@@ -53,7 +53,7 @@
|
||||
(if *raw-stdin*
|
||||
(repl nil identity)
|
||||
(do
|
||||
(print (string "Janet " janet/version " Copyright (C) 2017-2018 Calvin Rose"))
|
||||
(print (string "Janet " janet/version "-" janet/build " Copyright (C) 2017-2018 Calvin Rose"))
|
||||
(repl (fn [buf p]
|
||||
(def [line] (parser/where p))
|
||||
(def prompt (string "janet:" line ":" (parser/state p) "> "))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright 2017-2018 (C) Calvin Rose
|
||||
(print (string "Janet " janet/version " Copyright (C) 2017-2018 Calvin Rose"))
|
||||
(print (string "Janet " janet/version "-" janet/build " Copyright (C) 2017-2018 Calvin Rose"))
|
||||
|
||||
(fiber/new (fn webrepl []
|
||||
(repl (fn get-line [buf p]
|
||||
|
||||
Reference in New Issue
Block a user