index.html 1.1 KB

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