Changeset 9d2a70c in tol for toltcl/generic/tolaccess.cpp


Ignore:
Timestamp:
Feb 13, 2012, 5:03:25 PM (15 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
ab6d232
Parents:
96de79c
Message:

refs #994, #1404: implementing the command tol::checksyntax

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@4124 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • toltcl/generic/tolaccess.cpp

    r96de79c r9d2a70c  
    4242#include <tol/tol_btxtgra.h>
    4343#include <tol/tol_bmethodhook.h>
     44#include <tol/tol_bparser.h>
    4445
    4546#include <toltclInt.h>
    … …  
    18791880}
    18801881
     1882int 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
    18811905/*
    18821906 * Fill in obj_result the result of evaluating including the file
Note: See TracChangeset for help on using the changeset viewer.