Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
[..pondering..]

sourcevault

💭
[..pondering..]
View GitHub Profile
@sourcevault
sourcevault / matchTime.lua
Last active Apr 13, 2019
understanding lpeg.Cmt recursively
View matchTime.lua
local success = function(all, pos) print('success') return pos end
local fail = function(all, pos) print('fail') return pos end
local common = Cmt(P('['), success)*(V('STMP')^0)*P(']')
local main_cmt = common + Cmt(P(']'),fail)
local main_normal = common + P(']')/fail
View luamail_lpeg.md

What is the idiomic way to create error messages in LPEG ?

To be specific I would like to create error messages for incomplete bracket completion.

Example :

[ 1 2 3 -- ERROR ! MISSING ] AT LINE 20

( 1 2 3 -- ERROR ! MISSING ) AT LINE 35

View blocking copas.moon
copas = require 'copas'
copas.addthread ->
copas.sleep 1
os.execute '<<blocking more than 1 second>>'
I = 0
@sourcevault
sourcevault / main.lua
Last active Jun 26, 2018
basic C module in Lua with Luarocks
View main.lua
sleep = require ("sourcevault/sleep")
sleep.hello()
View 12KeyLayout.ahk
#NoEnv
#SingleInstance force
SendMode Input
#Include <dual/dual>
dual := new Dual
#Include <dual/defaults>