Mercurial > projects > dwt-addons
annotate dwtx/jface/text/rules/MultiLineRule.d @ 199:eb98a5cbfd78
Fix: potential problem with synchronized, thx torhu.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 13 Mar 2009 17:03:26 +0100 |
parents | 51e6e63f930e |
children |
rev | line source |
---|---|
129 | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2005 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwtx.jface.text.rules.MultiLineRule; | |
14 | |
131 | 15 import dwtx.jface.text.rules.FastPartitioner; // packageimport |
16 import dwtx.jface.text.rules.ITokenScanner; // packageimport | |
17 import dwtx.jface.text.rules.Token; // packageimport | |
18 import dwtx.jface.text.rules.RuleBasedScanner; // packageimport | |
19 import dwtx.jface.text.rules.EndOfLineRule; // packageimport | |
20 import dwtx.jface.text.rules.WordRule; // packageimport | |
21 import dwtx.jface.text.rules.WhitespaceRule; // packageimport | |
22 import dwtx.jface.text.rules.WordPatternRule; // packageimport | |
23 import dwtx.jface.text.rules.IPredicateRule; // packageimport | |
24 import dwtx.jface.text.rules.DefaultPartitioner; // packageimport | |
25 import dwtx.jface.text.rules.NumberRule; // packageimport | |
26 import dwtx.jface.text.rules.SingleLineRule; // packageimport | |
27 import dwtx.jface.text.rules.PatternRule; // packageimport | |
28 import dwtx.jface.text.rules.RuleBasedDamagerRepairer; // packageimport | |
29 import dwtx.jface.text.rules.ICharacterScanner; // packageimport | |
30 import dwtx.jface.text.rules.IRule; // packageimport | |
31 import dwtx.jface.text.rules.DefaultDamagerRepairer; // packageimport | |
32 import dwtx.jface.text.rules.IToken; // packageimport | |
33 import dwtx.jface.text.rules.IPartitionTokenScanner; // packageimport | |
34 import dwtx.jface.text.rules.RuleBasedPartitioner; // packageimport | |
35 import dwtx.jface.text.rules.RuleBasedPartitionScanner; // packageimport | |
36 import dwtx.jface.text.rules.BufferedRuleBasedScanner; // packageimport | |
37 import dwtx.jface.text.rules.IWhitespaceDetector; // packageimport | |
38 | |
39 | |
129 | 40 import dwt.dwthelper.utils; |
41 | |
42 | |
43 /** | |
44 * A rule for detecting patterns which begin with a given | |
45 * sequence and may end with a given sequence thereby spanning | |
46 * multiple lines. | |
47 */ | |
48 public class MultiLineRule : PatternRule { | |
49 | |
50 /** | |
51 * Creates a rule for the given starting and ending sequence | |
52 * which, if detected, will return the specified token. | |
53 * | |
54 * @param startSequence the pattern's start sequence | |
55 * @param endSequence the pattern's end sequence | |
56 * @param token the token to be returned on success | |
57 */ | |
133
7d818bd32d63
Fix ctors to this with gvim regexp
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
58 public this(String startSequence, String endSequence, IToken token) { |
134 | 59 this(startSequence, endSequence, token, cast(wchar) 0); |
129 | 60 } |
61 | |
62 /** | |
63 * Creates a rule for the given starting and ending sequence | |
64 * which, if detected, will return the specific token. | |
65 * Any character which follows the given escape character will be ignored. | |
66 * | |
67 * @param startSequence the pattern's start sequence | |
68 * @param endSequence the pattern's end sequence | |
69 * @param token the token to be returned on success | |
70 * @param escapeCharacter the escape character | |
71 */ | |
133
7d818bd32d63
Fix ctors to this with gvim regexp
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
72 public this(String startSequence, String endSequence, IToken token, char escapeCharacter) { |
129 | 73 this(startSequence, endSequence, token, escapeCharacter, false); |
74 } | |
75 | |
76 /** | |
77 * Creates a rule for the given starting and ending sequence | |
78 * which, if detected, will return the specific token. Any character that follows the | |
79 * given escape character will be ignored. <code>breakOnEOF</code> indicates whether | |
80 * EOF is equivalent to detecting the <code>endSequence</code>. | |
81 * | |
82 * @param startSequence the pattern's start sequence | |
83 * @param endSequence the pattern's end sequence | |
84 * @param token the token to be returned on success | |
85 * @param escapeCharacter the escape character | |
86 * @param breaksOnEOF indicates whether the end of the file terminates this rule successfully | |
87 * @since 2.1 | |
88 */ | |
133
7d818bd32d63
Fix ctors to this with gvim regexp
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
89 public this(String startSequence, String endSequence, IToken token, char escapeCharacter, bool breaksOnEOF) { |
129 | 90 super(startSequence, endSequence, token, escapeCharacter, false, breaksOnEOF); |
91 } | |
92 } |