Grammalecte  Check-in [b89dc82bc4]

Overview
Comment:[core] add inline config for JSHint assuming es6 synthax and some global
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | webext2_fix
Files: files | file ages | folders
SHA3-256: b89dc82bc4139068a8580a17f8711f84676f5d045802c780e47dd4aa38724c27
User & Date: IllusionPerdu on 2017-08-08 19:11:22
Other Links: branch diff | manifest | tags
Context
2017-08-08
19:43
[fr][licence] GPL 3 seulement Closed-Leaf check-in: 81f981bab2 user: olr tags: fr, webext2_fix
19:11
[core] add inline config for JSHint assuming es6 synthax and some global check-in: b89dc82bc4 user: IllusionPerdu tags: webext2_fix
18:28
[core] force text/json mimetype in helpers.loadFile check-in: ccebd25f43 user: IllusionPerdu tags: core, fx, webext2_fix
Changes

Modified gc_core/js/helpers.js from [92497407e8] to [7c62a39694].

1
2


3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
10
11


+
+








// HELPERS
/*jslint esversion: 6*/
/*global console,require,exports,XMLHttpRequest*/

"use strict";

// In Firefox, there is no console.log in PromiseWorker, but there is worker.log.
// In Thunderbird, you can’t access to console directly. So it’s required to pass a log function.
let funcOutput = null;

Modified gc_core/js/ibdawg.js from [cdddd20c84] to [4cc6e3ad82].

1


2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9
10

+
+







//// IBDAWG
/*jslint esversion: 6*/
/*global console,require,exports*/

"use strict";


if (typeof(require) !== 'undefined') {
    var str_transform = require("resource://grammalecte/str_transform.js");
    var helpers = require("resource://grammalecte/helpers.js");

Modified gc_core/js/jsex_map.js from [ca76af0666] to [3dc39be41a].

1
2

3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
10


+








// Map
/*jslint esversion: 6*/

if (Map.prototype.grammalecte === undefined) {
    Map.prototype.gl_shallowCopy = function () {
        let oNewMap = new Map();
        for (let [key, val] of this.entries()) {
            oNewMap.set(key, val);
        }

Modified gc_core/js/jsex_regex.js from [8feeee694f] to [0c1a934c00].

1
2

3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
10


+








// regex
/*jslint esversion: 6*/

if (RegExp.prototype.grammalecte === undefined) {
    RegExp.prototype.gl_exec2 = function (sText, aGroupsPos, aNegLookBefore=null) {
        let m;
        while ((m = this.exec(sText)) !== null) {
            // we have to iterate over sText here too
            // because first match doesn’t imply it’s a valid match according to negative lookbefore assertions,

Modified gc_core/js/jsex_string.js from [86533aa4da] to [34840fe9fe].

1
2

3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
10


+








// String
/*jslint esversion: 6*/

if (String.prototype.grammalecte === undefined) {
    String.prototype.gl_count = function (sSearch, bOverlapping) {
        // http://jsperf.com/string-ocurrence-split-vs-match/8
        if (sSearch.length <= 0) {
            return this.length + 1;
        }

Modified gc_core/js/lang_core/gc_engine.js from [46602d3f85] to [a71cf52ea3].

1


2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9
10

+
+







// Grammar checker engine
/*jslint esversion: 6*/
/*global console,require,exports*/

"use strict";

${string}
${regex}
${map}

Modified gc_core/js/lang_core/gc_options.js from [ba36100a98] to [f47ea826e5].

1


2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9
10

+
+







// Options for Grammalecte
/*jslint esversion: 6*/
/*global exports*/

${map}


var gc_options = {
    getOptions: function (sContext="JavaScript") {
        if (this.dOpt.hasOwnProperty(sContext)) {

Modified gc_core/js/lang_core/gc_rules.js from [02fc1d6f94] to [cdb121423e].

1



2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9
10
11

+
+
+







// Grammar checker rules
/*jslint esversion: 6*/
/*global exports*/

"use strict";

${string}
${regex}

var gc_rules = {
    lParagraphRules: ${paragraph_rules_JS},

Modified gc_core/js/str_transform.js from [3f33d76266] to [6745507121].

1

2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9

+







//// STRING TRANSFORMATION
/*jslint esversion: 6*/

// Note: 48 is the ASCII code for "0"

var str_transform = {
    getStemFromSuffixCode: function (sFlex, sSfxCode) {
        // Suffix only
        if (sSfxCode == "0") {

Modified gc_core/js/tests.js from [abe05a3485] to [4504bb3576].

1


2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9
10

+
+







// JavaScript
/*jslint esversion: 6*/
/*global console,require,exports*/

"use strict";


if (typeof(require) !== 'undefined') {
    var helpers = require("resource://grammalecte/helpers.js");
}

Modified gc_core/js/text.js from [2699625d4c] to [2f8045c94f].

1


2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9
10

+
+







// JavaScript
/*jslint esversion: 6*/
/*global require,exports*/

"use strict";


if (typeof(require) !== 'undefined') {
    var helpers = require("resource://grammalecte/helpers.js");
}

Modified gc_core/js/tokenizer.js from [c0e5d0e035] to [81088a0177].

1
2


3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
10
11


+
+







// JavaScript
// Very simple tokenizer
/*jslint esversion: 6*/
/*global require,exports*/

"use strict";


if (typeof(require) !== 'undefined') {
    var helpers = require("resource://grammalecte/helpers.js");
}

Modified gc_lang/fr/modules-js/conj.js from [f441399830] to [696a2d3ec0].

1
2



3
4
5
6
7
8
9
1

2
3
4
5
6
7
8
9
10
11

-
+
+
+







// Grammalecte - Conjugueur
// License: GPL 3
// License: GPL 
/*jslint esversion: 6*/
/*global console,require,exports,self,browser*/

"use strict";

${map}


if (typeof(require) !== 'undefined') {

Modified gc_lang/fr/modules-js/cregex.js from [7faa9e5e5e] to [97d67d03aa].

1

2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9

+







//// Grammalecte - Compiled regular expressions
/*jslint esversion: 6*/


var cregex = {
    ///// Lemme
    _zLemma: new RegExp(">([a-zà-öø-ÿ0-9Ā-ʯ][a-zà-öø-ÿ0-9Ā-ʯ-]+)"),

    ///// Masculin / féminin / singulier / pluriel

Modified gc_lang/fr/modules-js/gce_analyseur.js from [0ad6fe5843] to [e2613ddcd2].

1

2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9

+







//// GRAMMAR CHECKING ENGINE PLUGIN: Parsing functions for French language
/*jslint esversion: 6*/

function rewriteSubject (s1, s2) {
    // s1 is supposed to be prn/patr/npr (M[12P])
    if (s2 == "lui") {
        return "ils";
    }
    if (s2 == "moi") {

Modified gc_lang/fr/modules-js/gce_date_verif.js from [de4d3b5e04] to [f30dbe242e].

1

2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9

+







//// GRAMMAR CHECKING ENGINE PLUGIN
/*jslint esversion: 6*/

// Check date validity

// WARNING: when creating a Date, month must be between 0 and 11


const _lDay = ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"];

Modified gc_lang/fr/modules-js/gce_suggestions.js from [b1d136482e] to [0d3c06e52f].

1


2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9
10

+
+







//// GRAMMAR CHECKING ENGINE PLUGIN: Suggestion mechanisms
/*jslint esversion: 6*/
/*global require*/

if (typeof(require) !== 'undefined') {
    var conj = require("resource://grammalecte/fr/conj.js");
    var mfsp = require("resource://grammalecte/fr/mfsp.js");
    var phonet = require("resource://grammalecte/fr/phonet.js");
}

Modified gc_lang/fr/modules-js/lexicographe.js from [9672629a43] to [fd0872dfca].

1
2


3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
10
11


+
+







// Grammalecte - Lexicographe
// License: MPL 2
/*jslint esversion: 6*/
/*global require,exports*/

"use strict";

${string}
${map}


Modified gc_lang/fr/modules-js/mfsp.js from [689f0a7f0b] to [9f60b851a7].

1


2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9
10

+
+







// Grammalecte
/*jslint esversion: 6*/
/*global console,require,exports,browser*/

"use strict";


if (typeof(require) !== 'undefined') {
    var helpers = require("resource://grammalecte/helpers.js");
}

Modified gc_lang/fr/modules-js/phonet.js from [2b1a025d02] to [e6268821db].

1

2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9

+







// Grammalecte - Suggestion phonétique
/*jslint esversion: 6*/

if (typeof(require) !== 'undefined') {
    var helpers = require("resource://grammalecte/helpers.js");
}


var phonet = {

Modified gc_lang/fr/modules-js/textformatter.js from [c6e77daf98] to [1785f80db7].

1


2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9
10

+
+







// Grammalecte - text formatter
/*jslint esversion: 6*/
/*global exports*/

"use strict";

${map}


// Latin letters: http://unicode-table.com/fr/