<commit_before>{ build } = require './builder'
{ typeIsArray } = require '../util/util'

module.exports.Expression = class Expression
  constructor: (json) ->
    if json.operand?
      op = build(json.operand)
      if typeIsArray(json.operand) then @args = op else @arg = op
    if json.localId?
      @localId = json.localId
  
  execute: (ctx) ->
    if @localId?
      # Store the localId and result on the root context of this library
      ctx.rootContext().setLocalIdWithResult @localId, @exec(ctx)
      ctx.rootContext().getLocalIdResult @localId
    else <commit_msg>No longer returning execute value from localId object<commit_after>{ build } = require './builder'
{ typeIsArray } = require '../util/util'

module.exports.Expression = class Expression
  constructor: (json) ->
    if json.operand?
      op = build(json.operand)
      if typeIsArray(json.operand) then @args = op else @arg = op
    if json.localId?
      @localId = json.localId
  
  execute: (ctx) ->
    if @localId?
      # Store the localId and result on the root context of this library
      execValue = @exec(ctx)
      ctx.rootContext().setLocalIdWithResult @localId, execValue
      execValue
    else 
{'fraction_non_alphanumeric': 0.1092436974789916, 'fraction_numerical': 0.0, 'mean_word_length': 2.9966442953020134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4150178', 'n_tokens_mistral': 359, 'n_tokens_neox': 358, 'n_words': 108}