#include "CWcode.cwp"
#implicitCopy(composeHTMLLikeString)
function removeLayout(sText) {
return translateString({
#implicitCopy
remove ::=
[
->[
#explicitCopy
'[' ->(:sText)']'
=> if sText == "line/" {@; @}
]
]*
->#empty
;
}, project, sText);
}
function incrementSection(sNumber : value) {
local iIndex = $sNumber.findLastString('.') + 1$;
return sNumber.leftString(iIndex) + $sNumber.subString(iIndex) + 1$;
}
function formatCode(sCode : value) {
return translateString({
#implicitCopy
text_code ::=
[
['\r']? '\n' => {@<br/>@}
|
#explicitCopy ' ' => {@ @}
|
#explicitCopy '\t'
=> {
local iPosition = $countInputCols() - 1$;
do {
@ @
increment(iPosition);
} while $(iPosition % 4) != 0$;
}
|
#readChar
]*
;
}, project, sCode);
}
function highlightScript<"">(sScript : value) {
return formatCode(composeHTMLLikeString(sScript));
}
function highlightCWScript(script : node, sScript : value) {
insert script.embeddedScript = true;
return translateString("CWScript2HTML.cwp", script, sScript);
}
function highlightScript<"CodeWorker">(sScript : value) {
local script;
return highlightCWScript(script, sScript);
}
function highlightScript<"CodeWorker.cws">(sScript : value) {
local script = "procedural";
return highlightCWScript(script, sScript);
}
function highlightScript<"CodeWorker.cwt">(sScript : value) {
local script = "template-based";
return highlightCWScript(script, sScript);
}
function highlightScript<"CodeWorker.cwp">(sScript : value) {
local script = "extended-BNF";
return highlightCWScript(script, sScript);
}
function keyword<"C">(sId : value) {
return sId in {"auto", "register", "static", "extern", "typedef", "void", "char", "short", "int", "long", "float",
"double", "signed", "unsigned", "struct", "union", "const", "volatile", "sizeof", "enum", "case",
"default", "switch", "if", "else", "while", "do", "for", "goto", "continue", "break", "return"};
}
function keyword<"C++">(sId : value) {
return keyword<"C">(sId) || sId in {"virtual", "class", "public", "protected", "private", "throw", "template", "try", "catch"};
}
function keyword<"Java">(sId : value) {
return sId in {"package", "import", "class", "interface", "public", "protected", "private", "abstract", "static", "void", "byte",
"extends", "implements", "char", "short", "int", "long", "float", "double", "case", "default", "switch", "if",
"else", "while", "do", "for", "goto", "continue", "break", "return", "throw", "throws", "try", "catch", "finally", "final"};
}
function keyword<"IDL">(sId : value) {
return sId in {"abstract", "any", "attribute", "boolean", "case", "char", "component", "const", "consults",
"context", "custom", "default", "double", "emits", "enum", "eventtype", "exception", "factory",
"FALSE", "finder", "fixed", "float", "getraises", "home", "import", "in", "inout", "interface",
"local", "long", "manages", "module", "multiple", "native", "Object", "octet", "oneway", "out",
"primarykey", "private", "provides", "public", "publishes", "raises", "readonly", "sequence",
"setraises", "short", "string", "struct", "supports", "switch", "TRUE", "truncatable", "typedef",
"typeid", "typeprefix", "union", "unsigned", "uses", "ValueBase", "valuetype", "wchar", "wstring"};
}
function highlightScript<"XML">(sScript : value) {
return translateString({
#implicitCopy(composeHTMLLikeString)
xml2HTML ::=
[
->[
=> local iPosition = getOutputLocation();
[
'<'
#ignore(blanks)
tag
[attribute]*
['/']?
'>'
=> {
insertText(iPosition, "<span class=\"xml_balise\">");
@</span>@
}
|
'<' '/'
#ignore(blanks)
tag
'>'
=> {
insertText(iPosition, "<span class=\"xml_balise\">");
@</span>@
}
|
"<!--" [whitespace | ~"-->"]* "-->"
=> {
insertText(iPosition, "<span class=\"xml_comment\">");
@</span>@
}
|
whitespace
]
]
]*
;
tag ::=
=> local iPosition = getOutputLocation();
#readIdentifier #!ignore ['.' | ':' | #readIdentifier]*
=> {
insertText(iPosition, "<span class=\"php_type\">");
@</span>@
}
;
attribute ::= tag ['=' #continue #skipIgnore(blanks) value]?;
value ::=
=> local iPosition = getOutputLocation();
[
'"' ->'"'
|
"'" ->"'"
|
[~['>' | whitespace]]*
]
=> {
insertText(iPosition, "<span class=\"php_ch\">");
@</span>@
}
;
whitespace ::=
['\r']? '\n' => {@<br/>@}
|
#explicitCopy ' ' => {@ @}
|
#explicitCopy '\t'
=> {
local iPosition = $countInputCols() - 1$;
do {
@ @
increment(iPosition);
} while $(iPosition % 4) != 0$;
}
;
}, project, sScript);
}
function highlightScript<"HTML">(sScript : value) {
return highlightScript<"XML">(sScript);
}
function highlightScript<T>(sScript : value) {
return translateString({
#implicitCopy(composeHTMLLikeString)
cpp2HTML ::=
[
=> local iPosition = getOutputLocation();
[
'#'
#readIdentifier
=> {
insertText(iPosition, "<span class=\"cpp_define\">");
@</span>@
}
|
#readIdentifier:sId
[
#check(keyword<this>(sId))
=> {
insertText(iPosition, "<span class=\"csharp_type\">");
@</span>@
}
]?
|
#readCString
=> {
insertText(iPosition, "<span class=\"csharp_ch\">");
@</span>@
}
|
#readCChar
|
"//" [~[['\r']? '\n']]*
=> {
insertText(iPosition, "<span class=\"cpp_comment\">");
@</span>@
}
|
"/*" [whitespace | ~"*/"]* "*/"
=> {
insertText(iPosition, "<span class=\"cpp_comment\">");
@</span>@
}
|
whitespace
|
#readChar
]
]*
;
whitespace ::=
['\r']? '\n' => {@<br/>@}
|
#explicitCopy ' ' => {@ @}
|
#explicitCopy '\t'
=> {
local iPosition = $countInputCols() - 1$;
do {
@ @
increment(iPosition);
} while $(iPosition % 4) != 0$;
}
;
}, T, sScript);
}
function normalizeFilename(sFilename : value) {
return translateString({
#implicitCopy
normalize ::=
[
->[
#explicitCopy
'$'
#readIdentifier:sVar
=> {@@getEnv(sVar)@@}
]
]*
->#empty
;
}, project, sFilename);
}
function preexecuteOptions(options : node) {
foreach i in options {
if i.key() == "reference" {
@<a name="@i@"></a>@
}
}
}
function postexecuteOption(name : value, option : node) {
if name == "reference" return true;
return false;
}
#overload mainCWcode ::=
=> {
@<html>
<head>
<title>@newFloatingLocation("title");@</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="generator" content="developpez-com" />
<meta name="description" content=@newFloatingLocation("description");@ />
<meta name="keywords" content=@newFloatingLocation("keywords");@ />
<link rel="stylesheet" type="text/css" href="http://www.developpez.com/mainstyle2.css" />
<link rel="stylesheet" type="text/css" media="print" href="http://www.developpez.com/template/printer.css" />
<link rel="stylesheet" type="text/css" media="screen" href="./article.css">
<link rel="stylesheet" type="text/css" href="./CodeWorker.css">
</head>
<body>
<table cellspacing="1" width="100%" class="tbnoir"><tr><td class="fondart"><table class="cadrearticle" width="90%" cellpadding="10" cellspacing="0">
<tr>
<td>
@
}
#super::mainCWcode
=> {
if existFloatingLocation("TOC", false) insertText(getFloatingLocation("TOC"), "<p/><br/>");
@ </td>
</tr>
</table></td></tr></table>
@
if this.docinfo.author {
local iYear = formatDate(getNow(), "%Y");
if this.docinfo.creation && this.docinfo.creation.formatDate("%Y") != iYear {
iYear = this.docinfo.creation.formatDate("%Y") + '-' + iYear;
}
@<br><table class="noteBasPage"></table><hr><div class="licence">
© @iYear@ @composeHTMLLikeString(this.docinfo.author)@ - Tous droits réservés : @composeHTMLLikeString(this.docinfo.author)@. Toute reproduction,
utilisation ou diffusion de ce document par quelque moyen que ce soit autre que pour
un usage personnel doit faire l'objet d'une autorisation écrite préalable de la part
de : @composeHTMLLikeString(this.docinfo.author)@ , le propriétaire des droits intellectuels.
</div>
@
}
@ </body>
</html>
@
}
;
#overload EOL ::=
['.' | ':' | '!' | '?']
['\r']? '\n'
[
#explicitCopy [['\r']? '\n']+
=> {@<p/>@}
|
=> {@<br/>@}
]
|
['\r']? '\n'
[
#explicitCopy [['\r']? '\n']+
=> {@<p/>@}
]?
;
#overload readCode<T> ::=
'[' #readIdentifier:sCode
#check(!T || (sCode == T))
=> local options = $getOutputLocation() - sCode.length() - 1$;
[
=> local sValue;
[
'='
readValue:sValue
=> insert options[sCode] = sValue;
]?
[
','
#readIdentifier:sKey
'='
readValue:sValue
=> insert options[sKey] = sValue;
]*
]?
[
"/]"
CWcode<sCode + '/'>(options)
|
']'
CWcode<sCode>(options)
]
;
#overload endCode<T> ::= #explicitCopy "[/" #readText(T) ']';
#overload CWcode<"title">(options : node) ::=
#continue
removeCodeBegin(options)
=>{@<h1>@}
text:sText
=>{@</h1>@}
=> insertText(getFloatingLocation("title"), removeLayout(sText));
endCode<"title">
;
#overload CWcode<"docinfo/">(options : node) ::=
removeCodeBegin(options)
=> {
foreach i in options {
switch(i.key()) {
case "author":
insert this.docinfo.author = i;
break;
case "creation":
insert this.docinfo.creation = i;
break;
case "profileId":
insert this.docinfo.author.profileId = i;
break;
case "profileName":
insert this.docinfo.author.profileName = i;
break;
case "keywords":
insert this.docinfo.keywords = i;
break;
}
}
if this.docinfo.creation {
@<p class="dateArticle">Date de publication : @this.docinfo.creation.formatDate("%d/%m/%Y")@</p>
@
}
@<p class="dateArticle">Date de mise a jour : @formatDate(getNow(), "%d/%m/%Y")@</p>
@
if this.docinfo.author {
@<p align="center">Par @
if this.docinfo.author.profileId {
@<a class="auteur" href="http://www.developpez.net/forums/profile.php?mode=viewprofile&u=@this.docinfo.author.profileId@">@
if this.docinfo.author.profileName {
@@this.docinfo.author.profileName@@
} else {
@@this.docinfo.author@@
}
@</a>@
} else {
@@this.docinfo.author@@
}
@<br> </p>
@
}
if this.docinfo.keywords {
insertTextToFloatingLocation("keywords", "\"" + this.docinfo.keywords + "\"");
}
}
;
#overload CWcode<"synopsis">(options : node) ::=
removeCodeBegin(options)
=> {@<p class="synopsis">@}
#super::CWcode<"synopsis">(options):sText
=> sText = removeLayout(sText);
=> sText = sText.replaceString('\r', "");
=> sText = sText.replaceString('\n', " ");
=> insertTextToFloatingLocation("description", "\"" + sText + "\"");
=> {@</p>@}
;
#overload CWcode<"introduction">(options : node) ::=
#continue
removeCodeBegin(options)
=> local sAnchor = 'L' + this.toc.size();
=> local sNumber;
=> {
if $!existFloatingLocation("TOC", false)$ {
newFloatingLocation("TOC");
}
if options["introduction"] {
sAnchor = options["introduction"];
}
@<div class="TitreSection0"><a name="@sAnchor@"></a>@
}
text:sText
=> {
sText = sText.removeLayout();
insertText(getFloatingLocation("TOC"), "<br/><a class=\"summaryIndent0\" href=\"#" + sAnchor + "\">" + sText + "</a>");
@</div>@
insert this.toc[sText];
}
endCode<"introduction">
;
#overload CWcode<"chapter">(options : node) ::=
#continue
removeCodeBegin(options)
=> local sAnchor = 'L' + this.toc.size();
=> local sNumber;
=> {
if !this.toc.empty() && this.toc#back sNumber = $this.toc#back + 1$;
else sNumber = 1;
if $!existFloatingLocation("TOC", false)$ {
newFloatingLocation("TOC");
}
if options["chapter"] {
sAnchor = options["chapter"];
}
@<div class="TitreSection0"><a name="@sAnchor@"></a>@sNumber@ @
}
text:sText
=> {
sText = sText.removeLayout();
@</div>@
insertText(getFloatingLocation("TOC"), "<br/><a class=\"summaryIndent0\" href=\"#" + sAnchor + "\">" + sNumber + ' ' + sText + "</a>");
insert this.toc[sText] = sNumber;
}
endCode<"chapter">
;
#overload CWcode<"section">(options : node) ::=
#continue
removeCodeBegin(options)
=> local sAnchor = 'L' + this.toc.size() + '_' + this.toc#back.size();
=> local sNumber;
=> {
if this.toc.empty() error("cannot find a section outside of a chapter");
if this.toc#back.empty() sNumber = this.toc#back + ".1";
else {
sNumber = incrementSection(this.toc#back#back);
}
if options["section"] {
@<a name="@options["section"]@"></a>@
}
if options["section"] {
sAnchor = options["section"];
}
@<div class="TitreSection1"><a name="@sAnchor@"></a>@sNumber@ @
}
text:sText
=> {
sText = sText.removeLayout();
@</div>@
insertText(getFloatingLocation("TOC"), "<br/><a class=\"summaryIndent1\" href=\"#" + sAnchor + "\">" + sNumber + ' ' + sText + "</a>");
insert this.toc#back[sText] = sNumber;
}
endCode<"section">
;
#overload CWcode<"subsection">(options : node) ::=
#continue
removeCodeBegin(options)
=> local sAnchor = 'L' + this.toc.size() + '_' + this.toc#back.size() + '_' + this.toc#back#back.size();
=> local sNumber;
=> {
if this.toc.empty() || this.toc#back.empty() error("cannot find a subsection outside of a section");
if this.toc#back#back.empty() sNumber = this.toc#back#back + ".1";
else {
sNumber = incrementSection(this.toc#back#back#back);
}
if options["subsection"] {
sAnchor = options["subsection"];
}
@<div class="TitreSection2"><a name="@sAnchor@"></a>@sNumber@ @
}
text:sText
=> {
sText = sText.removeLayout();
@</div>@
insertText(getFloatingLocation("TOC"), "<br/><a class=\"summaryIndent2\" href=\"#" + sAnchor + "\">" + sNumber + ' ' + sText + "</a>");
insert this.toc#back#back[sText] = sNumber;
}
endCode<"subsection">
;
#overload CWcode<"subsubsection">(options : node) ::=
#continue
removeCodeBegin(options)
=> local sAnchor = 'L' + this.toc.size() + '_' + this.toc#back.size() + '_' + this.toc#back#back.size() + '_' + this.toc#back#back#back.size();
=> local sNumber;
=> {
if this.toc.empty() || this.toc#back.empty() || this.toc#back#back.empty() error("cannot find a subsubsection outside of a subsection");
if this.toc#back#back#back.empty() sNumber = this.toc#back#back#back + ".1";
else {
sNumber = incrementSection(this.toc#back#back#back#back);
}
if options["subsubsection"] {
sAnchor = options["subsubsection"];
}
@<div class="TitreSection3"><a name="@sAnchor@"></a>@sNumber@ @
}
text:sText
=> {
sText = sText.removeLayout();
@</div>@
insertText(getFloatingLocation("TOC"), "<br/><a class=\"summaryIndent3\" href=\"#" + sAnchor + "\">" + sNumber + ' ' + sText + "</a>");
insert this.toc#back#back#back[sText] = sNumber;
}
endCode<"subsubsection">
;
#overload CWcode<"i">(options : node) ::= removeCodeBegin(options) => {@<i>@} #super::CWcode<"i">(options) => {@</i>@};
#overload CWcode<"b">(options : node) ::= removeCodeBegin(options) => {@<b>@} #super::CWcode<"b">(options) => {@</b>@};
#overload CWcode<"a">(options : node) ::= removeCodeBegin(options) => {@<b><i>@} #super::CWcode<"a">(options) => {@</i></b>@};
#overload CWcode<"keyword">(options : node) ::=
#continue
removeCodeBegin(options)
CWcodeKeyword<options["keyword"]>
endCode<"keyword">;
CWcodeKeyword<""> ::= #continue => {@<kbd>@} text_code => {@</kbd>@};
CWcodeKeyword<"CodeWorker"> ::=
#continue
=> local iPosition;
=> {
@<kbd><a href="manual_The_scripting_language.html#@
iPosition = getOutputLocation();
@" class="procedure">@
}
text_code:sKeyword
=> {
sKeyword = sKeyword.replaceString('#', '_');
insertText(iPosition, sKeyword);
@</a></kbd>@
}
;
#overload CWcode<"list">(options : node) ::=
#continue
removeCodeBegin(options)
=> {@<ul>@}
#skipIgnore(blanks)
[
[#explicitCopy "[*]"]
=> {@<li>@} text => {@</li>@}
]*
#skipIgnore(blanks)
=> {@</ul>@}
endCode<"list">
;
#overload CWcode<"frame">(options : node) ::=
#continue
removeCodeBegin(options)
=> {
preexecuteOptions(options);
@<table class="tableau" cellspacing="0" border="1" align="center">
@
if options["frame"] {
@<tr class="entete"><td class="colonne_entete">@options["frame"].composeHTMLLikeString()@</td></tr>@
}
@<tr><td class="colonne">@
}
text
#skipIgnore(blanks)
=> {
@</td></tr></table>
@
}
endCode<"frame">
;
#overload CWcode<"rationale">(options : node) ::=
#continue
removeCodeBegin(options)
=> {
preexecuteOptions(options);
@<table class="tableau" cellspacing="0" border="2" align="center">
@
if options["rationale"] {
@<tr class="entete"><td class="colonne_entete">@options["rationale"].composeHTMLLikeString()@</td></tr>@
}
@<tr class="entete"><td class="colonne_entete"> </td></tr><tr><td class="colonne">@
}
text
#skipIgnore(blanks)
=> {
@<tr class="entete"><td class="colonne_entete"> </td></tr></td></tr></table>
@
}
endCode<"rationale">
;
#overload CWcode<"table">(options : node) ::=
#continue
removeCodeBegin(options)
=> {
preexecuteOptions(options);
@<table class="tableau" cellspacing="0" border="1" align="center">@
}
#skipIgnore(blanks)
readCode<"header">
[
#skipIgnore(blanks)
readCode<"row">
]*
#skipIgnore(blanks)
=> {@</table>@}
endCode<"table">
;
#overload CWcode<"header">(options : node) ::=
#continue
removeCodeBegin(options)
=> local oldTableCell = this.table_cell;
=> {
@<tr class="entete">@
insert this.table_cell = "header";
}
[#skipIgnore(blanks) readCode<"cell">]*
=> {
lass = "constant" href="manual_The_scripting_language.html#this">this.table_cell = oldTableCell;
@</tr>@
}
endCode<"header">
;
#overload CWcode<"row">(options : node) ::=
#continue
removeCodeBegin(options)
=> {@<tr>@}
[#skipIgnore(blanks) readCode<"cell">]*
=> {@</tr>@}
endCode<"row">
;
#overload CWcode<"cell">(options : node) ::=
#continue
removeCodeBegin(options)
=> if this.table_cell == "header" {
@<td class="colonne_entete"@
if options["cell"] {
@ colspan="@options["cell"]@"@
}
@>@
} else {
@<td class="colonne">@
}
text
=> {@</td>@}
endCode<"cell">
;
#overload CWcode<"url">(options : node) ::=
removeCodeBegin(options)
=> local iLocation;
=> {
@<a href="@
if options["url"] {
@@options["url"]@@
} else {
iLocation = getOutputLocation();
}
@">@
}
#super::CWcode<"url">(options):sText
=> {
if iLocation insertText(iLocation, removeLayout(sText));
@</a>@
}
;
#overload CWcode<"reference">(options : node) ::=
#continue
removeCodeBegin(options)
=> if !options["reference"] error("'[reference]' expects a link to the reference ('[reference=<link>]')!");
=> {@<a href="#@options["reference"]@">@}
text
=> {@</a>@}
endCode<"reference">
;
#overload CWcode<"image/">(options : node) ::=
removeCodeBegin(options)
=> {
if !options["image"] error("filename of the picture expected");
@<img src="@options["image"]@"@
if options["tooltip"] {
@ alt="@options["tooltip"]@"@
}
if options["height"] {
@ height="@options["height"]@"@
}
if options["width"] {
@ width="@options["width"]@"@
}
@ class="image"/>@
}
;
#overload CWcode<"line/">(options : node) ::= removeCodeBegin(options) => {@<br/>@};
function preexecuteCodeOptions<"">(options : node) {
preexecuteOptions(options);
local iLocation = getOutputLocation();
if options["title"] {
@<div class="titre_code">@options["title"]@</div>@
iLocation = getOutputLocation();
}
if options["save"] {
@<div class="titre_code">@options["save"]@</div>@
iLocation = getOutputLocation();
}
if options["command"] {
@<div class="code">@options["command"]@</div>@
iLocation = getOutputLocation();
}
if options["load"] {
@<div class="titre_code">@options["load"]@</div>@
iLocation = getOutputLocation();
if !options["command"] {
local sScript = loadFile(options["load"].normalizeFilename());
if options["script"] {
executeString(sScript, options["script"]);
}
sScript = formatCode(composeHTMLLikeString(sScript));
if options["post"] {
executeString(sScript, options["post"]);
}
@@sScript@@
}
}
return iLocation;
}
function preexecuteCodeOptions<T>(options : node) {
preexecuteOptions(options);
local iLocation = getOutputLocation();
if options["title"] {
@<div class="titre_code">@options["title"]@</div>@
iLocation = getOutputLocation();
}
if options["save"] {
@<div class="titre_code">@options["save"]@</div>@
iLocation = getOutputLocation();
}
if options["command"] {
@<div class="code">@options["command"]@</div>@
iLocation = getOutputLocation();
}
if options["load"] {
@<div class="titre_code">@options["load"]@</div>@
iLocation = getOutputLocation();
if !options["command"] {
local sScript = loadFile(options["load"].normalizeFilename());
if options["script"] {
executeString(sScript, options["script"]);
}
sScript = highlightScript<T>(sScript);
if options["post"] {
executeString(sScript, options["post"]);
}
@@sScript@@
}
}
return iLocation;
}
function postexecuteCodeOptions<"">(options : node, sScript : node) {
foreach i in options {
switch(i.key()) {
case "title":
case "load":
case "code":
case "post":
break;
case "script":
if !options["load"] || !options["command"] {
executeString(sScript, i);
}
break;
case "save":
saveToFile(normalizeFilename(i), sScript);
break;
case "command":
system(normalizeFilename(i));
if options["load"] {
local sScript = loadFile(options["load"].normalizeFilename());
if options["script"] {
executeString(sScript, options["script"]);
}
sScript = formatCode(composeHTMLLikeString(sScript));
if options["post"] {
executeString(sScript, options["post"]);
}
@@sScript@@
}
break;
default:
if !postexecuteOption(i.key(), i) error("in switch statement: unhandled case \"" + i.key() + "\"");
}
}
}
function postexecuteCodeOptions<T>(options : node, sScript : node) {
foreach i in options {
switch(i.key()) {
case "title":
case "load":
case "code":
case "post":
break;
case "script":
if !options["load"] || !options["command"] {
executeString(sScript, i);
}
break;
case "save":
saveToFile(normalizeFilename(i), sScript);
break;
case "command":
system(normalizeFilename(i));
if options["load"] {
local sScript = loadFile(options["load"].normalizeFilename());
if options["script"] {
executeString(sScript, options["script"]);
}
sScript = highlightScript<T>(sScript);
if options["post"] {
executeString(sScript, options["post"]);
}
@@sScript@@
}
break;
default:
if !postexecuteOption(i.key(), i) error("in switch statement: unhandled case \"" + i.key() + "\"");
}
}
}
#overload CWcode<"code">(options : node) ::=
#continue
removeCodeBegin(options)
CWcodeCode<options["code"]>(options)
;
CWcodeCode<T>(options : node) ::=
#continue
=> local iLocation;
=> {
@<kbd>@
iLocation = preexecuteCodeOptions<T>(options);
}
#explicitCopy
#skipIgnore(blanks)
=> local sScript;
[
#check(T)
#continue
->(:sScript)"[/code]"
|
#continue
[
#implicitCopy
text_code:sScript
]
"[/code]"
]
=> {
postexecuteCodeOptions<T>(options, sScript);
if T {
sScript = highlightScript<T>(sScript);
if options["post"] {
executeString(sScript, options["post"]);
}
@@sScript@@
}
if $sScript.findString('\n') >= 0$ || options["load"] {
insertText(iLocation, "<div class=\"code\">");
@</div>@
}
@</kbd>@
}
;
text_code ::=
[
!!["[/" #readIdentifier ']' | "[*]"] #break
|
readCode<"">
|
whitespace
|
#readChar
]*
;
whitespace ::=
['\r']? '\n' => {@<br/>@}
|
#explicitCopy ' ' => {@ @}
|
#explicitCopy '\t'
=> {
local iPosition = $countInputCols() - 1$;
do {
@ @
increment(iPosition);
} while $(iPosition % 4) != 0$;
}
;
removeCodeBegin(iLocation : value) ::= => setOutputLocation(iLocation); ;
Generated by CodeWorker v3.8.1 from CWscript2HTML.cwp.