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.

65 lines
1.6 KiB

2 months ago
  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="../../addon/edit/matchbrackets.js"></script>
  8. <script src="idl.js"></script>
  9. <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
  10. <div id=nav>
  11. <a href="https://codemirror.net/5"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a>
  12. <ul>
  13. <li><a href="../../index.html">Home</a>
  14. <li><a href="../../doc/manual.html">Manual</a>
  15. <li><a href="https://github.com/codemirror/codemirror5">Code</a>
  16. </ul>
  17. <ul>
  18. <li><a href="../index.html">Language modes</a>
  19. <li><a class=active href="#">IDL</a>
  20. </ul>
  21. </div>
  22. <article>
  23. <h2>IDL mode</h2>
  24. <div><textarea id="code" name="code">
  25. ;; Example IDL code
  26. FUNCTION mean_and_stddev,array
  27. ;; This program reads in an array of numbers
  28. ;; and returns a structure containing the
  29. ;; average and standard deviation
  30. ave = 0.0
  31. count = 0.0
  32. for i=0,N_ELEMENTS(array)-1 do begin
  33. ave = ave + array[i]
  34. count = count + 1
  35. endfor
  36. ave = ave/count
  37. std = stddev(array)
  38. return, {average:ave,std:std}
  39. END
  40. </textarea></div>
  41. <script>
  42. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  43. mode: {name: "idl",
  44. version: 1,
  45. singleLineStringErrors: false},
  46. lineNumbers: true,
  47. indentUnit: 4,
  48. matchBrackets: true
  49. });
  50. </script>
  51. <p><strong>MIME types defined:</strong> <code>text/x-idl</code>.</p>
  52. </article>