<commit_before>#lang racket

;;################################################################################;;
;;
;; This file contains utility functions, mostly for checking invariants, used by
;; the simplification code.
;;
;;################################################################################;;

(provide (all-defined-out))

(define-syntax assert
  (syntax-rules ()
    [(assert pred #:loc location)
     (when (not pred)
       (error location "~a returned false!" 'pred))]
    [(assert pred)
     (when (not pred)
       (error 'assert "~a returned false!" 'pred))]))<commit_msg>Special Cased Equality Checks For Asserts<commit_after>#lang racket

;;################################################################################;;
;;
;; This file contains utility functions, mostly for checking invariants, used by
;; the simplification code.
;;
;;################################################################################;;

(provide (all-defined-out))

(define-syntax assert
  (syntax-rules (=)
    [(assert (= a b) #:loc location)
     (when (not (= a b))
       (error location "~a returned false!~n~a is ~a, but ~a is ~a"
	      (list '= 'a 'b)
	      'a a
	      'b b))]
    [(assert (= a b))
     (when (not (= a b))
       (error 'assert "~a returned false!~n~a is ~a, but ~a is ~a"
	      (list '= 'a 'b)
	      'a a
	      'b b))]
    [(assert pred #:loc location)
     (when (not pred)
       (error location "~a returned false!" 'pred))]
    [(assert pred)
     (when (not pred)
       (error 'assert "~a returned false!" 'pred))]))
{'fraction_non_alphanumeric': 0.3382072472981564, 'fraction_numerical': 0.0, 'mean_word_length': 3.8580246913580245, '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': '2062949', 'n_tokens_mistral': 464, 'n_tokens_neox': 420, 'n_words': 146}