rouge 3.15.0 → 3.20.0

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 (104) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rougify +2 -2
  3. data/lib/rouge.rb +67 -52
  4. data/lib/rouge/cli.rb +18 -1
  5. data/lib/rouge/demos/augeas +16 -0
  6. data/lib/rouge/demos/bibtex +12 -0
  7. data/lib/rouge/demos/cypher +5 -0
  8. data/lib/rouge/demos/datastudio +21 -0
  9. data/lib/rouge/demos/ecl +18 -0
  10. data/lib/rouge/demos/ghc-cmm +23 -0
  11. data/lib/rouge/demos/hlsl +20 -0
  12. data/lib/rouge/demos/isbl +4 -0
  13. data/lib/rouge/demos/livescript +15 -0
  14. data/lib/rouge/demos/nasm +6 -6
  15. data/lib/rouge/demos/rego +8 -0
  16. data/lib/rouge/demos/solidity +13 -0
  17. data/lib/rouge/demos/vcl +12 -0
  18. data/lib/rouge/demos/velocity +9 -0
  19. data/lib/rouge/demos/yang +17 -0
  20. data/lib/rouge/demos/zig +6 -0
  21. data/lib/rouge/formatters/terminal256.rb +22 -6
  22. data/lib/rouge/formatters/terminal_truecolor.rb +37 -0
  23. data/lib/rouge/lexer.rb +4 -2
  24. data/lib/rouge/lexers/apache.rb +22 -12
  25. data/lib/rouge/lexers/apache/keywords.rb +24 -0
  26. data/lib/rouge/lexers/augeas.rb +93 -0
  27. data/lib/rouge/lexers/bibtex.rb +115 -0
  28. data/lib/rouge/lexers/cmake.rb +1 -0
  29. data/lib/rouge/lexers/coffeescript.rb +47 -15
  30. data/lib/rouge/lexers/console.rb +53 -37
  31. data/lib/rouge/lexers/cpp.rb +18 -5
  32. data/lib/rouge/lexers/cypher.rb +108 -0
  33. data/lib/rouge/lexers/d.rb +3 -3
  34. data/lib/rouge/lexers/datastudio.rb +138 -0
  35. data/lib/rouge/lexers/diff.rb +1 -1
  36. data/lib/rouge/lexers/ecl.rb +175 -0
  37. data/lib/rouge/lexers/fsharp.rb +1 -0
  38. data/lib/rouge/lexers/ghc_cmm.rb +340 -0
  39. data/lib/rouge/lexers/gherkin.rb +1 -1
  40. data/lib/rouge/lexers/gherkin/keywords.rb +9 -6
  41. data/lib/rouge/lexers/haskell.rb +27 -19
  42. data/lib/rouge/lexers/hlsl.rb +166 -0
  43. data/lib/rouge/lexers/html.rb +1 -1
  44. data/lib/rouge/lexers/isbl.rb +97 -0
  45. data/lib/rouge/lexers/isbl/builtins.rb +17 -0
  46. data/lib/rouge/lexers/java.rb +4 -5
  47. data/lib/rouge/lexers/javascript.rb +1 -3
  48. data/lib/rouge/lexers/json.rb +3 -0
  49. data/lib/rouge/lexers/json_doc.rb +1 -0
  50. data/lib/rouge/lexers/jsx.rb +47 -59
  51. data/lib/rouge/lexers/kotlin.rb +14 -2
  52. data/lib/rouge/lexers/lasso.rb +11 -12
  53. data/lib/rouge/lexers/lasso/keywords.rb +20 -0
  54. data/lib/rouge/lexers/livescript.rb +310 -0
  55. data/lib/rouge/lexers/llvm.rb +6 -33
  56. data/lib/rouge/lexers/llvm/keywords.rb +25 -0
  57. data/lib/rouge/lexers/lua.rb +41 -3
  58. data/lib/rouge/lexers/lua/keywords.rb +28 -0
  59. data/lib/rouge/lexers/markdown.rb +9 -5
  60. data/lib/rouge/lexers/mathematica.rb +2 -2
  61. data/lib/rouge/lexers/mathematica/keywords.rb +17 -0
  62. data/lib/rouge/lexers/matlab.rb +3 -4
  63. data/lib/rouge/lexers/matlab/builtins.rb +11 -0
  64. data/lib/rouge/lexers/matlab/keywords.rb +15 -0
  65. data/lib/rouge/lexers/nasm.rb +42 -168
  66. data/lib/rouge/lexers/objective_c/common.rb +2 -2
  67. data/lib/rouge/lexers/opentype_feature_file.rb +27 -42
  68. data/lib/rouge/lexers/pascal.rb +1 -1
  69. data/lib/rouge/lexers/php.rb +48 -33
  70. data/lib/rouge/lexers/php/keywords.rb +202 -0
  71. data/lib/rouge/lexers/powershell.rb +7 -2
  72. data/lib/rouge/lexers/python.rb +58 -57
  73. data/lib/rouge/lexers/racket.rb +24 -1
  74. data/lib/rouge/lexers/rego.rb +45 -0
  75. data/lib/rouge/lexers/ruby.rb +16 -3
  76. data/lib/rouge/lexers/rust.rb +2 -10
  77. data/lib/rouge/lexers/scala.rb +1 -1
  78. data/lib/rouge/lexers/shell.rb +1 -1
  79. data/lib/rouge/lexers/solidity.rb +185 -0
  80. data/lib/rouge/lexers/sparql.rb +5 -4
  81. data/lib/rouge/lexers/sqf.rb +2 -2
  82. data/lib/rouge/lexers/sqf/keywords.rb +12 -0
  83. data/lib/rouge/lexers/terraform.rb +15 -0
  84. data/lib/rouge/lexers/toml.rb +23 -0
  85. data/lib/rouge/lexers/tsx.rb +10 -3
  86. data/lib/rouge/lexers/turtle.rb +1 -1
  87. data/lib/rouge/lexers/typescript.rb +1 -1
  88. data/lib/rouge/lexers/typescript/common.rb +18 -4
  89. data/lib/rouge/lexers/varnish.rb +168 -0
  90. data/lib/rouge/lexers/velocity.rb +71 -0
  91. data/lib/rouge/lexers/viml.rb +6 -38
  92. data/lib/rouge/lexers/viml/keywords.rb +11 -4
  93. data/lib/rouge/lexers/vue.rb +4 -1
  94. data/lib/rouge/lexers/yang.rb +147 -0
  95. data/lib/rouge/lexers/zig.rb +139 -0
  96. data/lib/rouge/version.rb +1 -1
  97. metadata +43 -9
  98. data/lib/rouge/lexers/apache/keywords.yml +0 -764
  99. data/lib/rouge/lexers/lasso/keywords.yml +0 -446
  100. data/lib/rouge/lexers/lua/builtins.rb +0 -24
  101. data/lib/rouge/lexers/mathematica/builtins.rb +0 -13
  102. data/lib/rouge/lexers/matlab/builtins.yml +0 -3515
  103. data/lib/rouge/lexers/php/builtins.rb +0 -203
  104. data/lib/rouge/lexers/sqf/commands.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5da5e5d1e737275e6a41550af0aaa6af398cb8517b67717f07d9ad632c13e28a
4
- data.tar.gz: 4dc38a2b67f0eeb0890143442c411be221e00fc78718c8f404d9dbf6f787b29a
3
+ metadata.gz: a0ad085dddf353cc95e795e5f556b4f2d9821068cceeeaab4cb34cb11f3ad776
4
+ data.tar.gz: f70271022198b1d7e95df35d856274234720d54d4ef3f1a42c782246e2cf4c47
5
5
  SHA512:
6
- metadata.gz: 911cf95350e23be5bb1bfedbf178e3872a37d5930f201156fa7daff16a2bad5609043cae7a917a1aa8adf9b863b28538266217271693da8cbfe68aa20a2df82f
7
- data.tar.gz: 5f363794c19033fd11c3a5360fbcf550536f8f5292962a0ab70e434d1f4f1aa5711c938c19ddf088b4eb76140e54e24029229524321048bc451950a006140f51
6
+ metadata.gz: 473cfdc4ce0c458d0a7b0c3b1e6684723ceb7c15dea4d1080baf201786ecd149e9d21cd25f65735edbbf4b4f763a5d7d1854a4d909bef6902b7d609d30ebcc2b
7
+ data.tar.gz: 579d31241b2fe8d4f2b9471dd6bb97b5621051811260d02b21a012e9e35ccf34d83e0e998981e959aa0ce6a1b00932c06f7ed8b8b093fde95d53c7a8ebbb67ce
@@ -3,8 +3,8 @@
3
3
 
4
4
  require 'pathname'
5
5
  ROOT_DIR = Pathname.new(__FILE__).dirname.parent
6
- load ROOT_DIR.join('lib/rouge.rb')
7
- load ROOT_DIR.join('lib/rouge/cli.rb')
6
+ Kernel::load ROOT_DIR.join('lib/rouge.rb')
7
+ Kernel::load ROOT_DIR.join('lib/rouge/cli.rb')
8
8
  Signal.trap('PIPE', 'SYSTEM_DEFAULT') if Signal.list.include? 'PIPE'
9
9
 
10
10
  begin
@@ -6,10 +6,14 @@ require 'pathname'
6
6
 
7
7
  # The containing module for Rouge
8
8
  module Rouge
9
+ # cache value in a constant since `__dir__` allocates a new string
10
+ # on every call.
11
+ LIB_DIR = __dir__.freeze
12
+
9
13
  class << self
10
14
  def reload!
11
- Object.send :remove_const, :Rouge
12
- load __FILE__
15
+ Object::send :remove_const, :Rouge
16
+ Kernel::load __FILE__
13
17
  end
14
18
 
15
19
  # Highlight some text with a given lexer and formatter.
@@ -31,62 +35,73 @@ module Rouge
31
35
 
32
36
  formatter.format(lexer.lex(text), &b)
33
37
  end
34
- end
35
- end
36
38
 
37
- # mimic Kernel#require_relative API
38
- def load_relative(path)
39
- load File.join(__dir__, "#{path}.rb")
40
- end
39
+ # Load a file relative to the `lib/rouge` path.
40
+ #
41
+ # @api private
42
+ def load_file(path)
43
+ Kernel::load File.join(LIB_DIR, "rouge/#{path}.rb")
44
+ end
41
45
 
42
- def lexer_dir(path = '')
43
- File.join(__dir__, 'rouge', 'lexers', path)
46
+ # Load the lexers in the `lib/rouge/lexers` directory.
47
+ #
48
+ # @api private
49
+ def load_lexers
50
+ # The trailing slash is necessary to avoid lexers being loaded multiple
51
+ # times by `Lexers.load_lexer`
52
+ lexer_dir = File.join(LIB_DIR, "rouge/lexers/")
53
+ Dir.glob(File.join(lexer_dir, '*.rb')).each do |f|
54
+ Lexers.load_lexer(f.sub(lexer_dir, ''))
55
+ end
56
+ end
57
+ end
44
58
  end
45
59
 
46
- load_relative 'rouge/version'
47
- load_relative 'rouge/util'
48
- load_relative 'rouge/text_analyzer'
49
- load_relative 'rouge/token'
60
+ Rouge.load_file 'version'
61
+ Rouge.load_file 'util'
62
+ Rouge.load_file 'text_analyzer'
63
+ Rouge.load_file 'token'
50
64
 
51
- load_relative 'rouge/lexer'
52
- load_relative 'rouge/regex_lexer'
53
- load_relative 'rouge/template_lexer'
65
+ Rouge.load_file 'lexer'
66
+ Rouge.load_file 'regex_lexer'
67
+ Rouge.load_file 'template_lexer'
54
68
 
55
- Dir.glob(lexer_dir('*rb')).each { |f| Rouge::Lexers.load_lexer(f.sub(lexer_dir, '')) }
69
+ Rouge.load_lexers
56
70
 
57
- load_relative 'rouge/guesser'
58
- load_relative 'rouge/guessers/util'
59
- load_relative 'rouge/guessers/glob_mapping'
60
- load_relative 'rouge/guessers/modeline'
61
- load_relative 'rouge/guessers/filename'
62
- load_relative 'rouge/guessers/mimetype'
63
- load_relative 'rouge/guessers/source'
64
- load_relative 'rouge/guessers/disambiguation'
71
+ Rouge.load_file 'guesser'
72
+ Rouge.load_file 'guessers/util'
73
+ Rouge.load_file 'guessers/glob_mapping'
74
+ Rouge.load_file 'guessers/modeline'
75
+ Rouge.load_file 'guessers/filename'
76
+ Rouge.load_file 'guessers/mimetype'
77
+ Rouge.load_file 'guessers/source'
78
+ Rouge.load_file 'guessers/disambiguation'
65
79
 
66
- load_relative 'rouge/formatter'
67
- load_relative 'rouge/formatters/html'
68
- load_relative 'rouge/formatters/html_table'
69
- load_relative 'rouge/formatters/html_pygments'
70
- load_relative 'rouge/formatters/html_legacy'
71
- load_relative 'rouge/formatters/html_linewise'
72
- load_relative 'rouge/formatters/html_line_table'
73
- load_relative 'rouge/formatters/html_inline'
74
- load_relative 'rouge/formatters/terminal256'
75
- load_relative 'rouge/formatters/tex'
76
- load_relative 'rouge/formatters/null'
80
+ Rouge.load_file 'formatter'
81
+ Rouge.load_file 'formatters/html'
82
+ Rouge.load_file 'formatters/html_table'
83
+ Rouge.load_file 'formatters/html_pygments'
84
+ Rouge.load_file 'formatters/html_legacy'
85
+ Rouge.load_file 'formatters/html_linewise'
86
+ Rouge.load_file 'formatters/html_line_table'
87
+ Rouge.load_file 'formatters/html_inline'
88
+ Rouge.load_file 'formatters/terminal256'
89
+ Rouge.load_file 'formatters/terminal_truecolor'
90
+ Rouge.load_file 'formatters/tex'
91
+ Rouge.load_file 'formatters/null'
77
92
 
78
- load_relative 'rouge/theme'
79
- load_relative 'rouge/tex_theme_renderer'
80
- load_relative 'rouge/themes/thankful_eyes'
81
- load_relative 'rouge/themes/colorful'
82
- load_relative 'rouge/themes/base16'
83
- load_relative 'rouge/themes/github'
84
- load_relative 'rouge/themes/igor_pro'
85
- load_relative 'rouge/themes/monokai'
86
- load_relative 'rouge/themes/molokai'
87
- load_relative 'rouge/themes/monokai_sublime'
88
- load_relative 'rouge/themes/gruvbox'
89
- load_relative 'rouge/themes/tulip'
90
- load_relative 'rouge/themes/pastie'
91
- load_relative 'rouge/themes/bw'
92
- load_relative 'rouge/themes/magritte'
93
+ Rouge.load_file 'theme'
94
+ Rouge.load_file 'tex_theme_renderer'
95
+ Rouge.load_file 'themes/thankful_eyes'
96
+ Rouge.load_file 'themes/colorful'
97
+ Rouge.load_file 'themes/base16'
98
+ Rouge.load_file 'themes/github'
99
+ Rouge.load_file 'themes/igor_pro'
100
+ Rouge.load_file 'themes/monokai'
101
+ Rouge.load_file 'themes/molokai'
102
+ Rouge.load_file 'themes/monokai_sublime'
103
+ Rouge.load_file 'themes/gruvbox'
104
+ Rouge.load_file 'themes/tulip'
105
+ Rouge.load_file 'themes/pastie'
106
+ Rouge.load_file 'themes/bw'
107
+ Rouge.load_file 'themes/magritte'
@@ -4,6 +4,8 @@
4
4
  # not required by the main lib.
5
5
  # to use this module, require 'rouge/cli'.
6
6
 
7
+ require 'rbconfig'
8
+
7
9
  module Rouge
8
10
  class FileReader
9
11
  attr_reader :input
@@ -200,9 +202,22 @@ module Rouge
200
202
  yield %[ delimiters. implies --escape]
201
203
  end
202
204
 
205
+ # There is no consistent way to do this, but this is used elsewhere,
206
+ # and we provide explicit opt-in and opt-out with $COLORTERM
207
+ def self.supports_truecolor?
208
+ return true if %w(24bit truecolor).include?(ENV['COLORTERM'])
209
+ return false if ENV['COLORTERM'] && ENV['COLORTERM'] =~ /256/
210
+
211
+ if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
212
+ ENV['ConEmuANSI'] == 'ON' && !ENV['ANSICON']
213
+ else
214
+ ENV['TERM'] !~ /(^rxvt)|(-color$)/
215
+ end
216
+ end
217
+
203
218
  def self.parse(argv)
204
219
  opts = {
205
- :formatter => 'terminal256',
220
+ :formatter => supports_truecolor? ? 'terminal-truecolor' : 'terminal256',
206
221
  :theme => 'thankful_eyes',
207
222
  :css_class => 'codehilite',
208
223
  :input_file => '-',
@@ -299,8 +314,10 @@ module Rouge
299
314
 
300
315
  theme = Theme.find(opts[:theme]).new or error! "unknown theme #{opts[:theme]}"
301
316
 
317
+ # TODO: document this in --help
302
318
  @formatter = case opts[:formatter]
303
319
  when 'terminal256' then Formatters::Terminal256.new(theme)
320
+ when 'terminal-truecolor' then Formatters::TerminalTruecolor.new(theme)
304
321
  when 'html' then Formatters::HTML.new
305
322
  when 'html-pygments' then Formatters::HTMLPygments.new(Formatters::HTML.new, opts[:css_class])
306
323
  when 'html-inline' then Formatters::HTMLInline.new(theme)
@@ -0,0 +1,16 @@
1
+ (*
2
+ This is a comment
3
+ *)
4
+ module Foo =
5
+ autoload xfm
6
+
7
+ let a = b | c . d
8
+
9
+ let lns = a*
10
+
11
+ let filter = incl "/path/to/file"
12
+ . incl "/path/to/other_file"
13
+ . Util.stdexcl
14
+
15
+ (* xmf is the transform *)
16
+ let xmf = transform lns filter
@@ -0,0 +1,12 @@
1
+ @article{Witten:1988hf,
2
+ author = "Witten, Edward",
3
+ title = "{Quantum Field Theory and the Jones Polynomial}",
4
+ journal = "Commun. Math. Phys.",
5
+ volume = "121",
6
+ year = "1989",
7
+ pages = "351-399",
8
+ doi = "10.1007/BF01217730",
9
+ note = "[,233(1988)]",
10
+ reportNumber = "IASSNS-HEP-88-33",
11
+ SLACcitation = "%%CITATION = CMPHA,121,351;%%"
12
+ }
@@ -0,0 +1,5 @@
1
+ // Cypher Mode for Rouge
2
+ CREATE (john:Person {name: 'John'})
3
+ MATCH (user)-[:friend]->(follower)
4
+ WHERE user.name IN ['Joe', 'John', 'Sara', 'Maria', 'Steve'] AND follower.name =~ 'S.*'
5
+ RETURN user.name, follower.name
@@ -0,0 +1,21 @@
1
+
2
+ Get_Variable("EUSER","ENV","USERNAME");
3
+
4
+ Message("Le Login Windows est : %EUSER%");
5
+
6
+ Get_Variable("st","JOB","FOLDER1.date_err.SYSTEM.STATUS");
7
+
8
+
9
+ AFFECT("filter1", '%%/"t"');
10
+ AFFECT("filter2", '%%/"pi"');
11
+ JSONTOSQL("%{jsonpath}%/file.json", "",
12
+ " JSONPATH like '%filter1%' ", "a = JSONVALUE",
13
+ " JSONPATH like '%filter2%' ", "b = JSONVALUE; output(json_data, a, b)");
14
+
15
+
16
+ Affect(VAR1,'%TEST%'); //Créer et affecter la variable VAR1 avec une chaîne
17
+ select * from TABLE1 where COL1 like %VAR1%; //utiliser la variable VAR1 dans une requête
18
+
19
+ select * from TEST_TABLE; //exécution d'une requête Select pour ramener des valeurs
20
+ Affect_LastColumns("TEST1"); //création du paramètre TEST1
21
+
@@ -0,0 +1,18 @@
1
+ /*
2
+ Example code - use without restriction.
3
+ */
4
+ Layout_Person := RECORD
5
+ UNSIGNED1 PersonID;
6
+ STRING15 FirstName;
7
+ STRING25 LastName;
8
+ END;
9
+
10
+ allPeople := DATASET([ {1,'Fred','Smith'},
11
+ {2,'Joe','Blow'},
12
+ {3,'Jane','Smith'}],Layout_Person);
13
+
14
+ somePeople := allPeople(LastName = 'Smith');
15
+
16
+ // Outputs ---
17
+ somePeople;
18
+
@@ -0,0 +1,23 @@
1
+ [lvl_s4t3_entry() // [R1]
2
+ { info_tbls: [(c4uB,
3
+ label: lvl_s4t3_info
4
+ rep: HeapRep 1 ptrs { Thunk }
5
+ srt: Nothing)]
6
+ stack_info: arg_space: 8 updfr_space: Just 8
7
+ }
8
+ {offset
9
+ c4uB: // global
10
+ if ((Sp + -32) < SpLim) (likely: False) goto c4uC; else goto c4uD;
11
+ c4uC: // global
12
+ R1 = R1;
13
+ call (stg_gc_enter_1)(R1) args: 8, res: 0, upd: 8;
14
+ c4uD: // global
15
+ I64[Sp - 16] = stg_upd_frame_info;
16
+ P64[Sp - 8] = R1;
17
+ R2 = P64[R1 + 16];
18
+ I64[Sp - 32] = stg_ap_p_info;
19
+ P64[Sp - 24] = Main.fib3_closure+1;
20
+ Sp = Sp - 32;
21
+ call GHC.Num.fromInteger_info(R2) args: 40, res: 0, upd: 24;
22
+ }
23
+ }
@@ -0,0 +1,20 @@
1
+ struct PSInput
2
+ {
3
+ float4 position : SV_POSITION;
4
+ float4 color : COLOR;
5
+ };
6
+
7
+ // Vertex shader
8
+ PSInput VSMain(float4 position : POSITION, float4 color : COLOR)
9
+ {
10
+ PSInput result;
11
+ result.position = position;
12
+ result.color = color;
13
+ return result;
14
+ }
15
+
16
+ // Pixel shader
17
+ float4 PSMain(PSInput input) : SV_TARGET
18
+ {
19
+ return input.color;
20
+ }
@@ -0,0 +1,4 @@
1
+ NameReq = Object.Requisites(SYSREQ_NAME)
2
+ if Assigned(NameReq.AsString)
3
+ ShowMessage("Привет мир")
4
+ endif
@@ -0,0 +1,15 @@
1
+ mitch =
2
+ age: 21
3
+ height: 180cm
4
+ pets: [\dog, \goldfish]
5
+
6
+ phile = {}
7
+ phile{height, pets} = mitch
8
+ phile.height #=> 180
9
+ phile.pets #=> ['dog', 'goldfish']
10
+
11
+ a = [2 7 1 8]
12
+ ..push 3
13
+ ..shift!
14
+ ..sort!
15
+ a #=> [1,3,7,8]
@@ -10,12 +10,12 @@
10
10
  extern irq_handler
11
11
 
12
12
  irq_common_stub:
13
- pusha ; Pushes edi,esi,ebp,esp,ebx,edx,ecx,eax
14
- mov ax, ds ; Lower 16-bits of eax = ds.
15
- push eax ; save the data segment descriptor
16
- mov ax, 0x10 ; load the kernel data segment descriptor
17
- mov edx, eax
18
- call irq_handler
13
+ pusha ; push all general-purpose registers
14
+ mov ax, ds ; lower 16-bits of eax = ds
15
+ push eax ; save the data segment descriptor
16
+ mov ax, 0x10 ; load the kernel data segment descriptor
17
+ mov edx, eax
18
+ call irq_handler
19
19
 
20
20
  %assign i 0
21
21
  %rep 8
@@ -0,0 +1,8 @@
1
+ package httpapi.authz
2
+
3
+ subordinates = {"alice": [], "charlie": [], "bob": ["alice"], "betty": ["charlie"]}
4
+
5
+ # HTTP API request
6
+ import input
7
+
8
+ default allow = false
@@ -0,0 +1,13 @@
1
+ pragma solidity ~0.4.15;
2
+
3
+ interface IMirror {
4
+ function reflect() external payable returns(bool /* ain't I pretty?.. */);
5
+ }
6
+
7
+ contract Mirror is IMirror {
8
+ event logMessage(address indexed sender, uint256 value, uint256 gas, bytes data);
9
+
10
+ function () { // no funny stuff
11
+ revert();
12
+ }
13
+ }
@@ -0,0 +1,12 @@
1
+ vcl 4.0;
2
+
3
+ backend server1 {
4
+ .host = "server1.example.com";
5
+ .probe = {
6
+ .url = "/";
7
+ .timeout = 1s;
8
+ .interval = 5s;
9
+ .window = 5;
10
+ .threshold = 3;
11
+ }
12
+ }
@@ -0,0 +1,9 @@
1
+ #*
2
+ There is multi-line comment.
3
+ see this text because the Velocity Templating Engine will ignore it.
4
+ *#
5
+ <h3>List</h3>
6
+ ## This is a single line comment.
7
+ #if( $allProducts )
8
+ <p>not found.</p>
9
+ #end
@@ -0,0 +1,17 @@
1
+ module petstore {
2
+ namespace "http://autlan.dt/gribok/yang/example";
3
+ prefix ex;
4
+
5
+ revision 2020-04-01 {
6
+ description "Example yang";
7
+ }
8
+
9
+ container pets {
10
+ list dogs {
11
+ key name;
12
+ leaf name {
13
+ type string;
14
+ }
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,6 @@
1
+ const std = @import("std");
2
+ const warn = std.debug.warn;
3
+
4
+ fn add_floats(x: f16, y: f16) f16 {
5
+ return x + y;
6
+ }