@speed-highlight/core 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/.gitattributes +2 -0
  2. package/CODE_OF_CONDUCT.md +128 -0
  3. package/CONTRIBUTING.md +34 -0
  4. package/LICENSE +121 -0
  5. package/README.md +140 -0
  6. package/assets/screenshot.png +0 -0
  7. package/dist/common.js +1 -0
  8. package/dist/detect.js +1 -0
  9. package/dist/index.js +3 -0
  10. package/dist/languages/asm.js +1 -0
  11. package/dist/languages/bash.js +1 -0
  12. package/dist/languages/bf.js +1 -0
  13. package/dist/languages/c.js +1 -0
  14. package/dist/languages/css.js +1 -0
  15. package/dist/languages/csv.js +1 -0
  16. package/dist/languages/diff.js +1 -0
  17. package/dist/languages/docker.js +1 -0
  18. package/dist/languages/git.js +1 -0
  19. package/dist/languages/go.js +1 -0
  20. package/dist/languages/html.js +1 -0
  21. package/dist/languages/http.js +1 -0
  22. package/dist/languages/ini.js +1 -0
  23. package/dist/languages/java.js +1 -0
  24. package/dist/languages/js.js +1 -0
  25. package/dist/languages/js_template_literals.js +1 -0
  26. package/dist/languages/jsdoc.js +1 -0
  27. package/dist/languages/json.js +1 -0
  28. package/dist/languages/leanpub-md.js +2 -0
  29. package/dist/languages/log.js +1 -0
  30. package/dist/languages/lua.js +1 -0
  31. package/dist/languages/make.js +1 -0
  32. package/dist/languages/md.js +2 -0
  33. package/dist/languages/pl.js +1 -0
  34. package/dist/languages/plain.js +1 -0
  35. package/dist/languages/py.js +1 -0
  36. package/dist/languages/regex.js +1 -0
  37. package/dist/languages/rs.js +1 -0
  38. package/dist/languages/sql.js +1 -0
  39. package/dist/languages/todo.js +1 -0
  40. package/dist/languages/toml.js +1 -0
  41. package/dist/languages/ts.js +1 -0
  42. package/dist/languages/uri.js +1 -0
  43. package/dist/languages/xml.js +1 -0
  44. package/dist/languages/yaml.js +1 -0
  45. package/dist/node/common.js +1 -0
  46. package/dist/node/detect.js +1 -0
  47. package/dist/node/index.js +3 -0
  48. package/dist/node/languages/asm.js +1 -0
  49. package/dist/node/languages/bash.js +1 -0
  50. package/dist/node/languages/bf.js +1 -0
  51. package/dist/node/languages/c.js +1 -0
  52. package/dist/node/languages/css.js +1 -0
  53. package/dist/node/languages/csv.js +1 -0
  54. package/dist/node/languages/diff.js +1 -0
  55. package/dist/node/languages/docker.js +1 -0
  56. package/dist/node/languages/git.js +1 -0
  57. package/dist/node/languages/go.js +1 -0
  58. package/dist/node/languages/html.js +1 -0
  59. package/dist/node/languages/http.js +1 -0
  60. package/dist/node/languages/ini.js +1 -0
  61. package/dist/node/languages/java.js +1 -0
  62. package/dist/node/languages/js.js +1 -0
  63. package/dist/node/languages/js_template_literals.js +1 -0
  64. package/dist/node/languages/jsdoc.js +1 -0
  65. package/dist/node/languages/json.js +1 -0
  66. package/dist/node/languages/leanpub-md.js +2 -0
  67. package/dist/node/languages/log.js +1 -0
  68. package/dist/node/languages/lua.js +1 -0
  69. package/dist/node/languages/make.js +1 -0
  70. package/dist/node/languages/md.js +2 -0
  71. package/dist/node/languages/pl.js +1 -0
  72. package/dist/node/languages/plain.js +1 -0
  73. package/dist/node/languages/py.js +1 -0
  74. package/dist/node/languages/regex.js +1 -0
  75. package/dist/node/languages/rs.js +1 -0
  76. package/dist/node/languages/sql.js +1 -0
  77. package/dist/node/languages/todo.js +1 -0
  78. package/dist/node/languages/toml.js +1 -0
  79. package/dist/node/languages/ts.js +1 -0
  80. package/dist/node/languages/uri.js +1 -0
  81. package/dist/node/languages/xml.js +1 -0
  82. package/dist/node/languages/yaml.js +1 -0
  83. package/dist/node/term.js +1 -0
  84. package/dist/node/themes/default.js +1 -0
  85. package/dist/term.js +1 -0
  86. package/dist/themes/atom-dark.css +1 -0
  87. package/dist/themes/dark.css +1 -0
  88. package/dist/themes/default.css +1 -0
  89. package/dist/themes/default.js +1 -0
  90. package/dist/themes/github-dark.css +1 -0
  91. package/dist/themes/github-dim.css +1 -0
  92. package/dist/themes/github-light.css +1 -0
  93. package/dist/themes/visual-studio-dark.css +1 -0
  94. package/examples/deno.js +14 -0
  95. package/examples/dist.html +27 -0
  96. package/examples/helper/data.js +51 -0
  97. package/examples/helper/elm.js +58 -0
  98. package/examples/index.html +52 -0
  99. package/examples/languages/oneline.bash +1 -0
  100. package/examples/languages/oneline.http +1 -0
  101. package/examples/languages/screenshot.js +18 -0
  102. package/examples/languages/test.asm +17 -0
  103. package/examples/languages/test.bash +32 -0
  104. package/examples/languages/test.bf +21 -0
  105. package/examples/languages/test.c +57 -0
  106. package/examples/languages/test.css +20 -0
  107. package/examples/languages/test.csv +4 -0
  108. package/examples/languages/test.diff +27 -0
  109. package/examples/languages/test.docker +23 -0
  110. package/examples/languages/test.git +10 -0
  111. package/examples/languages/test.go +21 -0
  112. package/examples/languages/test.html +27 -0
  113. package/examples/languages/test.http +17 -0
  114. package/examples/languages/test.ini +6 -0
  115. package/examples/languages/test.java +52 -0
  116. package/examples/languages/test.js +34 -0
  117. package/examples/languages/test.jsdoc +2 -0
  118. package/examples/languages/test.json +24 -0
  119. package/examples/languages/test.leanpub-md +21 -0
  120. package/examples/languages/test.log +32 -0
  121. package/examples/languages/test.lua +62 -0
  122. package/examples/languages/test.make +51 -0
  123. package/examples/languages/test.md +62 -0
  124. package/examples/languages/test.pl +25 -0
  125. package/examples/languages/test.plain +3 -0
  126. package/examples/languages/test.py +38 -0
  127. package/examples/languages/test.regex +2 -0
  128. package/examples/languages/test.rs +38 -0
  129. package/examples/languages/test.sql +6 -0
  130. package/examples/languages/test.todo +18 -0
  131. package/examples/languages/test.toml +16 -0
  132. package/examples/languages/test.ts +43 -0
  133. package/examples/languages/test.uri +9 -0
  134. package/examples/languages/test.xml +44 -0
  135. package/examples/languages/test.yaml +18 -0
  136. package/examples/node.js +11 -0
  137. package/examples/style.css +28 -0
  138. package/examples/worker.html +19 -0
  139. package/examples/worker.js +6 -0
  140. package/package.json +40 -0
  141. package/src/common.js +18 -0
  142. package/src/detect.js +33 -0
  143. package/src/index.js +129 -0
  144. package/src/languages/asm.js +30 -0
  145. package/src/languages/bash.js +44 -0
  146. package/src/languages/bf.js +18 -0
  147. package/src/languages/c.js +52 -0
  148. package/src/languages/css.js +56 -0
  149. package/src/languages/csv.js +9 -0
  150. package/src/languages/diff.js +18 -0
  151. package/src/languages/docker.js +9 -0
  152. package/src/languages/git.js +20 -0
  153. package/src/languages/go.js +28 -0
  154. package/src/languages/html.js +51 -0
  155. package/src/languages/http.js +30 -0
  156. package/src/languages/ini.js +22 -0
  157. package/src/languages/java.js +28 -0
  158. package/src/languages/js.js +48 -0
  159. package/src/languages/js_template_literals.js +34 -0
  160. package/src/languages/jsdoc.js +18 -0
  161. package/src/languages/json.js +20 -0
  162. package/src/languages/leanpub-md.js +34 -0
  163. package/src/languages/log.js +28 -0
  164. package/src/languages/lua.js +28 -0
  165. package/src/languages/make.js +36 -0
  166. package/src/languages/md.js +48 -0
  167. package/src/languages/pl.js +25 -0
  168. package/src/languages/plain.js +5 -0
  169. package/src/languages/py.js +52 -0
  170. package/src/languages/regex.js +19 -0
  171. package/src/languages/rs.js +28 -0
  172. package/src/languages/sql.js +33 -0
  173. package/src/languages/todo.js +19 -0
  174. package/src/languages/toml.js +36 -0
  175. package/src/languages/ts.js +13 -0
  176. package/src/languages/uri.js +26 -0
  177. package/src/languages/xml.js +68 -0
  178. package/src/languages/yaml.js +32 -0
  179. package/src/term.js +19 -0
  180. package/src/themes/atom-dark.css +23 -0
  181. package/src/themes/dark.css +23 -0
  182. package/src/themes/default.css +87 -0
  183. package/src/themes/default.js +26 -0
  184. package/src/themes/github-dark.css +23 -0
  185. package/src/themes/github-dim.css +3 -0
  186. package/src/themes/github-light.css +21 -0
  187. package/src/themes/visual-studio-dark.css +23 -0
@@ -0,0 +1,57 @@
1
+ #include <stdio.h>
2
+ #include "my_function_function1.h"
3
+
4
+ #define TEST_FUNCTION my_function_function1
5
+
6
+ #pragma GCC diagnostic ignored "-Wunused-parameter"
7
+
8
+ //some random code example
9
+
10
+ int fibonaaci(int n) {
11
+ if (n == 0) {
12
+ return 0;
13
+ } else if (n == 1) {
14
+ return 1;
15
+ } else {
16
+ return fibonaaci(n - 1) + fibonaaci(n - 2);
17
+ }
18
+ }
19
+
20
+ typedef struct {
21
+ int x;
22
+ int y;
23
+ } Point;
24
+
25
+ /*
26
+ * This is a comment
27
+ */
28
+
29
+ int main(int argc, char **argv)
30
+ {
31
+ printf("Hello World!\n");
32
+
33
+ Point p;
34
+
35
+ asm("movl $1, %0" : "=r"(p.x));
36
+ asm {
37
+ movl $2, %eax
38
+ movl %eax, %ebx
39
+ movl %ebx, %ecx
40
+ movl %ecx, %edx
41
+ movl %edx, %esi
42
+ movl %esi, %edi
43
+ movl %edi, %ebp
44
+ movl %ebp, %esp
45
+ }
46
+
47
+ printf("%d\n", fibonaaci(10));
48
+
49
+ argv += 1;
50
+ argc -= 1;
51
+
52
+ while (argc--) {
53
+ printf("%s\n", *argv++);
54
+ }
55
+
56
+ return (0);
57
+ }
@@ -0,0 +1,20 @@
1
+ @import "my-styles.css";
2
+
3
+ p > a,
4
+ .class,
5
+ #id {
6
+ color: blue;
7
+ text-decoration: underline;
8
+ }
9
+ /*TODO comment*/
10
+
11
+ @page :left {
12
+ color: #2222;
13
+ margin-left: 4cm;
14
+ margin-right: 3cm;
15
+ background: url(test.jpg);
16
+ color: rgb(5, 5, 5);
17
+ }
18
+ @media print {
19
+ body { font-size: 10pt }
20
+ }
@@ -0,0 +1,4 @@
1
+ cars,"chocolat, fruits",price
2
+ yes,"no,
3
+ maybe",x
4
+ no,yes,y
@@ -0,0 +1,27 @@
1
+ 0a1,6
2
+ > This is an important
3
+ > notice! It should
4
+ > therefore be located at
5
+ > the beginning of this
6
+ > document!
7
+ >
8
+ 11,15d16
9
+ < This paragraph contains
10
+ < text that is outdated.
11
+ + It will be deleted in the
12
+ - near future.
13
+ <
14
+ 17c18
15
+ < check this dokument. On
16
+ ---
17
+ > check this document. On
18
+ 24a26,29
19
+ >
20
+ > This paragraph contains
21
+ > important new additions
22
+ > to this document.
23
+ ! to this document.
24
+
25
+ @@ -1 +1,2 @@
26
+
27
+ *** pos ***
@@ -0,0 +1,23 @@
1
+ # create a dockerfile for a simple hello world app
2
+
3
+ FROM ubuntu:14.04
4
+
5
+ RUN apt-get update && apt-get install -y curl
6
+
7
+ ENV APP_NAME hello-world
8
+
9
+ EXPOSE 8080
10
+
11
+ RUN echo "Hello World" > /usr/share/nginx/html/index.html
12
+
13
+ ARG APP_NAME
14
+
15
+ RUN [ -d /usr/share/nginx/html/$APP_NAME ] || mkdir /usr/share/nginx/html/$APP_NAME
16
+
17
+ CMD ["/usr/sbin/nginx", "-g", "daemon off;"]
18
+
19
+ LABEL maintainer="hello"
20
+
21
+ maintainer
22
+
23
+ ENTRYPOINT ["/bin/bash"]
@@ -0,0 +1,10 @@
1
+ git diff
2
+ commit 526
3
+ --- before
4
+ +++ after
5
+ @@ -1 +1,2 @@
6
+ # TODO comment
7
+ -hello
8
+ +test
9
+ 'string'
10
+ "string"
@@ -0,0 +1,21 @@
1
+ // create a simple program that takes a number and prints it out
2
+ package main
3
+
4
+ // import the fmt package
5
+ import "fmt"
6
+
7
+ // main is the entry point for the program
8
+ func main() {
9
+ // declare a variable named num and assign it the value of 10
10
+ num := 10
11
+
12
+ // sanity check
13
+ fmt.Println("num is", num)
14
+
15
+ //scan from the console and assign the value to the variable num
16
+ fmt.Scanln(&num)
17
+
18
+
19
+ // print the value of num
20
+ fmt.Println(num)
21
+ }
@@ -0,0 +1,27 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset=UTF-8">
5
+ <meta http-equiv=X-UA-Compatible checked content="IE=edge">
6
+ <meta name="viewp
7
+ ort" test= content = "width=device-width, initial-scale=1.0">
8
+ <title>Document</title>
9
+ <style test = 5 >
10
+ test {color: #25f}
11
+ .css {background: url(</style-todo-later>)}
12
+ #test {}
13
+ </style >
14
+ </head>
15
+ <body>
16
+ <!--
17
+ this is a html comment
18
+ -->
19
+ html
20
+ &#test;
21
+ &123;
22
+ <img id = 'test' src=" alt="">
23
+ <script >
24
+ const test = document.querySelectorAll(`#test-${name}`)
25
+ </script>
26
+ </body >
27
+ </html>
@@ -0,0 +1,17 @@
1
+ HTTP/1.1 200 OK
2
+ Date: Mon, 23 May 2005 22:38:34 GMT
3
+ Content-Type: text/html; charset=UTF-8
4
+ Content-Length: 155
5
+ Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
6
+ Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux)
7
+ ETag: "3f80f-1b6-3e1cb03b"
8
+ Accept-Ranges: bytes
9
+ Connection: close
10
+
11
+ <html>
12
+ <head>
13
+ <title>An Example Page</title>
14
+ </head>
15
+ <body>
16
+ <p>Hello World, this is a very simple HTML document.</p>
17
+ </body>
@@ -0,0 +1,6 @@
1
+ [section]
2
+ a=a
3
+ b=str
4
+ ;[section]
5
+ # FIXME var=a
6
+ file="str"
@@ -0,0 +1,52 @@
1
+ //import the language module
2
+ import java.util.Scanner;
3
+
4
+ //token class
5
+ class Token {
6
+ public String type;
7
+ public String value;
8
+ public int line;
9
+ public int column;
10
+ public token(String type, String value, int line, int column) {
11
+ this.type = type;
12
+ this.value = value;
13
+ this.line = line;
14
+ this.column = column;
15
+ }
16
+ }
17
+
18
+ //lexer function that take a string and return a list of tokens
19
+ List<Token> lexer(String s) {
20
+ List<Token> tokens = new ArrayList<Token>();
21
+ int line = 1;
22
+ int column = 0;
23
+ int i = 0;
24
+ while (i < s.length()) {
25
+ char c = s.charAt(i);
26
+ if (c == '\n') {
27
+ line++;
28
+ column = 0;
29
+ } else {
30
+ column++;
31
+ }
32
+ }
33
+
34
+ //function that take a list of tokens and execute the program
35
+ void run(List<Token>) {
36
+ Stack<Integer> stack = new Stack<Integer>();
37
+ for (Token token : tokens) {
38
+ if (token.type == "NUMBER") {
39
+ stack.push(Integer.parseInt(token.value));
40
+ } else if (token.type == "ID") {
41
+ stack.push(stack.pop() + stack.pop());
42
+ }
43
+ }
44
+ System.out.println(stack.pop());
45
+ }
46
+
47
+ //main function
48
+ public static void main(String[] args) {
49
+ String s = "1+2+3";
50
+ List<Token> tokens = lexer(s);
51
+ run(tokens);
52
+ }
@@ -0,0 +1,34 @@
1
+ /* Multiline FIX
2
+ Comment */
3
+ /**
4
+ * js doc CHANGED x
5
+ * @param {String} param
6
+ * @return nothing
7
+ */
8
+ const listener = Deno.listen({ port: 8000 });
9
+ console.log(.8 * 0. * (0.8 * .e8) * 0.e8 * 0x849, 0d0101, 0o987, 8_987_654.1789)
10
+ console?.log(`http://localhost:${PORT}/`.match(/:[0-9]{2,4}^/g));
11
+ // TODO other comment
12
+ for await (const conn of listener) {
13
+ if (false)
14
+ break;
15
+ (async () => {
16
+ const requests = Deno.serveHttp(conn);
17
+ for await (const { respondWith } of this.requests.new) {
18
+ respondWith(new Response('Hello\
19
+ world'));
20
+ }
21
+ })();
22
+ }
23
+ function test(test) {
24
+ let test = () => { console.log(test) };
25
+ return test;
26
+ }
27
+ export default {
28
+ jsonData: a > 5,
29
+ match: /test/g,
30
+ type: `test
31
+ ${'test'}hello
32
+ ${test + 2.5}hello`,
33
+ 'Hello world': true
34
+ }
@@ -0,0 +1,2 @@
1
+ @name test.js
2
+ @params {Number} [test=null]
@@ -0,0 +1,24 @@
1
+ {
2
+ "firstName": "John",
3
+ "lastName": "Smith",
4
+ "isAlive": true,
5
+ "age": 27,
6
+ "address": {
7
+ "streetAddress": "21 2nd Street",
8
+ "city": "New York",
9
+ "state": "NY",
10
+ "postalCode": "10021-3100"
11
+ },
12
+ "phoneNumbers": [
13
+ {
14
+ "type": "home",
15
+ "number": "212 555-1234"
16
+ },
17
+ {
18
+ "type": "office",
19
+ "number": "646 555-4567"
20
+ }
21
+ ],
22
+ "children": [],
23
+ "spouse": null
24
+ }
@@ -0,0 +1,21 @@
1
+ // You might see insertions
2
+ leanpub-start-insert
3
+ const webpack = require("webpack");
4
+ leanpub-end-insert
5
+
6
+ // You might see deletions as well
7
+ leanpub-start-delete
8
+ const { MiniHtmlWebpackPlugin } = require("mini-html-webpack-plugin");
9
+ leanpub-end-delete
10
+
11
+ // Or combinations of both
12
+ leanpub-start-delete
13
+ const { MiniHtmlWebpackPlugin } = require("mini-html-webpack-plugin");
14
+ leanpub-end-delete
15
+ leanpub-start-insert
16
+ x = lambda a : a + 10
17
+ print(x(5))
18
+ leanpub-end-insert
19
+
20
+ // If content has been omitted, then ellipsis is used
21
+ ...
@@ -0,0 +1,32 @@
1
+ 127.0.0.1 user-identifier frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326
2
+
3
+ #Version: 1.0
4
+ #Date: 12-Jan-1996 00:00:00
5
+ #Fields: time cs-method cs-uri
6
+ 00:34:23 GET /foo/bar.html
7
+ 12:21:16 GET /foo/bar.html
8
+ 12:45:52 GET /foo/bar.html
9
+ 12:57:34 GET /foo/bar.html
10
+
11
+ [2021-12-10][21:42:22][WARN][discord_dispatch::application_manager:1034] Failed to read install path. path=AbsolutePath { path_buf: "C:\\Users\\micha\\AppData\\Local\\DiscordGames" } error=Os { code: 3, kind: NotFound, message: "Das System kann den angegebenen Pfad nicht finden." }
12
+ [2021-12-11][13:05:13][DEBUG][discord_dispatch::application_manager:195] App started. version="1.10.5"
13
+
14
+ 2021-01-12T13:38:16Z containerd time="2021-01-12T13:38:16.338835400Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.btrfs\"..." error="path /var/lib/desktop-containerd/daemon/io.containerd.snapshotter.v1.btrfs (ext4) must be a btrfs filesystem to be used with the btrfs snapshotter: skip plugin" type=io.containerd.snapshotter.v1
15
+ 2021-03-05T17:58:29Z kmsg (977696) - 2021-03-05T17:58:28.2836488Z: init: (141) ERROR: StartHostListener:356: write failed 32
16
+ time="2021-01-12T14:38:11+01:00" level=info msg="🍀 socket server listening : \\\\.\\pipe\\dockerGuiToDriver"
17
+
18
+ Exception in thread "main" java.lang.NullPointerException: Fictitious NullPointerException
19
+ at ClassName.methodName1(ClassName.java:lineNumber)
20
+ at ClassName.methodName2(ClassName.java:lineNumber)
21
+ at ClassName.methodName3(ClassName.java:lineNumber)
22
+ at ClassName.main(ClassName.java:lineNumber)
23
+
24
+ 47.29.201.179 - - [28/Feb/2021:13:17:10 +0000] "GET /?p=1 HTTP/2.0" 200 5316 "https://domain1.com/?p=1" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" "2.75"
25
+ Mar 19 22:10:24 xxxxxxx journal: xxxxxxxx.mylabserver.com nginx: photos.example.com 127.0.0.1 - - [19/Mar/2018:22:10:24 +0000] "GET / HTTP/1.1" 200 53324 "-" "curl/7.29.0" "-"
26
+ TLSv1.2 AES128-SHA 1.1.1.1 "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"
27
+
28
+ 4/1/2021 14:15:27 - PFRO Error: \??\C:\Windows\system32\spool\DRIVERS\x64\3\New\FXSAPI.DLL, \??\C:\Windows\system32\spool\DRIVERS\x64\3\FXSAPI.DLL, 0xc000003a
29
+ AudMig: Device Ids match - {5}.\?hdaudio#func_03&ven_40de&dev_0083&subsys_50de130f&rev_4003#1&13efefe3&0&0004#{6993ad03-95ef-33d0-a2cc-00a0c9322596} opo04/00040002 {2}.\?hdaudio#func_01&ven_40de&dev_0084&subsys_10de310f&rev_1004#2&22efefe2&0&0004#{6994ad04-94ef-32d0-a1cc-00a0c9181396} opo04/00030001
30
+ AudMig: Migrated {a31c434e-df4c-1efd-8010-67d416a840e0},2 property at 3
31
+
32
+ [07:28:21] [Server thread/INFO] [FML]: Invalid recipe found with multiple oredict ingredients in the same ingred
@@ -0,0 +1,62 @@
1
+ #!/bin/lua
2
+
3
+ --[=[
4
+ This is also a block comment
5
+ We can include "]]" inside this comment
6
+ --]=]
7
+
8
+ --[==[
9
+ This is also a block comment
10
+ We can include "]=]" inside this comment
11
+ f --]==]
12
+
13
+ vf --tst
14
+
15
+ a = 'alo\n123"'
16
+ a = "alo\n123\""
17
+ a = '\97lo\10\04923"'
18
+ a = [[alo
19
+ 123"]]
20
+ a = [==[
21
+ alo
22
+ 123"]==]
23
+
24
+ var ::= prefixexp `[´ exp `]´
25
+
26
+ stat ::= while exp do block end
27
+ stat ::= repeat block until exp
28
+ stat ::= if exp then block {elseif exp then block} [else block] end
29
+
30
+ do
31
+ local f, s, var = explist
32
+ while true do
33
+ local var_1, ···, var_n = f(s, var)
34
+ var = var_1
35
+ if var == nil then break end
36
+ block
37
+ end
38
+ end
39
+
40
+ do
41
+ local t = {}
42
+ t[f(1)] = g
43
+ t[1] = "x" -- 1st exp
44
+ t[2] = "y" -- 2nd exp
45
+ t.x = 1 -- t["x"] = 1
46
+ t[3] = f(x) -- 3rd exp
47
+ t[30] = 23
48
+ t[4] = 45 -- 4th exp
49
+ a = t
50
+ end
51
+
52
+ function max(num1, num2)
53
+
54
+ if (num1 > num2) then
55
+ result = num1;
56
+ else
57
+ result = num2;
58
+ end
59
+
60
+ return result;
61
+ end
62
+ --]=]
@@ -0,0 +1,51 @@
1
+ PACKAGE = package
2
+ VERSION = ` date "+%Y.%m%d%" `
3
+ RELEASE_DIR = ..
4
+ RELEASE_FILE = $(PACKAGE)-$(VERSION)
5
+
6
+ # that won't understand these lines
7
+ ifneq (,)
8
+ This makefile requires GNU Make.
9
+ endif
10
+
11
+ # Notice that the variable LOGNAME comes from the environment in
12
+ # POSIX shells.
13
+ #
14
+ # target: all - Default target. Does nothing.
15
+ all:
16
+ echo "Hello $(LOGNAME), nothing to do by default"
17
+ # TODO sometimes: echo "Hello ${LOGNAME}, nothing to do by default"
18
+ echo "Try 'make help'"
19
+
20
+ # target: help - Display callable targets.
21
+ help:
22
+ egrep "^# target:" [Mm]akefile
23
+
24
+ # target: list - List source files
25
+ list:
26
+ # Won't work. Each command is in separate shell
27
+ @cd src
28
+ ls
29
+
30
+ # Correct, continuation of the same shell
31
+ cd src; \
32
+ ls
33
+
34
+ # target: dist - Make a release.
35
+ dist:
36
+ tar -cf $(RELEASE_DIR)/$(RELEASE_FILE) && \
37
+ gzip -9 $(RELEASE_DIR)/$(RELEASE_FILE).tar
38
+
39
+ %.txt : %.html
40
+ lynx -dump $< > $@
41
+
42
+
43
+ # This is an explicit suffix rule. It may be omitted on systems
44
+ # that handle simple rules like this automatically.
45
+ .c.o:
46
+ $(CC) $(CFLAGS) -c $<
47
+
48
+ FRC:
49
+ .SUFFIXES: .c
50
+
51
+ .PHONY: clean depend
@@ -0,0 +1,62 @@
1
+ Heading
2
+ =======
3
+
4
+ Sub-heading
5
+ -----------
6
+
7
+ Paragraphs are separated
8
+ by a blank line.
9
+
10
+ Two spaces at the end of a line
11
+ produce a line break.
12
+
13
+ Text attributes _italic_,
14
+ **bold**, `monospace`. Some `console.log(lst.filter(e => e == true))` implementations may use *single-asterisks* for italic text.
15
+
16
+ Horizontal rule:
17
+
18
+ ---
19
+
20
+ ```
21
+ <link rel="stylesheet" href="style.css">
22
+ <link rel="favicon">
23
+ ```
24
+
25
+ ```js
26
+ for (let y = 0; y <= size; y++) {
27
+ console.log(state.map(star => (star ? '*' : ' ')).join(''));
28
+ state = state.map((_, i, arr) => arr[i + 1] || arr[i - 1]);
29
+ }
30
+ ```
31
+
32
+ ```beurihiuerh
33
+ }
34
+ ```
35
+
36
+ Strikethrough:
37
+ ~~strikethrough~~
38
+
39
+ Bullet list:
40
+
41
+ * apples
42
+ * oranges
43
+ * pears
44
+
45
+ Numbered list:
46
+
47
+ 1. lather
48
+ 2. rinse
49
+ 3. repeat
50
+
51
+ An [example](http://example.com).
52
+
53
+ ![Image](Icon-pictures.png "icon")
54
+
55
+ > Markdown uses email-style
56
+ > characters for blockquoting.
57
+ > Multiple paragraphs need to be prepended individually.
58
+
59
+ | Item | Price | # In stock |
60
+ |--------------|-----------|------------|
61
+ | Juicy Apples | 1.99 | *7* |
62
+ | Bananas | **1.89** | 5234 |
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/perl
2
+
3
+ use strict;
4
+ use warnings;
5
+
6
+ # This would print with a line break in the middle
7
+ print "Hello
8
+ world\n";
9
+ $a = 10;
10
+ print "Value of a = $a\n";
11
+
12
+ $var = <<'EOF';
13
+
14
+ my ( $remaining, $total );
15
+
16
+ $remaining = $total = shift(@ARGV);
17
+
18
+ STDOUT->autoflush(1);
19
+
20
+ while ( $remaining ) {
21
+ printf ( "Remaining %s/%s \r", $remaining--, $total );
22
+ sleep 1;
23
+ }
24
+
25
+ print "\n";
@@ -0,0 +1,3 @@
1
+ In computing, plain text is a loose term for data (e.g. file contents) that represent only characters of readable material but not its graphical representation nor other objects (floating-point numbers, images, etc.).
2
+ It may also include a limited number of "whitespace" characters that affect simple arrangement of text, such as spaces, line breaks, or tabulation characters (although tab characters can "mean" many different things, so are hardly "plain").
3
+ Plain text is different from formatted text, where style information is included; from structured text, where structural parts of the document such as paragraphs, sections, and the like are identified; and from binary files in which some portions must be interpreted as binary objects (encoded integers, real numbers, images, etc.).
@@ -0,0 +1,38 @@
1
+ #This is a comment
2
+ #written in
3
+ #more than just one line
4
+
5
+ """
6
+ This is a comment
7
+ written in
8
+ more than just one line
9
+ """
10
+ def fib(n):
11
+ a, b = 0, 1
12
+ while a < n:
13
+ print(a, end=' ')
14
+ a, b = b, a+b
15
+ print()
16
+ fib(1000)
17
+ numbers = [2, 4, 6, 8]
18
+ """
19
+ This is a comment
20
+ written in
21
+ more than just one line
22
+ """
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+ class MyClass:
32
+ def __init__():
33
+ x = 5
34
+ x = "%1 test" % name
35
+ x = f"test{x > 5} t est\n {numbers} {{{test}}}"
36
+ x = F"test{x > 5} test\n {numbers} {{\{test}}}\" test
37
+
38
+ x = lambda a : a + 10
@@ -0,0 +1,2 @@
1
+ /([A-Z])\w+\d{0,9}/gi
2
+ TODO comment
@@ -0,0 +1,38 @@
1
+ /*
2
+ create a simple multithreaded server
3
+ */
4
+
5
+ //include the library
6
+ use std::net::{TcpListener, TcpStream};
7
+ use std::io::{Read, Write};
8
+ use std::thread;
9
+
10
+ //function that handles the client
11
+ fn handle_client(mut stream: TcpStream) {
12
+ //read the message
13
+ let mut buffer = [0; 512];
14
+ stream.read(&mut buffer).unwrap();
15
+ //print the message
16
+ println!("{}", String::from_utf8_lossy(&buffer[..]));
17
+ //write the message back
18
+ stream.write(&buffer).unwrap();
19
+ }
20
+
21
+ //main function
22
+ fn main() {
23
+ //create a listener
24
+ let listener = TcpListener::bind("127.0.0.1:8080").unwrap();
25
+ //listen for connections
26
+ for stream in listener.incoming() {
27
+ //handle the connection
28
+ match stream {
29
+ Ok(stream) => {
30
+ thread::spawn(move || {
31
+ handle_client(stream);
32
+ });
33
+ }
34
+ Err(e) => {
35
+ println!("Error: {}", e);
36
+ }
37
+ }
38
+ }