You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.6 KiB

  1. <!doctype html>
  2. <title>CodeMirror: IDL 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="idl.js"></script>
  8. <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</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="#">IDL</a>
  19. </ul>
  20. </div>
  21. <article>
  22. <h2>IDL mode</h2>
  23. <div><textarea id="code" name="code">
  24. ;; Example IDL code
  25. FUNCTION mean_and_stddev,array
  26. ;; This program reads in an array of numbers
  27. ;; and returns a structure containing the
  28. ;; average and standard deviation
  29. ave = 0.0
  30. count = 0.0
  31. for i=0,N_ELEMENTS(array)-1 do begin
  32. ave = ave + array[i]
  33. count = count + 1
  34. endfor
  35. ave = ave/count
  36. std = stddev(array)
  37. return, {average:ave,std:std}
  38. END
  39. </textarea></div>
  40. <script>
  41. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  42. mode: {name: "idl",
  43. version: 1,
  44. singleLineStringErrors: false},
  45. lineNumbers: true,
  46. indentUnit: 4,
  47. matchBrackets: true
  48. });
  49. </script>
  50. <p><strong>MIME types defined:</strong> <code>text/x-idl</code>.</p>
  51. </article>