<commit_before>package set

import "github.com/qlova/ilang/src"

var Type = ilang.NewType("set", "PUSH", "PULL")

func init() {
	ilang.RegisterStatement(Type, ScanStatement)
	ilang.RegisterSymbol("<", ScanSymbol)
	ilang.RegisterExpression(ScanExpression)
	
	ilang.RegisterFunction("set", ilang.Method(Type, true, "PUSH 1"))
	
	//Set Operations.
	ilang.NewOperator(Type, "=", Type, "VAR %c\nSEQ %c %a %b", true, ilang.Number)
	ilang.NewOperator(Type, "+", Type, "VAR %c\nMUL %c %a %b", false)
	ilang.NewOperator(Type, "-", Type, "VAR %c\nDIV %c %a %b", false)
	ilang.NewOperator(Type, "+=", Type, "MUL %a %a %b", false, ilang.Undefined)
	ilang.NewOperator(Type, "-=", Type, "DIV %a %a %b", false, ilang.Undefined)
	ilang.NewOperator(Type, "<=", Type, "VAR %c\nMOD %c %b %a\nDIV %c %c 0", true, ilang.Number)
	ilang.NewOperator(Type, ">", Type, "VAR %c\nMOD %c %b %a\n", true, ilang.Number)
	ilang.NewOperator(Type, ">=", Type, "VAR %c\nMOD %c %b %a\nVAR %t\nSEQ %t %a %b\nADD%c %c %t", true, ilang.Number)
	ilang.NewOperator(Type, "<", Type, "VAR %c\nMOD %c %b %a\nDIV %c %c 0\nVAR %t\nSNE %t %a %b\nMUL%c %c %t", true, ilang.Number)
}

func ScanSymbol(ic *ilang.Compiler) ilang.Type {
	ic.Scan('>')
	return Type
}

func ScanExpression(ic *ilang.Compiler) string {
	if ic.LastToken == "<" {
		var id = ic.Tmp("set")

		ic.Assembly("VAR ", id)
		ic.Assembly("ADD ", id, " 1 0")
<commit_msg>Fix typo in set.go<commit_after>package set

import "github.com/qlova/ilang/src"

var Type = ilang.NewType("set", "PUSH", "PULL")

func init() {
	ilang.RegisterStatement(Type, ScanStatement)
	ilang.RegisterSymbol("<", ScanSymbol)
	ilang.RegisterExpression(ScanExpression)
	
	ilang.RegisterFunction("set", ilang.Method(Type, true, "PUSH 1"))
	
	//Set Operations.
	ilang.NewOperator(Type, "=", Type, "VAR %c\nSEQ %c %a %b", true, ilang.Number)
	ilang.NewOperator(Type, "+", Type, "VAR %c\nMUL %c %a %b", false)
	ilang.NewOperator(Type, "-", Type, "VAR %c\nDIV %c %a %b", false)
	ilang.NewOperator(Type, "+=", Type, "MUL %a %a %b", false, ilang.Undefined)
	ilang.NewOperator(Type, "-=", Type, "DIV %a %a %b", false, ilang.Undefined)
	ilang.NewOperator(Type, "<=", Type, "VAR %c\nMOD %c %b %a\nDIV %c %c 0", true, ilang.Number)
	ilang.NewOperator(Type, ">", Type, "VAR %c\nMOD %c %b %a\n", true, ilang.Number)
	ilang.NewOperator(Type, ">=", Type, "VAR %c\nMOD %c %b %a\nVAR %t\nSEQ %t %a %b\nADD%c %c %t", true, ilang.Number)
	ilang.NewOperator(Type, "<", Type, "VAR %c\nMOD %c %b %a\nDIV %c %c 0\nVAR %t\nSNE %t %a %b\nMUL %c %c %t", true, ilang.Number)
}

func ScanSymbol(ic *ilang.Compiler) ilang.Type {
	ic.Scan('>')
	return Type
}

func ScanExpression(ic *ilang.Compiler) string {
	if ic.LastToken == "<" {
		var id = ic.Tmp("set")

		ic.Assembly("VAR ", id)
		ic.Assembly("ADD ", id, " 1 0")

{'fraction_non_alphanumeric': 0.2124370956146657, 'fraction_numerical': 0.0035945363048166786, 'mean_word_length': 4.5, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '6233870', 'n_tokens_mistral': 1219, 'n_tokens_neox': 1174, 'n_words': 284}