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