/************************************

  "waka" is a Japanese poetry 
         composed of 31 syllables. 

  (c) 2005 Pixel-Apes.

  -----------------------------------

  Special symbols markup:
  
  --      -> &mdash;
  ---     -> <br />
  ----    -> <hr />
  <       -> &lt;
  \n      -> <br />

*************************************/

function wakaSymbols() {}
         wakaSymbols.prototype = new wakaToken();
         wakaSymbols.prototype.constructor = 
         wakaSymbols;

// static
wakaSymbols.prototype.getRegexpPart = function()
{
  return "(-{2}-+)"+
         "|"+
         "(\n)"+
         "|"+
         "(<)"+
         "|"+
         "(\\s--\\s)";
}
                              //    1
wakaSymbols.prototype.isRE  = /^-{3}(-*)$/;
wakaSymbols.prototype.isRE2 = /--/;
wakaSymbols.prototype.is = function( outerText )
{
  var result = { tag : true, text : outerText };

  var matches = this.isRE.exec( outerText );
  if (matches !== null) 
    if (matches[1])
      result.type = "hr noshade=\"noshade\" size=\"1\"";
    else
      result.type = "br";
  else
  if (outerText == "\n")
    result.type = "br";
  else
  if (outerText == "<")
  {
    result.tag  = false;
    result.type = "&lt;"
  }
  else
  {
    result.tag  = false;
    result.type = " &mdash; "
  }
  return result;
}


// private (compilation)
wakaSymbols.prototype._compile   = function()
{
  var result = this._data.type;
  if (this._data.tag)
    result = "<" + result + " />";
  this._html = result;
}



