lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Sean Conner once stated:
> 	
> 	function range(low,high)
> 	  return lpeg.Cmt(d^1,function(subject,position,capture)
> 	    local v = tostring(capture)
> 	    if capture >= low and capture <= high then
> 	      return position,v
> 	    end
> 	  end)
> 	end

  This should be:

	function range(low,high)
	  return lpeg.Cmt(d^1,function(subject,position,capture)
	    local v = tostring(capture)
	    if v >= low and v <= high then
	      return position,v
	    end
	  end)
	end

  -spc (Oops)