<commit_before>/**
 *
 * @source: parser.js
 *
 * @licstart  The following is the entire license notice for the
 *  JavaScript code in this page.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * @licend  The above is the entire license notice
 * for the JavaScript code in this page.
 *
 */

// Grammar Object Representation in Javascript

function Grammar (equivalent, condition, level, rule) {

	this.representation = equivalent;
	this.condition = condition;
	this.priority = level;
	this.rule = rule;
}

// This is the object that represents a row during parsing

function ParseHistoryRow (buffer, unscanned, next, action) {

	this.buffer = buffer;
	this.unscanned = unscanned;
	this.next = next;
	this.action = action;
}

// Trims the string and removes the whitespaces from beginning and end of a sentence.



var parser = {

	grammar : [

		// Action check triggers

		"decl <- id = result F | id = const F | id = id F",

		"cmpAsgn <- id += result F | id += const F | id += id F",
		"cmpAsgn <- id *= result F | id *= const F | id *= id F",
		"cmpAsgn <- id -= result F | id -= const F | id -= id F",
		"cmpAsgn <- id /= result F | id /= const F | id /= id F",
		"cmpAsgn <- id += sConst F",

		"strDecl <- id = sConst F",
		"funcStrDecl <- strDecl + func",

		// For decimal
		"const <- int ( sConst ) | int result | float ( sConst ) | float result",

		// String Operation
		"sConst <- id + sConst | sConst + id | sConst + sConst",
		"sConst <- str ( sConst ) | str result | ( sConst )",
<commit_msg>Added support for compound assignments<commit_after>/**
 *
 * @source: parser.js
 *
 * @licstart  The following is the entire license notice for the
 *  JavaScript code in this page.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * @licend  The above is the entire license notice
 * for the JavaScript code in this page.
 *
 */

// Grammar Object Representation in Javascript

function Grammar (equivalent, condition, level, rule) {

	this.representation = equivalent;
	this.condition = condition;
	this.priority = level;
	this.rule = rule;
}

// This is the object that represents a row during parsing

function ParseHistoryRow (buffer, unscanned, next, action) {

	this.buffer = buffer;
	this.unscanned = unscanned;
	this.next = next;
	this.action = action;
}

// Trims the string and removes the whitespaces from beginning and end of a sentence.





var parser = {

	grammar : [

		// Action check trigger

		"decl <- id = result F | id = const F | id = id F",

		"cmpAsgn <- id += result F | id += const F | id += id F",
		"cmpAsgn <- id *= result F | id *= const F | id *= id F",
		"cmpAsgn <- id -= result F | id -= const F | id -= id F",
		"cmpAsgn <- id /= result F | id /= const F | id /= id F",
		"cmpAsgn <- id += sConst F",

		"strDecl <- id = sConst F",
		"funcStrDecl <- strDecl + func",

		// For decimal
		"const <- int ( sConst ) | int result | float ( sConst ) | float result",

		// String Operation
		"sConst <- id + sConst | sConst + id | sConst + sConst",
		"sConst <- str ( sConst ) | str result | ( sConst )",

{'fraction_non_alphanumeric': 0.12529691211401425, 'fraction_numerical': 0.0023752969121140144, 'mean_word_length': 2.8415051311288484, 'pattern_counts': {'":': 0, '<': 25, '<?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': '7091569', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1052, 'n_words': 438}