<commit_before>package com.googlecode.goclipse.editors;

import org.eclipse.jface.text.rules.*;

public class PartitionScanner extends RuleBasedPartitionScanner {
	public final static String COMMENT = "__comment";
	public final static String STRING = "__string";
	public final static String MULTILINE_STRING = "__multiline_string";

	public PartitionScanner() {

		IToken comment = new Token(COMMENT);
		IToken string  = new Token(STRING);
		IToken mstring  = new Token(MULTILINE_STRING);

		IPredicateRule[] rules = new IPredicateRule[6];

		rules[0] = new MultiLineRule("/*", "*/", comment);
		rules[1] = new SingleLineRule("//", null, comment);
      rules[2] = new SingleLineRule("'", "'", string);           // RAW STRING LITERAL
      rules[3] = new MultiLineRule("`", "`", mstring);           // RAW STRING LITERAL
      rules[4] = new SingleLineRule("\"", "\"", string, '\\');
      rules[5] = new SingleLineRule("/*", "", comment);
		setPredicateRules(rules);
	}
}<commit_msg>Improved the change of color syntax when commenting code. If one has only written /* but not yet added the "end tag" */ then everything after /* will be considered part of the comment.<commit_after>package com.googlecode.goclipse.editors;

import org.eclipse.jface.text.rules.*;

public class PartitionScanner extends RuleBasedPartitionScanner {
	public final static String COMMENT = "__comment";
	public final static String STRING = "__string";
	public final static String MULTILINE_STRING = "__multiline_string";

	public PartitionScanner() {

		IToken comment = new Token(COMMENT);
		IToken string  = new Token(STRING);
		IToken mstring  = new Token(MULTILINE_STRING);

		IPredicateRule[] rules = new IPredicateRule[5];

		rules[0] = new MultiLineRule("/*", "*/", comment, (char) 0, true);
		rules[1] = new SingleLineRule("//", null, comment);
        rules[2] = new SingleLineRule("'", "'", string);           // RAW STRING LITERAL
        rules[3] = new MultiLineRule("`", "`", mstring);           // RAW STRING LITERAL
        rules[4] = new SingleLineRule("\"", "\"", string, '\\');
		setPredicateRules(rules);
	}
}
{'fraction_non_alphanumeric': 0.140484100616991, 'fraction_numerical': 0.006644518272425249, 'mean_word_length': 4.007125890736342, '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': '3316503', 'n_tokens_mistral': 671, 'n_tokens_neox': 640, 'n_words': 183}