wasCSharpSQLite – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | /* |
2 | * TclRegexp.java |
||
3 | * |
||
4 | * Copyright (c) 1999 Sun Microsystems, Inc. |
||
5 | * |
||
6 | * See the file "license.terms" for information on usage and |
||
7 | * redistribution of this file, and for a DISCLAIMER OF ALL |
||
8 | * WARRANTIES. |
||
9 | * |
||
10 | * SCCS: %Z% %M% %I% %E% %U% |
||
11 | * Included in SQLite3 port to C# for use in testharness only; 2008 Noah B Hart |
||
12 | * |
||
13 | */ |
||
14 | using System; |
||
15 | using Regexp = sunlabs.brazil.util.regexp.Regexp; |
||
16 | namespace tcl.lang |
||
17 | { |
||
18 | |||
19 | public class TclRegexp |
||
20 | { |
||
21 | private TclRegexp() |
||
22 | { |
||
23 | } |
||
24 | |||
25 | public static Regexp compile( Interp interp, TclObject exp, bool nocase ) |
||
26 | { |
||
27 | try |
||
28 | { |
||
29 | |||
30 | return new Regexp( exp.ToString(), nocase ); |
||
31 | } |
||
32 | catch ( System.ArgumentException e ) |
||
33 | { |
||
34 | string msg = e.Message; |
||
35 | if ( msg.Equals( "missing )" ) ) |
||
36 | { |
||
37 | msg = "unmatched ()"; |
||
38 | } |
||
39 | else if ( msg.Equals( "missing ]" ) ) |
||
40 | { |
||
41 | msg = "unmatched []"; |
||
42 | } |
||
43 | msg = "couldn't compile regular expression pattern: " + msg; |
||
44 | throw new TclException( interp, msg ); |
||
45 | } |
||
46 | } |
||
47 | } |
||
48 | } |