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.

83 lines
1.8 KiB

3 years ago
  1. <!doctype html>
  2. <title>CodeMirror: Octave 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="octave.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="#">Octave</a>
  19. </ul>
  20. </div>
  21. <article>
  22. <h2>Octave mode</h2>
  23. <div><textarea id="code" name="code">
  24. %numbers
  25. [1234 1234i 1234j]
  26. [.234 .234j 2.23i]
  27. [23e2 12E1j 123D-4 0x234]
  28. %strings
  29. 'asda''a'
  30. "asda""a"
  31. %identifiers
  32. a + as123 - __asd__
  33. %operators
  34. -
  35. +
  36. =
  37. ==
  38. >
  39. <
  40. >=
  41. <=
  42. &
  43. ~
  44. ...
  45. break zeros default margin round ones rand
  46. ceil floor size clear zeros eye mean std cov
  47. error eval function
  48. abs acos atan asin cos cosh exp log prod sum
  49. log10 max min sign sin sinh sqrt tan reshape
  50. return
  51. case switch
  52. else elseif end if otherwise
  53. do for while
  54. try catch
  55. classdef properties events methods
  56. global persistent
  57. %one line comment
  58. %{ multi
  59. line commment %}
  60. </textarea></div>
  61. <script>
  62. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  63. mode: {name: "octave",
  64. version: 2,
  65. singleLineStringErrors: false},
  66. lineNumbers: true,
  67. indentUnit: 4,
  68. matchBrackets: true
  69. });
  70. </script>
  71. <p><strong>MIME types defined:</strong> <code>text/x-octave</code>.</p>
  72. </article>