/*******************************************************************************
 * Copyright (c) 2008, 2018 Phil Muldoon <pkmuldoon@picobot.org>.
 *
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *    Phil Muldoon <pkmuldoon@picobot.org> - initial API.
 *    Red Hat - modifications for use with Valgrind plugins.
 *******************************************************************************/
package org.eclipse.linuxtools.internal.valgrind.ui.editor;

import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.rules.EndOfLineRule;
import org.eclipse.jface.text.rules.IPredicateRule;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
import org.eclipse.jface.text.rules.Token;

public class SuppressionsPartitionScanner extends RuleBasedPartitionScanner {
    public static final String SUPP_TOOL = "__supp_tool"; //$NON-NLS-1$
    public static final String SUPP_TYPE = "__supp_type"; //$NON-NLS-1$
    public static final String SUPP_CONTEXT = "__supp_context"; //$NON-NLS-1$
    public static final String SUPP_COMMENT = "__supp_comment"; //$NON-NLS-1$

    public static final String[] SUPP_CONTENT_TYPES = { IDocument.DEFAULT_CONTENT_TYPE, SUPP_TOOL, SUPP_TYPE, SUPP_CONTEXT, SUPP_COMMENT };

    public SuppressionsPartitionScanner() {
        IToken commentToken = new Token(SUPP_COMMENT);

        setPredicateRules(new IPredicateRule[] {
                new EndOfLineRule("#", commentToken) //$NON-NLS-1$
        });
    }

}
