<commit_before>//data objects

Blocklify.JavaScript.Generator['js_literal_number'] = function(block) {
  var code = parseFloat(block.getFieldValue('NUMBER'));
  return [code, Blocklify.JavaScript.Generator.ORDER_ATOMIC];
};
Blocklify.JavaScript.Generator['js_literal_string'] = function(block) {
  var code = Blocklify.JavaScript.Generator.quote_(block.getFieldValue('STRING'));
  return [code, Blocklify.JavaScript.Generator.ORDER_ATOMIC];
};
//object in JSON format
Blockly.Blocks['json_object'] = {
  init: function() {
    this.setColour(260);
    this.setOutput(true);
    this.appendDummyInput()
          .appendField('object');
    this.appendStatementInput('ELEMENTS')
          .appendField('elements');
    this.setTooltip('Object in JSON format.');
  }
};
Blockly.Blocks['json_element'] = {
  init: function() {
    this.setColour(330);
    this.setPreviousStatement(true);
    this.setNextStatement(true);
    this.interpolateMsg(
        ' %1 : %2',
        ['NAME', new Blockly.FieldTextInput('property')],
        ['VALUE', null, Blockly.ALIGN_RIGHT],
        Blockly.ALIGN_RIGHT);
    this.setInputsInline(false);
    this.setTooltip('Element of object in JSON format.');
  }
};
Blocklify.JavaScript.Generator['js_identifier'] = function(block) {
  var name = block.getFieldValue('NAME');
  var code = name;
  return [code, Blocklify.JavaScript.Generator.ORDER_ATOMIC];
};
Blockly.Blocks['identifier_member_expression'] = {
  init: function() {
    this.setColour(330);
    this.setOutput(true);
    this.interpolateMsg(
        '%1.%2',
        ['NAME', new Blockly.FieldTextInput('')],
        ['NEXT', null, Blockly.ALIGN_RIGHT],
        Blockly.ALIGN_RIGHT);
    this.setInputsInline(false);
    this.setTooltip('Identifier of member expression.');
  }
};
Blockly.Blocks['variable_declarator'] = {
  /**
   * Block for redering a variable declarator.
   * @this Blockly.Block
   */
  init: function() {
    this.setColour(290);
    this.setPreviousStatement(true);
    this.setNextStatement(true);
    this.interpolateMsg(
        'set %1 = %2',
        ['VAR', null],
        ['VALUE', null, Blockly.ALIGN_RIGHT],
        Blockly.ALIGN_RIGHT);
    this.setTooltip('Variable declarator.');
  }
};
Blockly.Blocks['variable_declaration'] = {
  /**
   * Block for redering a variable declaration.
   * @this Blockly.Block
   */
  init: function() {
    this.setColour(290);
    this.setPreviousStatement(true);
    this.setNextStatement(true);
    this.appendDummyInput()
            .appendField('variable declaration');
    this.appendStatementInput('DECLARATIONS');<commit_msg>JS variable declaration unary gen<commit_after>//data objects

Blocklify.JavaScript.Generator['js_literal_number'] = function(block) {
  var code = parseFloat(block.getFieldValue('NUMBER'));
  return [code, Blocklify.JavaScript.Generator.ORDER_ATOMIC];
};
Blocklify.JavaScript.Generator['js_literal_string'] = function(block) {
  var code = Blocklify.JavaScript.Generator.quote_(block.getFieldValue('STRING'));
  return [code, Blocklify.JavaScript.Generator.ORDER_ATOMIC];
};
//object in JSON format
Blockly.Blocks['json_object'] = {
  init: function() {
    this.setColour(260);
    this.setOutput(true);
    this.appendDummyInput()
          .appendField('object');
    this.appendStatementInput('ELEMENTS')
          .appendField('elements');
    this.setTooltip('Object in JSON format.');
  }
};
Blockly.Blocks['json_element'] = {
  init: function() {
    this.setColour(330);
    this.setPreviousStatement(true);
    this.setNextStatement(true);
    this.interpolateMsg(
        ' %1 : %2',
        ['NAME', new Blockly.FieldTextInput('property')],
        ['VALUE', null, Blockly.ALIGN_RIGHT],
        Blockly.ALIGN_RIGHT);
    this.setInputsInline(false);
    this.setTooltip('Element of object in JSON format.');
  }
};
Blocklify.JavaScript.Generator['js_identifier'] = function(block) {
  var name = block.getFieldValue('NAME');
  var code = name;
  return [code, Blocklify.JavaScript.Generator.ORDER_ATOMIC];
};
Blockly.Blocks['identifier_member_expression'] = {
  init: function() {
    this.setColour(330);
    this.setOutput(true);
    this.interpolateMsg(
        '%1.%2',
        ['NAME', new Blockly.FieldTextInput('')],
        ['NEXT', null, Blockly.ALIGN_RIGHT],
        Blockly.ALIGN_RIGHT);
    this.setInputsInline(false);
    this.setTooltip('Identifier of member expression.');
  }
};
Blockly.Blocks['variable_declarator'] = {
  /**
   * Block for redering a variable declarator.
   * @this Blockly.Block
   */
  init: function() {
    this.setColour(290);
    this.setPreviousStatement(true);
    this.setNextStatement(true);
    this.interpolateMsg(
        'set %1 = %2',
        ['VAR', null],
        ['VALUE', null, Blockly.ALIGN_RIGHT],
        Blockly.ALIGN_RIGHT);
    this.setTooltip('Variable declarator.');
  }
};
Blocklify.JavaScript.Generator['js_variable_declaration_unary'] = function(block) {
  var operator = block.getFieldValue('OPERATOR');
  var variable = Blocklify.JavaScript.Generator.valueToCode(block, 'VAR',
      Blocklify.JavaScript.Generator.ORDER_ATOMIC);
  var value = Blocklify.JavaScript.Generator.valueToCode(block, 'VALUE',
      Blocklify.JavaScript.Generator.ORDER_ATOMIC);
  var code =  'var ' + variable + ' = ' + value;
  if (block.outputConnection) {
    return [code, OPERATORS[operator]];
  } else {
    return code + ';\n';
  }
};
Blockly.Blocks['variable_declaration'] = {
  /**
   * Block for redering a variable declaration.
   * @this Blockly.Block
   */
  init: function() {
    this.setColour(290);
    this.setPreviousStatement(true);
    this.setNextStatement(true);
    this.appendDummyInput()
            .appendField('variable declaration');
    this.appendStatementInput('DECLARATIONS');
{'fraction_non_alphanumeric': 0.14813529921942759, 'fraction_numerical': 0.007285342584562012, 'mean_word_length': 3.8251046025104602, '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': '1980167', 'n_tokens_mistral': 1809, 'n_tokens_neox': 1822, 'n_words': 296}