-- lx format
local format = require("core.format")
local detect = require("format.asm.detect")

--- Select one complete assembly dialect instead of mixing incompatible rules
-- @param ctx table bounded format-detection context
-- @return table redirect
local function detect_assembly(ctx)
	return {
		action = "redirect",
		format = "module:" .. detect.select_module(ctx.filename, ctx.data),
	}
end

format.register({
	name = "Assembly Source",
	shortname = "Assembly",
	author = "liqube",
	extensions = { "asm", "s" },
	detect = detect_assembly,
})
