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.

84 lines
1.8 KiB

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