// parseJavaScript in parsejavascript.js (there is actually a bit more
// shared code than I'd like), but it is quite a bit simpler.
function parseXML(source) {
// parseJavaScript in parsejavascript.js (there is actually a bit more
// shared code than I'd like), but it is quite a bit simpler.
function parseXML(source) {
var cc = [base];
var tokenNr = 0, indented = 0;
var currentTag = null, context = null;
var cc = [base];
var tokenNr = 0, indented = 0;
var currentTag = null, context = null;
}
function expect(text) {
return function(style, content) {
if (content == text) cont();
}
function expect(text) {
return function(style, content) {
if (content == text) cont();
}
function tagname(style, content) {
if (style == "xml-name") {
currentTag = content.toLowerCase();
}
function tagname(style, content) {
if (style == "xml-name") {
currentTag = content.toLowerCase();
- if (style == "xml-name" && context && content.toLowerCase() == context.name) {
- popContext();
- mark("xml-tagname");
- }
- else {
- mark("xml-error");
+ if (style == "xml-name") {
+ token.style = "xml-tagname";
+ if (context && content.toLowerCase() == context.name) popContext();
+ else markErr();
}
cont();
}
function endtag(startOfLine) {
return function(style, content) {
if (content == "/>" || (content == ">" && UseKludges.autoSelfClosers.hasOwnProperty(currentTag))) cont();
}
cont();
}
function endtag(startOfLine) {
return function(style, content) {
if (content == "/>" || (content == ">" && UseKludges.autoSelfClosers.hasOwnProperty(currentTag))) cont();
- else if (content == ">") pushContext(currentTag, startOfLine) || cont();
- else mark("xml-error") || cont(arguments.callee);
+ else if (content == ">") {pushContext(currentTag, startOfLine); cont();}
+ else {markErr(); cont(arguments.callee);}