text_javascript.txt 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //test: tokenize 'standard' functions
  2. string.charCodeAt(23); document.getElementById('test'); console.log('Here it is');";
  3. test: /**tokenize doc*/ comment
  4. /**tokenize doc comment with @tag {}*/
  5. //test: tokenize parens
  6. var line = "[{( )}]";
  7. //test tokenize arithmetic expression which looks like a regexp
  8. a/b/c
  9. a/=b/c
  10. //test tokenize reg exps
  11. a=/b/g
  12. a+/b/g
  13. a = 1 + /2 + 1/b
  14. a=/a/ / /a/
  15. case /a/.test(c)
  16. //test tokenize multi-line comment containing a single line comment
  17. noRegex
  18. /* foo // bar */
  19. canBeRegex;
  20. /* foo // bar */
  21. // test tokenize identifier with umlauts
  22. fu?e
  23. // test // is not a regexp
  24. { // 123
  25. //test skipping escaped chars
  26. 'Meh\\nNeh'
  27. console.log('\\u1232Feh'
  28. "test multiline\
  29. strings"
  30. a='
  31. b="\
  32. still a string
  33. function foo(items, nada) {
  34. for (var i=0; i<items.length; i++) {
  35. alert(items[i] + "juhu\n");
  36. } // Real Tab.
  37. }
  38. regexp = /p|p/ // ends here
  39. r = /d{1,2}?f{e}++r*?\d+?[]r[^r-o\f\f[\f]?r{7}+r\{7}+rr--rr$^(?:d|s)(?=a|)(?!y)[]|$?|^*/ o
  40. a=/a/ jk = / / / / /
  41. /************************************/
  42. /** total mess, tricky to highlight**/
  43. function () {
  44. /**
  45. * docComment
  46. **/
  47. r = /u\t*/
  48. g = 1.00E^1, y = 1.2 + .2 + 052 + 0x25
  49. t = ['d', '']
  50. }
  51. function () {
  52. /* eee */
  53. }
  54. "s\
  55. s\u7824sss\u1"
  56. '\
  57. string'
  58. '
  59. string'
  60. "trailing space\
  61. " " /not a regexp/g
  62. /**
  63. *doc
  64. */
  65. a = {
  66. 'a': b,
  67. 'g': function(t)
  68. gta:function(a,b)
  69. }
  70. foo.protoype.d = function(a, b,
  71. c, d)
  72. foo.d =function(a, b)
  73. foo.d =function(a, /*****/ d"string"