lua-users home
lua-l archive

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


Hi,

I have a main call to lpeg.match in the form:
	return lpeg.match(lpeg.Ct([pattern]), input)

but in [pattern], I would like to be able to have patterns that call lpeg.match for a subset of text. For example:
	lpeg.P(function(sub_input, index)
		local matches = lpeg.match(lpeg.Ct([sub-pattern]), sub_input)
		-- NEEDED: additional code
		return some_valid_number
	end)

but I want to append the contents of 'matches' to the main call's table captures where the 'additional code' comment is. Is there a way to do this?

Thanks,
-Mitchell;