<commit_before>;;; javascript

(defun js-method-p ()
  (save-excursion
    (word-search-backward "function")
    (looking-back ": ")))

(defun js-function-declaration-p ()
  (save-excursion
    (word-search-backward "function")
    (looking-back "^\\s +")))

(defun snippet--function-punctuation ()
  (if (js-method-p)
      (insert ",")
    (unless (js-function-declaration-p)
      (if (looking-at "\n") (insert ";")))))

(defun snippet--function-name ()<commit_msg>Fix totally broken function snippet.<commit_after>;;; javascript

(defun js-method-p ()
  (save-excursion
    (word-search-backward "function")
    (looking-back ": ")))

(defun js-function-declaration-p ()
  (save-excursion
    (word-search-backward "function")
    (looking-back "^\\s *")))

(defun snippet--function-punctuation ()
  (if (js-method-p)
      (when (not (looking-at "[ \n\t\r]*}"))
        (insert ","))
    (unless (js-function-declaration-p)
      (if (looking-at "$") (insert ";")))))

(defun snippet--function-name ()
{'fraction_non_alphanumeric': 0.2077534791252485, 'fraction_numerical': 0.0, 'mean_word_length': 3.3034188034188032, 'pattern_counts': {'":': 2, '<': 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': '5143044', 'n_tokens_mistral': 371, 'n_tokens_neox': 360, 'n_words': 63}