blob: 7b92f99947a45bdc7d3f20385d80e5e0991e6fb2 [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2006, 2019 Stephan Wahlbrink and others.
#
# 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, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.r.ui.text.r;
import org.eclipse.statet.ecommons.text.PairMatcher;
import org.eclipse.statet.r.core.source.IRDocumentConstants;
import org.eclipse.statet.r.core.source.RHeuristicTokenScanner;
public class RBracketPairMatcher extends PairMatcher {
public static final char[][] BRACKETS = { {'{', '}'}, {'(', ')'}, {'[', ']'} };
private static final String[] CONTENT_TYPES= new String[] {
IRDocumentConstants.R_DEFAULT_CONTENT_TYPE
};
public RBracketPairMatcher(final RHeuristicTokenScanner scanner) {
this(scanner, CONTENT_TYPES);
}
public RBracketPairMatcher(final RHeuristicTokenScanner scanner, final String[] partitions) {
super(BRACKETS,
scanner.getDocumentPartitioning(),
partitions,
scanner,
(char) 0);
}
}