wasCSharpSQLite – Blame information for rev

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 /*
2 * EvalCmd.java
3 *
4 * Copyright (c) 1997 Cornell University.
5 * Copyright (c) 1997 Sun Microsystems, Inc.
6 *
7 * See the file "license.terms" for information on usage and
8 * redistribution of this file, and for a DISCLAIMER OF ALL
9 * WARRANTIES.
10 *
11 * Included in SQLite3 port to C# for use in testharness only; 2008 Noah B Hart
12 *
13 * RCS @(#) $Id: EvalCmd.java,v 1.1.1.1 1998/10/14 21:09:18 cvsadmin Exp $
14 *
15 */
16 using System;
17 namespace tcl.lang
18 {
19  
20 /// <summary> This class implements the built-in "eval" command in Tcl.</summary>
21  
22 class EvalCmd : Command
23 {
24 /// <summary> This procedure is invoked to process the "eval" Tcl command.
25 /// See the user documentation for details on what it does.
26 ///
27 /// </summary>
28 /// <param name="interp">the current interpreter.
29 /// </param>
30 /// <param name="argv">command arguments.
31 /// </param>
32 /// <exception cref=""> TclException if script causes error.
33 /// </exception>
34  
35 public TCL.CompletionCode cmdProc( Interp interp, TclObject[] argv )
36 {
37 if ( argv.Length < 2 )
38 {
39 throw new TclNumArgsException( interp, 1, argv, "arg ?arg ...?" );
40 }
41  
42 try
43 {
44 if ( argv.Length == 2 )
45 {
46 interp.eval( argv[1], 0 );
47 }
48 else
49 {
50 string s = Util.concat( 1, argv.Length - 1, argv );
51 interp.eval( s, 0 );
52 }
53 }
54 catch ( TclException e )
55 {
56 if ( e.getCompletionCode() == TCL.CompletionCode.ERROR )
57 {
58 interp.addErrorInfo( "\n (\"eval\" body line " + interp.errorLine + ")" );
59 }
60 throw;
61 }
62 return TCL.CompletionCode.RETURN;
63 }
64 }
65 }