/*---------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/
"use strict";var __extends=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n};define("vs/languages/vsxml/common/vsxml",["require","exports","vs/base/common/objects","vs/base/common/errors","vs/editor/common/modes/abstractState"],function(e,t,n,r,i){var a='<>"=/',o="	 ",s=n.createKeywordMatcher(["summary","reference","returns","param","loc"]),c=n.createKeywordMatcher(["type","path","name","locid","filename","format","optional"]),l=n.createKeywordMatcher(a.split("")),u=function(e){function t(t,n,r){e.call(this,t),this.state=n,this.parentState=r}return __extends(t,e),t.prototype.getParentState=function(){return this.parentState},t.prototype.makeClone=function(){return new t(this.getMode(),i.AbstractState.safeClone(this.state),i.AbstractState.safeClone(this.parentState))},t.prototype.equals=function(n){return n instanceof t?e.prototype.equals.call(this,n)&&i.AbstractState.safeEquals(this.state,n.state)&&i.AbstractState.safeEquals(this.parentState,n.parentState):!1},t.prototype.setState=function(e){this.state=e},t.prototype.postTokenize=function(e){return e},t.prototype.tokenize=function(e){var t=this.state.tokenize(e);return void 0!==t.nextState&&this.setState(t.nextState),t.nextState=this,this.postTokenize(t,e)},t}(i.AbstractState);t.EmbeddedState=u;var d=function(e){function t(t,n,r){e.call(this,t,n,r)}return __extends(t,e),t.prototype.equals=function(n){return n instanceof t?e.prototype.equals.call(this,n):!1},t.prototype.setState=function(t){e.prototype.setState.call(this,t),this.getParentState().setVSXMLState(t)},t.prototype.postTokenize=function(e,t){return t.eos()&&(e.nextState=this.getParentState()),e},t}(u);t.VSXMLEmbeddedState=d;var p=function(e){function t(t,n,r,i){void 0===i&&(i=""),e.call(this,t),this.name=n,this.parent=r,this.whitespaceTokenType=i}return __extends(t,e),t.prototype.equals=function(n){return n instanceof t?e.prototype.equals.call(this,n)&&this.whitespaceTokenType===n.whitespaceTokenType&&this.name===n.name&&i.AbstractState.safeEquals(this.parent,n.parent):!1},t.prototype.tokenize=function(e){return e.setTokenRules(a,o),e.skipWhitespace().length>0?{type:this.whitespaceTokenType}:this.stateTokenize(e)},t.prototype.stateTokenize=function(){throw r.notImplemented()},t}(i.AbstractState);t.VSXMLState=p;var m=function(e){function t(t,n){e.call(this,t,"string",n,"attribute.value.vs")}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode(),this.parent?this.parent.clone():null)},t.prototype.equals=function(n){return n instanceof t?e.prototype.equals.call(this,n):!1},t.prototype.stateTokenize=function(e){for(;!e.eos();){var t=e.nextToken();if('"'===t)return{type:"attribute.value.vs",nextState:this.parent}}return{type:"attribute.value.vs",nextState:this.parent}},t}(p);t.VSXMLString=m;var h=function(e){function t(t,n){e.call(this,t,"expression",n,"vs")}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode(),this.parent?this.parent.clone():null)},t.prototype.equals=function(n){return n instanceof t?e.prototype.equals.call(this,n):!1},t.prototype.stateTokenize=function(e){var t=e.nextToken(),n=this.whitespaceTokenType;return">"===t?{type:"delimiter.vs",nextState:this.parent}:'"'===t?{type:"attribute.value.vs",nextState:new m(this.getMode(),this)}:(s(t)?n="tag.vs":c(t)?n="attribute.name.vs":l(t)&&(n="delimiter.vs"),{type:n,nextState:this})},t}(p);t.VSXMLTag=h;var f=function(e){function t(t,n){e.call(this,t,"expression",n,"vs")}return __extends(t,e),t.prototype.makeClone=function(){return new t(this.getMode(),this.parent?this.parent.clone():null)},t.prototype.equals=function(n){return n instanceof t?e.prototype.equals.call(this,n):!1},t.prototype.stateTokenize=function(e){var t=e.nextToken();return"<"===t?{type:"delimiter.vs",nextState:new h(this.getMode(),this)}:{type:this.whitespaceTokenType,nextState:this}},t}(p);t.VSXMLExpression=f});