all repos — min @ 5df252734c7765e081e5e398de59a36e1d999b81

A small but practical concatenative programming language.

Enhanced site highlighting.
h3rald h3rald@h3rald.com
Sun, 27 Oct 2024 10:53:28 +0100
commit

5df252734c7765e081e5e398de59a36e1d999b81

parent

5b0eeabc18338aa0260756452855b7b9733a5c5a

M minpkg/core/shell.nimminpkg/core/shell.nim

@@ -117,10 +117,10 @@ if pS.len == 0:

p(s, fgCyan) else: for part in pS.items: - if part["subtype"].getStr == "tkDict": + if part["type"].getStr == "tkDict": p(part["value"].getStr, fgBlue) elif ["tkDot", "tkAutopop", "tkSystemSigil"].contains part[ - "subtype"].getStr: + "type"].getStr: p(part["value"].getStr, fgRed) else: p(part["value"].getStr, fgCyan)
M minpkg/core/utils.nimminpkg/core/utils.nim

@@ -415,7 +415,7 @@ var sym = v

if SYSTEM_SIGILS.contains(v[0]): sym = v[1..^1] var sigil = newJObject() - sigil["subtype"] = %"tkSystemSigil" + sigil["type"] = %"tkSystemSigil" sigil["value"] = %($v[0]) result.add sigil var syms = sym.split('.')

@@ -423,15 +423,15 @@ var count = 0

for s in syms: sym = s var symbol = newJObject() - var subtype = "tkDict" + var typ = "tkDict" if syms.len == 1 or count >= syms.len-1: - subtype = "tkSymbol" - symbol["subtype"] = %subtype + typ = "tkSymbol" + symbol["type"] = %typ symbol["value"] = %sym result.add symbol if count < syms.len-1: var dot = newJObject() - dot["subtype"] = %"tkDot" + dot["type"] = %"tkDot" dot["value"] = %"." result.add dot count += 1

@@ -440,6 +440,6 @@ # Shorten previous symbol

let lastVal = result[^1]["value"].getStr result[^1]["value"] = %lastVal[0..^2] var autopop = newJObject() - autopop["subtype"] = %"tkAutopop" + autopop["type"] = %"tkAutopop" autopop["value"] = %"!" result.add autopop
M minpkg/lib/min_global.nimminpkg/lib/min_global.nim

@@ -1192,9 +1192,9 @@ var dict = newDict(i.scope)

i.dset(dict, "type", newVal($t)) i.dset(dict, "value", p.a.processTokenValue(t).newVal) if t == tkSymbol: - let processedSymbol = processSymbolValue(p.a) - if processedSymbol.len > 0: - i.dset(dict, "processedSymbol", i.fromJson processedSymbol) + let parsedValue = processSymbolValue(p.a) + if parsedValue.len > 0: + i.dset(dict, "parsedValue", i.fromJson parsedValue) q.add dict while t != tkEof: t = p.getToken()

@@ -1202,9 +1202,9 @@ var dict = newDict(i.scope)

i.dset(dict, "type", newVal($t)) i.dset(dict, "value", p.a.processTokenValue(t).newVal) if t == tkSymbol: - let processedSymbol = processSymbolValue(p.a) - if processedSymbol.len > 0: - i.dset(dict, "processedSymbol", i.fromJson processedSymbol) + let parsedValue = processSymbolValue(p.a) + if parsedValue.len > 0: + i.dset(dict, "parsedValue", i.fromJson parsedValue) q.add dict i.push q.newVal
M site/assets/styles/min-lang.csssite/assets/styles/min-lang.css

@@ -371,6 +371,18 @@ .min-tkSqBracketLe {

color: #cf111b; } +.min-tkSystemSigil { + color: #fe7db1; +} + +.min-tkAutopop { + color: #fb820a; +} + +.min-tkDot { + color: #a97bff +} + .min-tkInt, .min-tkFloat { color: #f381f7;

@@ -384,8 +396,12 @@ .min-tkCommand {

color: #c7830e; } +.min-tkDict { + color: #8b99fc; +} + .min-tkSymbol { - color: #f5fcfd; + color: #7ddbfe; } .min-tkNull,