Index: doc/syntax.txt ================================================================== --- doc/syntax.txt +++ doc/syntax.txt @@ -202,10 +202,31 @@ Example. Back reference in messages. (fooo) bar <<- ->> foo # “\1” should be: + +### Group positioning codes for JavaScript: + +There is no way in JavaScript to know where a captured group starts and ends. To avoid misplacement, regex rules may specify group positioning codes which indicate to the grammar checker where is the position of the captured groups. + +A group positioning code always begins by `@@`. If there is several codes, they are separated by a comma `,`. + +Other codes: + + 0 1 2 3 ... n left boundary position from left + -1 -2 -2 ... -n right boundary position from right + $ extreme right boundary + w somewhere with word boundaries + * something somewhere + ** something somewhere after previous group + +Examples: + + ([A-ZÉÈÂÎ][\w-]+) [A-ZÉÈÂ]([.]) ([A-ZÉÈÂ][\w-]+) @@0,*,$ + " ([?!;])" @@1 + ### Pattern matching Repeating pattern matching of a single rule continues after the previous matching, so instead of general multiword patterns, like Index: gc_lang/fr/rules.grx ================================================================== --- gc_lang/fr/rules.grx +++ gc_lang/fr/rules.grx @@ -17,34 +17,10 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Grammalecte. If not, see # - -# DOCUMENTATION - -# [++] : séparateur des règles pour le paragraphe et des règles pour la phrase. - -# Types d’action: -# ->> erreur -# ~>> préprocesseur de texte -# =>> désambiguïsateur - -# RÈGLES PAR EXPRESSIONS RÉGULIÈRES -# Expressions régulières en Python : http://docs.python.org/library/re.html -# Groups positioning code for JavaScript: -# Always begins by @@ -# 0 ... n left boundary position from left -# $ right boundary -# w word boundaries -# * something somewhere -# ** something somewhere after previous group -# >x:_ within group x, _ is group position code within group x - -# Fin d’interprétation du fichier avec une ligne commençant par #END - - # ERREURS COURANTES # http://fr.wikipedia.org/wiki/Wikip%C3%A9dia:Fautes_d%27orthographe/Courantes