--- Build strict file-reference rules for Perl source files
-- @module formats.perl.references

local perl_references = {}

-- Pattern breakdown: frontiers keep file-loading words standalone; spaces and one parenthesis are optional
local require_prefix = "%f[%w_%.:>%-]require%f[^%w_]%s*%(?%s*"
local do_prefix = "%f[%w_%.:>%-]do%f[^%w_]%s*%(?%s*"

--- Return literal quoted Perl file-loading references
-- @return table rules
function perl_references.new()
	return {
		{ prefix = require_prefix, open = "\"", close = "\"" },
		{ prefix = require_prefix, open = "'", close = "'" },
		{ prefix = do_prefix, open = "\"", close = "\"" },
		{ prefix = do_prefix, open = "'", close = "'" },
	}
end

return perl_references
