<commit_before>-module(reia_operators).
-export([ast/2, ast/3]).

ast('-' = Op, Ast) ->
  {op, 1, Op, {integer, 1, 0}, Ast}.
%ast('~' = Op, Ast) ->
%  erl_syntax:prefix_expr(erl_syntax:operator('bnot'), Ast).
  
ast('*' = Op, Ast1, Ast2) ->
  {op, 1, Op, Ast1, Ast2};
ast('**', Ast1, Ast2) ->
  {call,1,{remote,1,{atom,1,math},{atom,1,pow}},[Ast1, Ast2]};
ast('/' = Op, Ast1, Ast2) ->
  {op, 1, Op, Ast1, Ast2};
ast('+' = Op, Ast1, Ast2) ->
  {op, 1, Op, Ast1, Ast2};
ast('-' = Op, Ast1, Ast2) ->
  {op, 1, Op, Ast1, Ast2}.<commit_msg>Use proper unary for negative numbers in Erlang AST<commit_after>-module(reia_operators).
-export([ast/2, ast/3]).

ast('-' = Op, Ast) ->
  {op, 1, Op, Ast}.
%ast('~' = Op, Ast) ->
%  erl_syntax:prefix_expr(erl_syntax:operator('bnot'), Ast).
  
ast('*' = Op, Ast1, Ast2) ->
  {op, 1, Op, Ast1, Ast2};
ast('**', Ast1, Ast2) ->
  {call,1,{remote,1,{atom,1,math},{atom,1,pow}},[Ast1, Ast2]};
ast('/' = Op, Ast1, Ast2) ->
  {op, 1, Op, Ast1, Ast2};
ast('+' = Op, Ast1, Ast2) ->
  {op, 1, Op, Ast1, Ast2};
ast('-' = Op, Ast1, Ast2) ->
  {op, 1, Op, Ast1, Ast2}.
{'fraction_non_alphanumeric': 0.2832263978001833, 'fraction_numerical': 0.05866177818515124, 'mean_word_length': 3.918918918918919, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '4982717', 'n_tokens_mistral': 543, 'n_tokens_neox': 511, 'n_words': 122}