<commit_before>namespace BooJs.Lang.Macros

import Boo.Lang.Compiler
import Boo.Lang.Compiler.Ast

macro assert:
    return unless CompilerContext.Current.Parameters.Debug
    cond, = assert.Arguments
    message = cond.ToCodeString()
    yield [| raise BooJs.Lang.Builtins.AssertionError($message) if not $cond |]<commit_msg>Do not generate asserts if not in debug mode<commit_after>namespace BooJs.Lang.Macros

import Boo.Lang.Compiler
import Boo.Lang.Compiler.Ast

macro assert:
    return unless CompilerContext.Current.Parameters.Debug

    argc = len(assert.Arguments)
    if argc != 1 and argc != 2:
        raise "assert <condition> [, <message>]"
        
    if 2 == argc:
        cond, msg = assert.Arguments
    else:
        cond, = assert.Arguments
        msg = [| $(cond.ToCodeString()) |]
        
    return [| raise BooJs.Lang.Builtins.AssertionError($msg) unless $cond |]
{'fraction_non_alphanumeric': 0.10774410774410774, 'fraction_numerical': 0.003367003367003367, 'mean_word_length': 3.2476190476190476, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2255823', 'n_tokens_mistral': 279, 'n_tokens_neox': 269, 'n_words': 68}