本站源代码
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.

60 lines
1.3KB

  1. <!doctype html>
  2. <title>CodeMirror: Oz 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="oz.js"></script>
  8. <script src="../../addon/runmode/runmode.js"></script>
  9. <style>
  10. .CodeMirror {border: 1px solid #aaa;}
  11. </style>
  12. <div id=nav>
  13. <a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
  14. <ul>
  15. <li><a href="../../index.html">Home</a>
  16. <li><a href="../../doc/manual.html">Manual</a>
  17. <li><a href="https://github.com/codemirror/codemirror">Code</a>
  18. </ul>
  19. <ul>
  20. <li><a href="../index.html">Language modes</a>
  21. <li><a class=active href="#">Oz</a>
  22. </ul>
  23. </div>
  24. <article>
  25. <h2>Oz mode</h2>
  26. <textarea id="code" name="code">
  27. declare
  28. fun {Ints N Max}
  29. if N == Max then nil
  30. else
  31. {Delay 1000}
  32. N|{Ints N+1 Max}
  33. end
  34. end
  35. fun {Sum S Stream}
  36. case Stream of nil then S
  37. [] H|T then S|{Sum H+S T} end
  38. end
  39. local X Y in
  40. thread X = {Ints 0 1000} end
  41. thread Y = {Sum 0 X} end
  42. {Browse Y}
  43. end
  44. </textarea>
  45. <p>MIME type defined: <code>text/x-oz</code>.</p>
  46. <script>
  47. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  48. lineNumbers: true,
  49. mode: "text/x-oz",
  50. readOnly: false
  51. });
  52. </script>
  53. </article>
上海开阖软件有限公司 沪ICP备12045867号-1