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.

30 lines
1.1 KiB

  1. // CodeMirror, copyright (c) by Marijn Haverbeke and others
  2. // Distributed under an MIT license: http://codemirror.net/LICENSE
  3. (function() {
  4. var mode = CodeMirror.getMode({indentUnit: 4},
  5. {name: "python",
  6. version: 3,
  7. singleLineStringErrors: false});
  8. function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
  9. // Error, because "foobarhello" is neither a known type or property, but
  10. // property was expected (after "and"), and it should be in parentheses.
  11. MT("decoratorStartOfLine",
  12. "[meta @dec]",
  13. "[keyword def] [def function]():",
  14. " [keyword pass]");
  15. MT("decoratorIndented",
  16. "[keyword class] [def Foo]:",
  17. " [meta @dec]",
  18. " [keyword def] [def function]():",
  19. " [keyword pass]");
  20. MT("matmulWithSpace:", "[variable a] [operator @] [variable b]");
  21. MT("matmulWithoutSpace:", "[variable a][operator @][variable b]");
  22. MT("matmulSpaceBefore:", "[variable a] [operator @][variable b]");
  23. MT("fValidStringPrefix", "[string f'this is a {formatted} string']");
  24. MT("uValidStringPrefix", "[string u'this is an unicode string']");
  25. })();