Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block sourcevault

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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

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 / main.lua
Last active Jun 26, 2018
basic C module in Lua with Luarocks
View main.lua
sleep = require ("sourcevault/sleep")
View 12KeyLayout.ahk
#SingleInstance force
SendMode Input
#Include <dual/dual>
dual := new Dual
#Include <dual/defaults>
You can’t perform that action at this time.