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

62 lines
1.4KB

  1. <!doctype html>
  2. <title>CodeMirror: Pascal 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="pascal.js"></script>
  8. <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
  9. <div id=nav>
  10. <a href="https://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="#">Pascal</a>
  19. </ul>
  20. </div>
  21. <article>
  22. <h2>Pascal mode</h2>
  23. <div><textarea id="code" name="code">
  24. (* Example Pascal code *)
  25. while a <> b do writeln('Waiting');
  26. if a > b then
  27. writeln('Condition met')
  28. else
  29. writeln('Condition not met');
  30. for i := 1 to 10 do
  31. writeln('Iteration: ', i:1);
  32. repeat
  33. a := a + 1
  34. until a = 10;
  35. case i of
  36. 0: write('zero');
  37. 1: write('one');
  38. 2: write('two')
  39. end;
  40. </textarea></div>
  41. <script>
  42. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  43. lineNumbers: true,
  44. mode: "text/x-pascal"
  45. });
  46. </script>
  47. <p><strong>MIME types defined:</strong> <code>text/x-pascal</code>.</p>
  48. </article>
上海开阖软件有限公司 沪ICP备12045867号-1