Description: Fix build with (even vaguely) new lua
 math.mod was renamed to math.fmod in 5.1; string.gfind was renamed
 string.gmatch in 5.2 (and the string.gfind alias has existed since
 5.0)
Author: Rupert Swarbrick <rswarbrick@gmail.com>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/luasseq.lua
+++ b/luasseq.lua
@@ -76,7 +76,7 @@
 function parselabelrange(s,defstart)
 	local res = {}
 	local mini,maxi,found
-	for rng in string.gfind(s.."," , "([^,]+)") do
+	for rng in string.gmatch(s.."," , "([^,]+)") do
 		found,_,mini,maxi = string.find(rng,"([+-]?[0-9]+)%.%.%.([+-]?[0-9]+)")
 		if not found then
 			mini = defstart
@@ -153,7 +153,7 @@
 
 function sseq_grid_chess(x,y,width,height)
 	tex.print("\\pgfsetcolor{sslightgr}")
-	if math.mod(x+y, 2) == 1 then	-- invert everything by first drawing a solid gray rectangle
+	if math.fmod(x+y, 2) == 1 then	-- invert everything by first drawing a solid gray rectangle
 									-- and then draw the grid in white. This way, even bidegree
 									-- is always white.
 	tex.print("\\pgfpathrectangle{\\pgfpoint{0sp}{0sp}}{\\pgfpoint{"
@@ -201,10 +201,10 @@
 	local chunk = 0
 	local index
 	
-	for rng in string.gfind(s.."," , "([^,]*),") do
+	for rng in string.gmatch(s.."," , "([^,]*),") do
 		res[chunk] = {}
 		index = 0
-		for label in string.gfind(rng..";", "([^;]*);") do
+		for label in string.gmatch(rng..";", "([^;]*);") do
 			res[chunk][index] = label
 			index = index+1
 		end
@@ -418,7 +418,7 @@
 function stringtolist(pref,name)
 	local res = {}
 	for i,p in ipairs(pref) do table.insert(res,p) end
-	for w in string.gfind(name,"%w+") do
+	for w in string.gmatch(name,"%w+") do
 		table.insert(res,w)
 	end
 	table.sort(res)
