- Timestamp:
- Feb 13, 2012, 5:03:25 PM (15 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- ab6d232
- Parents:
- 96de79c
- Location:
- toltcl/generic
- Files:
-
- 3 edited
-
tolaccess.cpp (modified) (2 diffs)
-
toltcl.c (modified) (3 diffs)
-
toltclInt.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
toltcl/generic/tolaccess.cpp
r96de79c r9d2a70c 42 42 #include <tol/tol_btxtgra.h> 43 43 #include <tol/tol_bmethodhook.h> 44 #include <tol/tol_bparser.h> 44 45 45 46 #include <toltclInt.h> … … 1879 1880 } 1880 1881 1882 int Tol_CheckSyntax(Tcl_Interp * interp, 1883 Tcl_Obj * obj_expr, 1884 Tcl_Obj * obj_result) 1885 { 1886 Tcl_DString dstr; 1887 BText tol_expr; 1888 1889 Tcl_DStringInit(&dstr); 1890 tol_expr = Tcl_UtfToExternalDString( NULL, Tcl_GetString( obj_expr ), 1891 -1, &dstr ); 1892 Tcl_DStringFree(&dstr); 1893 1894 BBool stat = BOut::ErrorHci(); 1895 BOut::PutErrorHci(BFALSE); 1896 BParser* parser = new BParser; 1897 Tree* tree = parser->Parsing( tol_expr ); 1898 Tcl_SetStringObj( obj_result, parser->MessageError(), -1 ); 1899 delete parser; 1900 BOut::PutErrorHci( stat ); 1901 DESTROY(tree); 1902 return TCL_OK; 1903 } 1904 1881 1905 /* 1882 1906 * Fill in obj_result the result of evaluating including the file -
toltcl/generic/toltcl.c
r96de79c r9d2a70c 40 40 41 41 static int Tol_InitLibraryCmd _ANSI_ARGS_((ClientData clientData, 42 Tcl_Interp *interp, 43 int objc, Tcl_Obj *CONST objv[])); 44 45 static int Tol_CheckSyntaxCmd _ANSI_ARGS_((ClientData clientData, 42 46 Tcl_Interp *interp, 43 47 int objc, Tcl_Obj *CONST objv[])); … … 257 261 (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL ); 258 262 263 Tcl_CreateObjCommand( interp, "::tol::checksyntax", Tol_CheckSyntaxCmd, 264 (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL ); 265 259 266 Tcl_CreateObjCommand( interp, "::tol::include", Tol_IncludeCmd, 260 267 (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL ); … … 351 358 } 352 359 return status; 360 } 361 362 363 364 /* 365 *---------------------------------------------------------------------- 366 * 367 * Tol_CheckSyntaxCmd -- 368 * 369 * Implements the new Tcl "::tol::checksyntax" command. 370 * 371 * Results: 372 * 373 * Returns the syntax error found in the tol expression given as 374 * argument. If no error is found then the empty string is 375 * returned. 376 * 377 * Side effects: 378 * None. 379 * 380 *---------------------------------------------------------------------- 381 */ 382 383 static int 384 Tol_CheckSyntaxCmd(clientData, interp, objc, objv) 385 ClientData clientData; /* Not used. */ 386 Tcl_Interp *interp; /* Current interpreter */ 387 int objc; /* Number of arguments */ 388 Tcl_Obj *CONST objv[]; /* Argument objects */ 389 { 390 Tcl_Obj * obj_result= Tcl_NewObj(); 391 int tcl_result; 392 393 if (objc != 2) { 394 Tcl_SetStringObj(obj_result, 395 "wrong # args: should be \"::tol::checksyntax tolcode\"", 396 -1); 397 tcl_result = TCL_ERROR; 398 } else 399 tcl_result = Tol_CheckSyntax( interp, objv[1], obj_result ); 400 Tcl_SetObjResult( interp, obj_result ); 401 return tcl_result; 353 402 } 354 403 -
toltcl/generic/toltclInt.h
r96de79c r9d2a70c 61 61 Tcl_Obj * obj_result)); 62 62 63 64 /*! Check the syntax of a given expresion. 65 */ 66 extern int Tol_CheckSyntax _ANSI_ARGS_((Tcl_Interp * interp, 67 Tcl_Obj * obj_expr, 68 Tcl_Obj * obj_result)); 69 63 70 /*! Fill in obj_result the result of evaluating including the file 64 71 * given as argument: the absolute path.
Note: See TracChangeset
for help on using the changeset viewer.
