blob: 0edc4fde7b873620144b298b857623817389713e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
package org.eclipse.cdt.internal.formatter;
import org.eclipse.jface.text.Position;
/*******************************************************************************
* Copyright (c) 2019 Marco Stornelli
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
*******************************************************************************/
public class InactivePosition extends Position {
private boolean preprocessorRegion;
public boolean isPreprocessorRegion() {
return preprocessorRegion;
}
/**
* Creates a new position with the given offset and length 0.
*
* @param offset the position offset, must be >= 0
* @param preprocessor True if the region is a preprocessor region, false otherwise
*/
public InactivePosition(int offset, boolean preprocessor) {
super(offset, 0);
preprocessorRegion = preprocessor;
}
/**
* Creates a new position with the given offset and length.
*
* @param offset the position offset, must be >= 0
* @param length the position length, must be >= 0
* @param preprocessor True if the region is a preprocessor region, false otherwise
*/
public InactivePosition(int offset, int length, boolean preprocessor) {
super(offset, length);
preprocessorRegion = preprocessor;
}
}
|