I hereby claim:
- I am exerro on github.
- I am shady_duck (https://keybase.io/shady_duck) on keybase.
- I have a public key ASBLFcvOXMCfPW7Vwe0EtbjaIwzyCdE2iBfgyyKFA7pahAo
To claim this, I am signing this object:
| local function safeIndex(t, ...) | |
| for _,v in ipairs({...}) do | |
| t = t[v] | |
| if not t then return nil end | |
| end | |
| return t | |
| end | |
| local function safeIndex2(t, ...) |
| --[[ Path library for Lua (by exerro aka Benedict Allen) | |
| Create a path using | |
| local p = Path 'my/directory' | |
| Combine paths like | |
| local file = p / 'subdir' / 'myfile.txt' |
| local __localmodules = {} | |
| local __localmodulecache = {} | |
| local __localmodulelines = {} | |
| local __require = require | |
| local function require(module) | |
| local f = __localmodules[module] | |
| if not f then return __require(module) end | |
| local result = __localmodulecache[module] | |
| if result == nil then | |
| __localmodulecache[module] = true |
I hereby claim:
To claim this, I am signing this object:
| local args = { ... } | |
| local config | |
| local CONFIG_PATH = ".ccsync.conf.lua" | |
| local ERR_CONFIG_FAIL = "Failed to open CCSync config file" | |
| local CONFIG_KEY_URL = "basic:url" | |
| local CONFIG_KEY_LOCALPATH = "basic:localpath" | |
| local PROMPT_URL = "URL:" | |
| local PROMPT_LOCALPATH = "Local path:" |
| Pair<A<T>, A<U>> ApplyBoth<T, U>(f: forall. Function<X, A<X>>, (a, b): Pair<T, U>) { | |
| return (f(a), f(b)) // Yeah, I made this syntax up | |
| } |
| grammar Flux; | |
| type Name = string[] | |
| enum AST { | |
| enum RootStatement { | |
| NamespaceStatement(Name, RootStatement[]) | |
| EnumDefinition(Name, Template, EnumBody) | |
| ClassDefinition(bool, bool, Name, Template, Type.Reference, Type.Reference[], ClassBodyStatement[]) // final abstract |
| package Flux; | |
| import java.util.ArrayList; | |
| import parsing.Position; | |
| public abstract class AST { | |
| public static enum NodeType { | |
| Statement, | |
| Expression, | |
| Definition, |
| local diff = e1.position:sub( e2.position ); | |
| local dist = diff:len(); | |
| local radius = e1.shape.radius + e2.shape.radius; | |
| if dist < radius then | |
| return Collision( e1, e2, radius - dist, diff:div( dist ) ) | |
| end |