From 8da91a4c5a6bacd0fd287030ca1805a70da9d196 Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Mon, 23 Jan 2017 14:18:31 +0300 Subject: [PATCH] aefaef --- .DS_Store | Bin 18436 -> 18436 bytes MineOS/MineOS.pkg | 270 +++++++++++++++++----------------------------- 2 files changed, 98 insertions(+), 172 deletions(-) diff --git a/.DS_Store b/.DS_Store index 94723fd2636bcce4fc4a6c744952c3e723f410b2..389b4a616fbec423728d83e196483857f0748bdd 100644 GIT binary patch delta 18 acmZpfz}PZ@al<^Z$!9D*H$NAXH3R@jAqQ>% delta 18 acmZpfz}PZ@al<^Z$xQ5?o1crx8Ug@8a|Ut% diff --git a/MineOS/MineOS.pkg b/MineOS/MineOS.pkg index 2832f328..d1c0ad14 100644 --- a/MineOS/MineOS.pkg +++ b/MineOS/MineOS.pkg @@ -6833,7 +6833,7 @@ return { -- hash256 = hash256, -- hash224 = hash224, -- new256 = new256, -}Flib/advancedLua.lua* +}Flib/advancedLua.lua* --[[ Advanced Lua Library v1.1 by ECS @@ -6951,15 +6951,15 @@ end -------------------------------------------------- Table extensions -------------------------------------------------- -local function doSerialize(array, text, prettyLook, indentationSymbol, oldIndentationSymbol, equalsSymbol, currentRecusrionStack, recursionStackLimit) - text = {"{"} +local function doSerialize(array, prettyLook, indentationSymbol, indentationSymbolAdder, equalsSymbol, currentRecusrionStack, recursionStackLimit) + local text, keyType, valueType, stringValue = {"{"} table.insert(text, (prettyLook and "\n" or nil)) for key, value in pairs(array) do - local keyType, valueType, stringValue = type(key), type(value), tostring(value) + keyType, valueType, stringValue = type(key), type(value), tostring(value) if keyType == "number" or keyType == "string" then - table.insert(text, (prettyLook and indentationSymbol or nil)) + table.insert(text, (prettyLook and table.concat({indentationSymbol, indentationSymbolAdder}) or nil)) table.insert(text, "[") table.insert(text, (keyType == "string" and table.concat({"\"", key, "\""}) or key)) table.insert(text, "]") @@ -6974,33 +6974,48 @@ local function doSerialize(array, text, prettyLook, indentationSymbol, oldIndent elseif valueType == "table" then -- Ограничение стека рекурсии if currentRecusrionStack < recursionStackLimit then - table.insert(text, table.concat(doSerialize(value, text, prettyLook, table.concat({indentationSymbol, indentationSymbol}), table.concat({oldIndentationSymbol, indentationSymbol}), equalsSymbol, currentRecusrionStack + 1, recursionStackLimit))) + table.insert(text, table.concat(doSerialize(value, prettyLook, table.concat({indentationSymbol, indentationSymbolAdder}), indentationSymbolAdder, equalsSymbol, currentRecusrionStack + 1, recursionStackLimit))) else table.insert(text, "...") end - else - -- error("Unsupported table value type: " .. valueType) end table.insert(text, ",") table.insert(text, (prettyLook and "\n" or nil)) - else - -- error("Unsupported table key type: " .. keyType) end end - table.remove(text, (prettyLook and #text - 1 or #text)) - table.insert(text, (prettyLook and oldIndentationSymbol or nil)) + -- Удаляем запятую + if prettyLook then + if #text > 2 then + table.remove(text, #text - 1) + end + -- Вставляем заодно уж символ индентации, благо чек на притти лук идет + table.insert(text, indentationSymbol) + else + if #text > 1 then + table.remove(text, #text) + end + end + table.insert(text, "}") + return text end function table.serialize(array, prettyLook, indentationWidth, indentUsingTabs, recursionStackLimit) checkArg(1, array, "table") - indentationWidth = indentationWidth or 2 - local indentationSymbol = indentUsingTabs and " " or " " - indentationSymbol, indentationSymbolHalf = string.rep(indentationSymbol, indentationWidth) - return table.concat(doSerialize(array, {}, prettyLook, indentationSymbol, "", prettyLook and " = " or "=", 1, recursionStackLimit or math.huge)) + return table.concat( + doSerialize( + array, + prettyLook, + "", + string.rep(indentUsingTabs and " " or " ", indentationWidth or 2), + prettyLook and " = " or "=", + 1, + recursionStackLimit or math.huge + ) + ) end function table.unserialize(serializedString) @@ -7009,13 +7024,8 @@ function table.unserialize(serializedString) if success then return result else return nil, result end end -function table.toString(...) - return table.serialize(...) -end - -function table.fromString(...) - return table.unserialize(...) -end +table.toString = table.serialize +table.fromString = table.unserialize function table.toFile(path, array, prettyLook, indentationWidth, indentUsingTabs, recursionStackLimit, appendToFile) checkArg(1, path, "string") @@ -7200,16 +7210,26 @@ end -------------------------------------------------- Playground -------------------------------------------------- --- local function safeCall(method, ...) --- local arguments = {...} --- return xpcall(function() return method(table.unpack(arguments)) end, debug.traceback) --- end +-- local t = { +-- abc = 123, +-- def = { +-- cyka = "pidor", +-- vagina = { +-- chlen = 555, +-- devil = 666, +-- god = 777, +-- serost = { +-- tripleTable = "aefaef", +-- aaa = "bbb", +-- ccc = 123, +-- } +-- } +-- }, +-- ghi = "HEHE", +-- emptyTable = {}, +-- } --- local function safeCallString(str) --- return safeCall(load(str)) --- end - --- print(safeCallString("return 123")) +-- print(table.toString(t, true)) ------------------------------------------------------------------------------------------------------------------ @@ -8560,7 +8580,7 @@ do end end -return colorsFlib/compressor.lua1 +return colorsFlib/compressor.luaP local unicode = require("unicode") local fs = require("filesystem") local compressor = {} @@ -8743,6 +8763,7 @@ function compressor.unpack(pathToCompressedFile, pathWhereToUnpack, showInfo) file:write(compressedFile:read(size)) file:close() else + compressedFile:read(size) info(showInfo, "Failed to open file for writing while unpacking: " .. tostring(reason)) end elseif not type then @@ -18329,7 +18350,7 @@ setmetatable(sides, metatable) ------------------------------------------------------------------------------- return sides -Flib/syntax.lua +Flib/syntax.lua require("advancedLua") local buffer = require("doubleBuffering") local unicode = require("unicode") @@ -18360,13 +18381,13 @@ syntax.colorScheme = { } syntax.patterns = { - --Комментарии + -- Комментарии { "%-%-.+", "comments", 0, 0 }, - --Строки + -- Строки { "\"[^\"]+\"", "strings", 0, 0 }, - --Циклы, условия, объявления + -- Циклы, условия и прочая поебень { "while ", "loops", 0, 1 }, { "do$", "loops", 0, 0 }, { "do ", "loops", 0, 1 }, @@ -18387,7 +18408,7 @@ syntax.patterns = { { " break$", "loops", 0, 0 }, { " break ", "loops", 0, 0 }, - --Состояния переменной + -- Истина, ложь, нулл { "true", "boolean", 0, 0 }, { "false", "boolean", 0, 0 }, { "nil", "boolean", 0, 0 }, @@ -18396,16 +18417,18 @@ syntax.patterns = { { "[%s%=%{%(][^%s%(%)%{%}%[%]]+%(", "functions", 1, 1 }, { "^[^%s%(%)%{%}%[%]]+%(", "functions", 0, 1 }, - --Логические выражения + -- Логические выражения { " and ", "logic", 0, 1 }, { " or ", "logic", 0, 1 }, { " not ", "logic", 0, 1 }, + + -- Конкатенация строк { "[^%d]%.+[^%d]", "logic", 1, 1 }, - --Сравнения и мат. операции + -- Сравнения и мат. операции { "[%>%<%=%~%+%-%*%/%^%#%%]", "compares", 0, 0 }, - --Числа + -- Числа { "0x%w+", "numbers", 0, 0 }, { "[^%a%d][%.%d]+$", "numbers", 1, 0 }, { "[^%a%d][%.%d]+[^%a%d]", "numbers", 1, 1 }, @@ -18413,7 +18436,7 @@ syntax.patterns = { ---------------------------------------------------------------------------------------------------------------------------------------- ---Нарисовать и подсветить строку +-- Отрисовка строки с подсвеченным синтаксисом function syntax.highlightString(x, y, str, indentationWidth) if y >= buffer.drawLimit.y and y <= buffer.drawLimit.y2 then local stringLength, symbols, colors, searchFrom, starting, ending, bufferIndex = unicode.len(str), {}, {} @@ -25296,105 +25319,7 @@ alias ..="cd .." alias df="df -h" alias grep="grep --color" -Detc/F etc/edit.cfgkeybinds={ - ["findnext"] = { - [1] = { - [1] = "control", - [2] = "g" - }, - [2] = { - [1] = "control", - [2] = "n" - }, - [3] = { - [1] = "f3" - } - }, - ["deleteLine"] = { - [1] = { - [1] = "control", - [2] = "delete" - }, - [2] = { - [1] = "shift", - [2] = "delete" - } - }, - ["home"] = { - [1] = { - [1] = "home" - } - }, - ["up"] = { - [1] = { - [1] = "up" - } - }, - ["pageDown"] = { - [1] = { - [1] = "pageDown" - } - }, - ["close"] = { - [1] = { - [1] = "control", - [2] = "w" - } - }, - ["right"] = { - [1] = { - [1] = "right" - } - }, - ["backspace"] = { - [1] = { - [1] = "back" - } - }, - ["newline"] = { - [1] = { - [1] = "enter" - } - }, - ["find"] = { - [1] = { - [1] = "control", - [2] = "f" - } - }, - ["pageUp"] = { - [1] = { - [1] = "pageUp" - } - }, - ["delete"] = { - [1] = { - [1] = "delete" - } - }, - ["left"] = { - [1] = { - [1] = "left" - } - }, - ["save"] = { - [1] = { - [1] = "control", - [2] = "s" - } - }, - ["eol"] = { - [1] = { - [1] = "end" - } - }, - ["down"] = { - [1] = { - [1] = "down" - } - } -} -Fetc/filesystem.cfg autorun=trueFetc/motdp#!/bin/lua +Detc/Fetc/filesystem.cfg autorun=trueFetc/motdp#!/bin/lua local component = require("component") local computer = require("computer") @@ -25986,12 +25911,12 @@ D,MineOS/Applications/AppMarket.app/Resources/D2MineOS/Applications/AppMarket. youHaveNewestApps = "У вас самое новое ПО", downloadingInfoAboutApplication = "Загрузка информации о приложении", updating = "Обновление", -}D%MineOS/Applications/MineCode IDE.app/F5MineOS/Applications/MineCode IDE.app/MineCode IDE.lua +}D%MineOS/Applications/MineCode IDE.app/F5MineOS/Applications/MineCode IDE.app/MineCode IDE.lua ---------------------------------------------------- Libraries ---------------------------------------------------- -- "/MineOS/Applications/MineCode IDE.app/MineCode IDE.lua" open OS.lua -package.loaded.syntax = nil +-- package.loaded.syntax = nil -- package.loaded.ECSAPI = nil -- package.loaded.GUI = nil -- package.loaded.windows = nil @@ -27059,8 +26984,10 @@ local function createWindow() menu:addItem(localization.open, false, "^O").onTouch = function() open() end - menu:addItem(localization.getFromWeb, false, "^U").onTouch = function() - downloadFromWeb() + if component.isAvailable("internet") then + menu:addItem(localization.getFromWeb, false, "^U").onTouch = function() + downloadFromWeb() + end end menu:addSeparator() menu:addItem(localization.save, not mainWindow.leftTreeView.currentFile, "^S").onTouch = function() @@ -27368,7 +27295,7 @@ local function createWindow() elseif eventData[4] == 24 then open() -- U - elseif eventData[4] == 22 then + elseif eventData[4] == 22 and component.isAvailable("internet") then downloadFromWeb() -- S elseif eventData[4] == 31 then @@ -27493,7 +27420,7 @@ buffer.draw() mainWindow:handleEvents(config.cursorBlinkDelay) -D/MineOS/Applications/MineCode IDE.app/Resources/D5MineOS/Applications/MineCode IDE.app/Resources/About/F@MineOS/Applications/MineCode IDE.app/Resources/About/Russian.txtMineCode IDE - это мощный инстурмент для разработки приложений с богатым функционалом: от подсветки синтаксиса Lua, выделения текста и работы с буфером обмена до поддержки пользовательских цветовых схем. Удобный файловый менеджер также прилагается.F9MineOS/Applications/MineCode IDE.app/Resources/Config.cfgP{["cursorSymbol"]="┃",["screenScale"]=1,["cursorColor"]=43263,["scrollSpeed"]=8,["doubleClickDelay"]=0.4,["enableAutoBrackets"]=true,["highlightLuaSyntax"]=true,["syntaxColorScheme"]={["text"]=16777215,["functions"]=16764006,["lineNumbersText"]=13421772,["numbers"]=6740991,["scrollBarForeground"]=3389183,["selection"]=5592405,["strings"]=10092416,["scrollBarBackground"]=4473924,["boolean"]=16767808,["logic"]=16764006,["indentation"]=3947580,["comments"]=8947848,["compares"]=16777112,["loops"]=16777112,["background"]=1973790,["lineNumbersBackground"]=2960685},["cursorBlinkDelay"]=0.5}F7MineOS/Applications/MineCode IDE.app/Resources/Icon.pic OCIFASbFB)YScFUB)YSdFB)YSeFB)YYFUB)YSwFB)YShFB)YS▀FB)YFB)YSiFB)YSmFUB)YSlFB)YS-FUB)YSnFB)YSoFUB)YS FB)YYYSaFB)YD