/**
 * Name: r
 * Description: CRAN-R programming language.
 * Author: Thomas Liebig <thomas.liebig@iais.fraunhofer.de>
 */

state r extends HighlightEntry
{
  /* Comments. */
  /#/ {
    comment_face (true);
    language_print ($0);
    call (eat_one_line);
    comment_face (false);
  }

  /* String constants. */
  /\"/ {
    string_face (true);
    language_print ($0);
    call (c_string);
    string_face (false);
  }

  /* Keywords. */
  /\b(break|next|re(turn|peat)|i(n|f)|else|for|requires|while|LETTERS|l(ibrary|etters)|pi|NULL|FALSE|TRUE|NULL|NA)\b/ {
    keyword_face (true);
    language_print ($0);
    keyword_face (false);
  }

  /* Types. */
  /\b(character|rType|array|complex|double|function|integer|list|logical|matrix|numeric|vector|data.frame)\b/ {
    type_face (true);
    language_print ($0);
    type_face (false);
  }

  /* Delimiter. */
  /(,|;|:|\(|\))/ {
    keyword_face (true);
    language_print ($0);
    keyword_face (false);
  }

}


/*
Local variables:
mode: c
End:
*/
