<commit_before>import ControlStatement, Scope, Visitor, Node
import ../frontend/[BuildParams, Token]
import ../backend/cnaughty/AwesomeWriter // TODO: move AwesomeWriter somewhere else!
import structs/HashMap

import tinker/[Trail, Resolver, Response, Errors]

VersionBlock: class extends ControlStatement {

    spec: VersionSpec

    init: func ~verBlock (=spec, .token) {
        super(token)
    }

    clone: func -> This {
        new(spec, token)
    }

    accept: func (v: Visitor) {
        v visitVersionBlock(this)
    }

    getSpec: func -> VersionSpec { spec }

    toString: func -> String { spec toString() }

    resolve: func (trail: Trail, res: Resolver) -> Response {
        super(trail, res)
    }

    isResolved: func -> Bool { true }

}

VersionSpec: abstract class {

    token: Token

    init: func(=token) {}

    clone: abstract func -> This

    toString: abstract func -> String

    write: abstract func (w: AwesomeWriter)

    equals?: abstract func (other: VersionSpec) -> Bool

    isSatisfied: abstract func (params: BuildParams) -> Bool

}

builtinNames := HashMap<String, String> new()

{
    // ooc's excuse for a map literal (so far ^^)
    builtinNames put("windows", 	"__WIN32__) || defined(__WIN64__") // FIXME: is that right?
    builtinNames put("linux", 	"__linux__")
    builtinNames put("solaris", 	"__sun")
    builtinNames put("unix", 	"__unix__")
    builtinNames put("beos", 	"__BEOS__")
    builtinNames put("haiku", 	"__HAIKU__")
    builtinNames put("apple", 	"__APPLE__")
    builtinNames put("freebsd",		"__FreeBSD__")
    builtinNames put("openbsd",		"__OpenBSD__") // TODO: Verify name of __OpenBSD__ macro
    builtinNames put("netbsd",		"__NetBSD__") // TODO: Verify name of __NetBSD__ macro
    builtinNames put("dragonfly",	"__DragonFlyBSD__") // TODO: Verify name of __DragonFlyBSD__ macro
    builtinNames put("gnuc", 	"__GNUC__")
    builtinNames put("i386", 	"__i386__")
    builtinNames put("x86", 		"__X86__")
    builtinNames put("x86_64", 	"__x86_64__")
    builtinNames put("ppc", 		"__ppc__")<commit_msg>Verified all the macro names for the BSDs<commit_after>import ControlStatement, Scope, Visitor, Node
import ../frontend/[BuildParams, Token]
import ../backend/cnaughty/AwesomeWriter // TODO: move AwesomeWriter somewhere else!
import structs/HashMap

import tinker/[Trail, Resolver, Response, Errors]

VersionBlock: class extends ControlStatement {

    spec: VersionSpec

    init: func ~verBlock (=spec, .token) {
        super(token)
    }

    clone: func -> This {
        new(spec, token)
    }

    accept: func (v: Visitor) {
        v visitVersionBlock(this)
    }

    getSpec: func -> VersionSpec { spec }

    toString: func -> String { spec toString() }

    resolve: func (trail: Trail, res: Resolver) -> Response {
        super(trail, res)
    }

    isResolved: func -> Bool { true }

}

VersionSpec: abstract class {

    token: Token

    init: func(=token) {}

    clone: abstract func -> This

    toString: abstract func -> String

    write: abstract func (w: AwesomeWriter)

    equals?: abstract func (other: VersionSpec) -> Bool

    isSatisfied: abstract func (params: BuildParams) -> Bool

}

builtinNames := HashMap<String, String> new()

{
    // ooc's excuse for a map literal (so far ^^)
    builtinNames put("windows", 	"__WIN32__) || defined(__WIN64__") // FIXME: is that right?
    builtinNames put("linux", 	"__linux__")
    builtinNames put("solaris", 	"__sun")
    builtinNames put("unix", 	"__unix__")
    builtinNames put("beos", 	"__BEOS__")
    builtinNames put("haiku", 	"__HAIKU__")
    builtinNames put("apple", 	"__APPLE__")
    builtinNames put("freebsd",		"__FreeBSD__")
    builtinNames put("openbsd",		"__OpenBSD__")
    builtinNames put("netbsd",		"__NetBSD__")
    builtinNames put("dragonfly",	"__DragonFly__")
    builtinNames put("gnuc", 	"__GNUC__")
    builtinNames put("i386", 	"__i386__")
    builtinNames put("x86", 		"__X86__")
    builtinNames put("x86_64", 	"__x86_64__")
    builtinNames put("ppc", 		"__ppc__")
{'fraction_non_alphanumeric': 0.12953367875647667, 'fraction_numerical': 0.01085615593387614, 'mean_word_length': 3.430601092896175, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '6694676', 'n_tokens_mistral': 1447, 'n_tokens_neox': 1348, 'n_words': 352}