<commit_before>local affine = require("lib/affine")

-- Storing a reference here since we will replace the function pointers later
local lgorigin = love.graphics.origin
local lgscale = love.graphics.scale
local lgrotate = love.graphics.rotate
local lgshear = love.graphics.shear
local lgtranslate = love.graphics.translate
local lgpush = love.graphics.push
local lgpop = love.graphics.pop
-- local lggetscissor = love.graphics.getScissor
-- local lgsetscissor = love.graphics.setScissor
-- local lgintersectscissor = love.graphics.intersectScissor

local transform = {}

local matrix = affine.id()
local scale = {1, 1}
local transform_stack = {}
local scale_stack = {}

function transform.origin()
	matrix = affine.id()
	scale = {1, 1}
	lgorigin()
end

function transform.push(...)
	table.insert(transform_stack, matrix)
	table.insert(scale_stack, scale)
	lgpush(...)
end

function transform.pop()
	matrix = table.remove(transform_stack)
	scale = table.remove(scale_stack)
	lgpop()
end

-- function transform.setScissor()
-- end

-- function transform.getScissor()
-- end

-- function transform.intersectScissor()<commit_msg>Fix push and pop in transform<commit_after>local affine = require("lib/affine")

-- Storing a reference here since we will replace the function pointers later
local lgorigin = love.graphics.origin
local lgscale = love.graphics.scale
local lgrotate = love.graphics.rotate
local lgshear = love.graphics.shear
local lgtranslate = love.graphics.translate
local lgpush = love.graphics.push
local lgpop = love.graphics.pop
-- local lggetscissor = love.graphics.getScissor
-- local lgsetscissor = love.graphics.setScissor
-- local lgintersectscissor = love.graphics.intersectScissor

local transform = {}

local matrix = affine.id()
local scale = {1, 1}
local transform_stack = {}
local scale_stack = {}

function transform.origin()
	matrix = affine.id()
	scale = {1, 1}
	lgorigin()
end

function transform.push(...)
	table.insert(transform_stack, affine.clone(matrix))
	table.insert(scale_stack, {scale[1], scale[2]})
	lgpush(...)
end

function transform.pop()
	matrix = table.remove(transform_stack)
	scale = table.remove(scale_stack)
	lgpop()
end

-- function transform.setScissor()
-- end

-- function transform.getScissor()
-- end

-- function transform.intersectScissor()
{'fraction_non_alphanumeric': 0.1159041394335512, 'fraction_numerical': 0.004357298474945534, 'mean_word_length': 4.711442786069652, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2452450', 'n_tokens_mistral': 745, 'n_tokens_neox': 731, 'n_words': 187}