1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
-
+
|
/*
* tclCompExpr.c --
*
* This file contains the code to compile Tcl expressions.
*
* Copyright (c) 1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* RCS: @(#) $Id: tclCompExpr.c,v 1.1.2.2 1998/09/24 23:58:43 stanton Exp $
* RCS: @(#) $Id: tclCompExpr.c,v 1.1.2.3 1998/10/06 00:42:45 stanton Exp $
*/
#include "tclInt.h"
#include "tclCompile.h"
/*
* The stuff below is a bit of a hack so that this file can be used in
|
476
477
478
479
480
481
482
483
484
485
486
487
488
489
|
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
|
+
+
+
+
+
+
+
|
case TCL_TOKEN_OPERATOR:
/*
* Look up the operator. Temporarily overwrite the character
* just after the end of the operator with a 0 byte. If the
* operator isn't found, treat it as a math function.
*/
/*
* TODO: Note that the string is modified in place. This is unsafe
* and will break if any of the routines called while the string is
* modified have side effects that depend on the original string
* being unmodified (e.g. adding an etry to the literal table).
*/
operator = tokenPtr->start;
savedChar = operator[tokenPtr->size];
operator[tokenPtr->size] = 0;
hPtr = Tcl_FindHashEntry(&opHashTable, operator);
if (hPtr == NULL) {
code = CompileMathFuncCall(exprTokenPtr, operator, infoPtr,
envPtr, &endPtr);
|