all repos — min @ 97fc6538cc82f989e01ceb3325adf3b811ef0176

A small but practical concatenative programming language.

Fixed compilation of required files
h3rald h3rald@h3rald.com
Thu, 31 Dec 2020 04:47:29 +0100
commit

97fc6538cc82f989e01ceb3325adf3b811ef0176

parent

be41a0a1e98567bab110438cc78f025aff823791

6 files changed, 19 insertions(+), 24 deletions(-)

jump to
M lib/min_lang.nimlib/min_lang.nim

@@ -13,13 +13,13 @@ import

os, json, logging, + ../core/baseutils, ../packages/niftylogger, ../packages/nimline/nimline, ../packages/nim-sgregex/sgregex import ../core/env, ../core/meta, - ../core/baseutils, ../core/parser, ../core/value, ../core/interpreter,

@@ -88,20 +88,12 @@ var file = s.getString

if not file.endsWith(".min"): file = file & ".min" info("[load] File: ", file) - if MINCOMPILED: - var normalizedFile = strutils.replace(strutils.replace(file, "\\", "/"), "./", "") - var compiledFile = normalizedFile - var normalizedCurrFile = strutils.replace(strutils.replace(i.filename, "\\", "/"), "./", "") - var parts = normalizedCurrFile.split("/") - if parts.len > 1: - discard parts.pop - compiledFile = parts.join("/") & "/" & normalizedFile - if COMPILEDMINFILES.hasKey(compiledFile): - COMPILEDMINFILES[compiledFile](i) - return - var f = i.pwd.joinPath(file) - if not f.fileExists: - raiseInvalid("File '$1' does not exist." % file) + let f = simplifyPath(i.filename, file) + if MINCOMPILED and COMPILEDMINFILES.hasKey(f): + COMPILEDMINFILES[f](i2) + else: + if not f.fileExists: + raiseInvalid("File '$1' does not exist." % file) i.load f def.symbol("require") do (i: In):

@@ -112,8 +104,7 @@ if not file.endsWith(".min"):

file = file & ".min" info("[require] File: ", file) let f = simplifyPath(i.filename, file) - if MINCOMPILED: - if COMPILEDMINFILES.hasKey(f): + if MINCOMPILED and COMPILEDMINFILES.hasKey(f): var i2 = i.copy(f) i2.withScope(): COMPILEDMINFILES[f](i2)
M min.nimmin.nim

@@ -83,7 +83,7 @@ getFiles(dir)

res.sort(system.cmp) return res - proc getCompletions(ed: LineEditor, symbols: seq[string]): seq[string] = + proc getCompletions*(ed: LineEditor, symbols: seq[string]): seq[string] = var words = ed.lineText.split(" ") var word: string if words.len == 0:

@@ -295,8 +295,6 @@ var iOpt = "\n -i, --interactive Start $1 shell (with advanced prompt)\n"

when defined(lite): exeName = "litemin" when defined(mini): - installOpt = "" - uninstallOpt = "" iOpt = "" exeName = "minimin"
M min.nimsmin.nims

@@ -12,8 +12,13 @@ switch("amd64.linux.gcc.linkerexe", "x86_64-linux-musl-gcc")

switch("opt", "size") +when not defined(dev): + switch("define", "release") + +when not defined(nossl): + switch("define", "ssl") + when defined(ssl) and not defined(mini): - switch("define", "ssl") switch("threads", "on") when defined(windows): # TODO", change once issue nim#15220 is resolved
M next-release.mdnext-release.md

@@ -5,3 +5,4 @@ * Fixed behavior of **require** and **invoke** ensuring that operators are evaluated in the correct scopes.

* Improved diagnostics of exceptions occurring in native code. * Fixed unwanted stack pollution in **to-yaml** operator. * Added check to prevent required modules from polluting the stack. +- Added **nossl** flag to compile without openssl (otherwise enabled by default).
M run.minrun.min

@@ -20,7 +20,7 @@ taskspec 0 get :task

"default" :subtask (taskspec size 1 >) (taskspec 1 get @subtask) when -"./tasks/$#.min" (task) =% :task-file +"tasks/$#.min" (task) =% :task-file ; Load task module task-file load
M site/contents/get-started.mdsite/contents/get-started.md

@@ -38,7 +38,7 @@ 7. Run **nim c -d:release min.nim**.

### Additional build options -#### -d:ssl +#### -d:ssl (enabled by default) If the **-d:ssl** flag is specified when compiling, min will be built with SSL support, so it will be possible to: * perform HTTPS requests with the {#link-module||http#}.

@@ -47,7 +47,7 @@

> %note% > Note > -> By default, this flag is enabled when compiling the executable files included with official releases. +> By default, this flag is enabled in the [min.nims](class:file). use **-d:nossl** to disable it. #### -d:lite