index.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!doctype html>
  2. <title>CodeMirror: Pig Latin mode</title>
  3. <meta charset="utf-8"/>
  4. <link rel=stylesheet href="../../doc/docs.css">
  5. <link rel="stylesheet" href="../../lib/codemirror.css">
  6. <script src="../../lib/codemirror.js"></script>
  7. <script src="pig.js"></script>
  8. <style>.CodeMirror {border: 2px inset #dee;}</style>
  9. <div id=nav>
  10. <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
  11. <ul>
  12. <li><a href="../../index.html">Home</a>
  13. <li><a href="../../doc/manual.html">Manual</a>
  14. <li><a href="https://github.com/codemirror/codemirror">Code</a>
  15. </ul>
  16. <ul>
  17. <li><a href="../index.html">Language modes</a>
  18. <li><a class=active href="#">Pig Latin</a>
  19. </ul>
  20. </div>
  21. <article>
  22. <h2>Pig Latin mode</h2>
  23. <form><textarea id="code" name="code">
  24. -- Apache Pig (Pig Latin Language) Demo
  25. /*
  26. This is a multiline comment.
  27. */
  28. a = LOAD "\path\to\input" USING PigStorage('\t') AS (x:long, y:chararray, z:bytearray);
  29. b = GROUP a BY (x,y,3+4);
  30. c = FOREACH b GENERATE flatten(group) as (x,y), SUM(group.$2) as z;
  31. STORE c INTO "\path\to\output";
  32. --
  33. </textarea></form>
  34. <script>
  35. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  36. lineNumbers: true,
  37. indentUnit: 4,
  38. mode: "text/x-pig"
  39. });
  40. </script>
  41. <p>
  42. Simple mode that handles Pig Latin language.
  43. </p>
  44. <p><strong>MIME type defined:</strong> <code>text/x-pig</code>
  45. (PIG code)
  46. </html>
  47. </article>