Check-in [8e3b0a8451]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added proc-wrappers so global variables aren't passed through
Timelines: family | ancestors | proc-wrapper
Files: files | file ages | folders
SHA1:8e3b0a84510d3824b18904e6dec178b87bfd17a1
User & Date: rkeene 2015-04-06 17:35:33
Context
2015-04-06
17:35
Added proc-wrappers so global variables aren't passed through Leaf check-in: 8e3b0a8451 user: rkeene tags: proc-wrapper
2014-11-05
19:09
rivetcgi 0.5.1.7 check-in: e81ec0430d user: rkeene tags: trunk, 0.5.1.7
Changes

Changes to lib/src/rivetParser.c.

103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
...
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
    if (rivetfile == NULL) {
        /* Don't need to adderrorinfo - Tcl_OpenFileChannel takes care
           of that for us. */
        return TCL_ERROR;
    }

    if (toplevel) {
        Tcl_AppendToObj(outbuf, "namespace eval request {\n", -1);
    } else {
        Tcl_SetStringObj(outbuf, "", -1);
    }
    Tcl_AppendToObj(outbuf, "puts -nonewline \"", -1);

    inbuf = Tcl_NewObj();
    Tcl_IncrRefCount(inbuf);
................................................................................
    if (Rivet_Parser(outbuf, inbuf) == 0)
    {
        Tcl_AppendToObj(outbuf, "\"\n", 2);
    }

    if (toplevel)
    {
        Tcl_AppendToObj(outbuf, "\n}", -1);
    }
    Tcl_AppendToObj(outbuf, "\n", -1);

    Tcl_DecrRefCount(inbuf);
    /* END PARSER  */
    return TCL_OK;
}







|







 







|







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
...
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
    if (rivetfile == NULL) {
        /* Don't need to adderrorinfo - Tcl_OpenFileChannel takes care
           of that for us. */
        return TCL_ERROR;
    }

    if (toplevel) {
        Tcl_AppendToObj(outbuf, "namespace eval request {}; proc ::request::__HANDLE_REQUEST__ {} {\n", -1);
    } else {
        Tcl_SetStringObj(outbuf, "", -1);
    }
    Tcl_AppendToObj(outbuf, "puts -nonewline \"", -1);

    inbuf = Tcl_NewObj();
    Tcl_IncrRefCount(inbuf);
................................................................................
    if (Rivet_Parser(outbuf, inbuf) == 0)
    {
        Tcl_AppendToObj(outbuf, "\"\n", 2);
    }

    if (toplevel)
    {
        Tcl_AppendToObj(outbuf, "\n}; namespace eval request ::request::__HANDLE_REQUEST__; rename ::request::__HANDLE_REQUEST__ {};", -1);
    }
    Tcl_AppendToObj(outbuf, "\n", -1);

    Tcl_DecrRefCount(inbuf);
    /* END PARSER  */
    return TCL_OK;
}

Changes to packages/tclrivet/tclrivetparser.tcl.

160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#	None.
#
# Results:
#	Returns the parsed script.

proc rivet::parserivetdata { data } {
    variable outputcmd
    set outbuf "namespace eval request {\n"
    append outbuf "$outputcmd \""
    if { [parse $data outbuf] == 0 } {
	append outbuf "\"\n"
    }

    append outbuf "\n}"
    return $outbuf
}

proc rivet::parserivet {file} {

	lappend ::rivet::parsestack $file








|





|







160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#	None.
#
# Results:
#	Returns the parsed script.

proc rivet::parserivetdata { data } {
    variable outputcmd
    set outbuf "namespace eval request {}; proc ::request::__HANDLE_REQUEST__ {} {\n"
    append outbuf "$outputcmd \""
    if { [parse $data outbuf] == 0 } {
	append outbuf "\"\n"
    }

    append outbuf "\n}; namespace eval request ::request::__HANDLE_REQUEST__; rename ::request::__HANDLE_REQUEST__ {};"
    return $outbuf
}

proc rivet::parserivet {file} {

	lappend ::rivet::parsestack $file