Module: Herb

Defined in:
lib/herb.rb,
lib/herb.rb,
lib/herb/ast.rb,
lib/herb/range.rb,
lib/herb/token.rb,
lib/herb/colors.rb,
lib/herb/engine.rb,
lib/herb/errors.rb,
lib/herb/result.rb,
lib/herb/project.rb,
lib/herb/version.rb,
lib/herb/visitor.rb,
lib/herb/ast/node.rb,
lib/herb/location.rb,
lib/herb/position.rb,
lib/herb/warnings.rb,
lib/herb/ast/nodes.rb,
lib/herb/bootstrap.rb,
lib/herb/html/util.rb,
lib/herb/dev/runner.rb,
lib/herb/dev/server.rb,
lib/herb/lex_result.rb,
lib/herb/token_list.rb,
lib/herb/ast/helpers.rb,
lib/herb/diff_result.rb,
lib/herb/parse_result.rb,
lib/herb/configuration.rb,
lib/herb/prism_inspect.rb,
lib/herb/diff_operation.rb,
lib/herb/parser_options.rb,
lib/herb/engine/compiler.rb,
lib/herb/dev/server_entry.rb,
lib/herb/engine/validator.rb,
lib/herb/ast/erb_render_node.rb,
lib/herb/ast/erb_content_node.rb,
lib/herb/engine/debug_visitor.rb,
lib/herb/engine/error_formatter.rb,
lib/herb/engine/validation_errors.rb,
lib/herb/action_view/helper_registry.rb,
lib/herb/action_view/render_analyzer.rb,
lib/herb/engine/parser_error_overlay.rb,
lib/herb/engine/validation_error_overlay.rb,
lib/herb/engine/validators/render_validator.rb,
lib/herb/engine/validators/nesting_validator.rb,
lib/herb/engine/validators/security_validator.rb,
lib/herb/engine/validators/accessibility_validator.rb,
ext/herb/extension.c

Overview

NOTE: This file is generated by the templates/template.rb script and should not be modified manually. See /home/runner/work/herb/herb/templates/lib/herb/action_view/helper_registry.rb.erb

Defined Under Namespace

Modules: AST, ActionView, Bootstrap, Colors, Dev, Errors, HTML, PrismInspect, Warnings Classes: CLI, Configuration, DiffOperation, DiffResult, Engine, LexResult, Location, ParseResult, ParserOptions, Position, Project, Range, Result, Token, TokenList, Visitor

Constant Summary collapse

PARTIAL_EXTENSIONS =
[
  ".html.erb", ".html.herb", ".erb", ".herb", ".turbo_stream.erb", ".turbo_stream.herb"
].freeze
PARTIAL_GLOB_PATTERN =
"_*.{html.erb,html.herb,erb,herb,turbo_stream.erb,turbo_stream.herb}"
VERSION =
"0.10.1"

Class Method Summary collapse

Class Method Details

.arena_stats(*args) ⇒ Object



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'ext/herb/extension.c', line 248

static VALUE Herb_arena_stats(int argc, VALUE* argv, VALUE self) {
  VALUE source, options;
  rb_scan_args(argc, argv, "1:", &source, &options);

  char* string = (char*) check_string(source);

  parser_options_T parser_options = HERB_DEFAULT_PARSER_OPTIONS;

  if (!NIL_P(options)) {
    VALUE track_whitespace = rb_hash_lookup(options, rb_utf8_str_new_cstr("track_whitespace"));
    if (NIL_P(track_whitespace)) { track_whitespace = rb_hash_lookup(options, ID2SYM(rb_intern("track_whitespace"))); }
    if (!NIL_P(track_whitespace) && RTEST(track_whitespace)) { parser_options.track_whitespace = true; }

    VALUE analyze = rb_hash_lookup(options, rb_utf8_str_new_cstr("analyze"));
    if (NIL_P(analyze)) { analyze = rb_hash_lookup(options, ID2SYM(rb_intern("analyze"))); }
    if (!NIL_P(analyze) && !RTEST(analyze)) { parser_options.analyze = false; }

    VALUE strict = rb_hash_lookup(options, rb_utf8_str_new_cstr("strict"));
    if (NIL_P(strict)) { strict = rb_hash_lookup(options, ID2SYM(rb_intern("strict"))); }
    if (!NIL_P(strict)) { parser_options.strict = RTEST(strict); }
  }

  hb_allocator_T allocator;
  if (!hb_allocator_init(&allocator, HB_ALLOCATOR_ARENA)) { return Qnil; }

  AST_DOCUMENT_NODE_T* root = herb_parse(string, &parser_options, &allocator);

  hb_arena_stats_T stats = hb_arena_get_stats((hb_arena_T*) allocator.context);

  if (root != NULL) { ast_node_free((AST_NODE_T*) root, &allocator); }
  hb_allocator_destroy(&allocator);

  VALUE hash = rb_hash_new();
  rb_hash_aset(hash, ID2SYM(rb_intern("pages")), SIZET2NUM(stats.pages));
  rb_hash_aset(hash, ID2SYM(rb_intern("total_capacity")), SIZET2NUM(stats.total_capacity));
  rb_hash_aset(hash, ID2SYM(rb_intern("total_used")), SIZET2NUM(stats.total_used));
  rb_hash_aset(hash, ID2SYM(rb_intern("total_available")), SIZET2NUM(stats.total_available));
  rb_hash_aset(hash, ID2SYM(rb_intern("allocations")), SIZET2NUM(stats.allocations));
  rb_hash_aset(hash, ID2SYM(rb_intern("fragmentation")), SIZET2NUM(stats.fragmentation));
  rb_hash_aset(hash, ID2SYM(rb_intern("default_page_size")), SIZET2NUM(stats.default_page_size));

  return hash;
}

.configuration(project_path = nil) ⇒ Object



100
101
102
# File 'lib/herb.rb', line 100

def configuration(project_path = nil)
  @configuration ||= Configuration.load(project_path)
end

.configure(project_path = nil) ⇒ Object



104
105
106
# File 'lib/herb.rb', line 104

def configure(project_path = nil)
  @configuration = Configuration.load(project_path)
end

.dev_server_port(project_path = nil) ⇒ Object



112
113
114
115
116
117
118
119
120
# File 'lib/herb.rb', line 112

def dev_server_port(project_path = nil)
  require_relative "herb/dev/server_entry"

  project_path ||= Dir.pwd
  entry = Dev::ServerEntry.find_by_project(project_path)
  entry&.port
rescue StandardError
  nil
end

.diff(*args) ⇒ Object



482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
# File 'ext/herb/extension.c', line 482

static VALUE Herb_diff(int argc, VALUE* argv, VALUE self) {
  VALUE old_source, new_source;
  rb_scan_args(argc, argv, "2", &old_source, &new_source);

  char* old_string = (char*) check_string(old_source);
  char* new_string = (char*) check_string(new_source);

  diff_args_T args = { 0 };

  parser_options_T parser_options = HERB_DEFAULT_PARSER_OPTIONS;

  if (!hb_allocator_init(&args.old_allocator, HB_ALLOCATOR_ARENA)) { return Qnil; }

  if (!hb_allocator_init(&args.new_allocator, HB_ALLOCATOR_ARENA)) {
    hb_allocator_destroy(&args.old_allocator);

    return Qnil;
  }

  if (!hb_allocator_init(&args.diff_allocator, HB_ALLOCATOR_ARENA)) {
    hb_allocator_destroy(&args.old_allocator);
    hb_allocator_destroy(&args.new_allocator);

    return Qnil;
  }

  args.old_root = herb_parse(old_string, &parser_options, &args.old_allocator);
  args.new_root = herb_parse(new_string, &parser_options, &args.new_allocator);

  if (args.old_root == NULL || args.new_root == NULL) {
    diff_cleanup((VALUE) &args);

    return Qnil;
  }

  args.diff_result = herb_diff(args.old_root, args.new_root, &args.diff_allocator);

  return rb_ensure(diff_convert_body, (VALUE) &args, diff_cleanup, (VALUE) &args);
}

.ensure_installed(&block) ⇒ Object



122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/herb.rb', line 122

def ensure_installed(&block)
  require "bundler/inline"

  verbose = $VERBOSE
  $VERBOSE = nil

  gemfile(true, quiet: true) do # steep:ignore
    source "https://rubygems.org" # steep:ignore
    instance_eval(&block) # steep:ignore
  end
ensure
  $VERBOSE = verbose
end

.extract_html(source) ⇒ Object



232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'ext/herb/extension.c', line 232

static VALUE Herb_extract_html(VALUE self, VALUE source) {
  char* string = (char*) check_string(source);

  hb_allocator_T allocator;
  if (!hb_allocator_init(&allocator, HB_ALLOCATOR_ARENA)) { return Qnil; }

  hb_buffer_T output;
  if (!hb_buffer_init(&output, strlen(string), &allocator)) { return Qnil; }

  herb_extract_html_to_buffer(string, &output, &allocator);

  buffer_args_T args = { .buffer_value = output.value, .allocator = allocator };

  return rb_ensure(buffer_to_string_body, (VALUE) &args, buffer_cleanup, (VALUE) &args);
}

.extract_ruby(*args) ⇒ Object



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'ext/herb/extension.c', line 195

static VALUE Herb_extract_ruby(int argc, VALUE* argv, VALUE self) {
  VALUE source, options;
  rb_scan_args(argc, argv, "1:", &source, &options);

  char* string = (char*) check_string(source);

  hb_allocator_T allocator;
  if (!hb_allocator_init(&allocator, HB_ALLOCATOR_ARENA)) { return Qnil; }

  hb_buffer_T output;
  if (!hb_buffer_init(&output, strlen(string), &allocator)) { return Qnil; }

  herb_extract_ruby_options_T extract_options = HERB_EXTRACT_RUBY_DEFAULT_OPTIONS;

  if (!NIL_P(options)) {
    VALUE semicolons_value = rb_hash_lookup(options, rb_utf8_str_new_cstr("semicolons"));
    if (NIL_P(semicolons_value)) { semicolons_value = rb_hash_lookup(options, ID2SYM(rb_intern("semicolons"))); }
    if (!NIL_P(semicolons_value)) { extract_options.semicolons = RTEST(semicolons_value); }

    VALUE comments_value = rb_hash_lookup(options, rb_utf8_str_new_cstr("comments"));
    if (NIL_P(comments_value)) { comments_value = rb_hash_lookup(options, ID2SYM(rb_intern("comments"))); }
    if (!NIL_P(comments_value)) { extract_options.comments = RTEST(comments_value); }

    VALUE preserve_positions_value = rb_hash_lookup(options, rb_utf8_str_new_cstr("preserve_positions"));
    if (NIL_P(preserve_positions_value)) {
      preserve_positions_value = rb_hash_lookup(options, ID2SYM(rb_intern("preserve_positions")));
    }
    if (!NIL_P(preserve_positions_value)) { extract_options.preserve_positions = RTEST(preserve_positions_value); }
  }

  herb_extract_ruby_to_buffer_with_options(string, &output, &extract_options, &allocator);

  buffer_args_T args = { .buffer_value = output.value, .allocator = allocator };

  return rb_ensure(buffer_to_string_body, (VALUE) &args, buffer_cleanup, (VALUE) &args);
}

.leak_check(source) ⇒ Object



317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# File 'ext/herb/extension.c', line 317

static VALUE Herb_leak_check(VALUE self, VALUE source) {
  char* string = (char*) check_string(source);
  VALUE result = rb_hash_new();

  {
    hb_allocator_T allocator;
    if (!hb_allocator_init(&allocator, HB_ALLOCATOR_TRACKING)) { return Qnil; }

    hb_array_T* tokens = herb_lex(string, &allocator);
    if (tokens != NULL) { herb_free_tokens(&tokens, &allocator); }

    hb_allocator_tracking_stats_T* stats = hb_allocator_tracking_stats(&allocator);
    rb_hash_aset(result, ID2SYM(rb_intern("lex")), make_tracking_hash(stats));

    hb_allocator_destroy(&allocator);
  }

  {
    hb_allocator_T allocator;
    if (!hb_allocator_init(&allocator, HB_ALLOCATOR_TRACKING)) { return Qnil; }

    parser_options_T parser_options = HERB_DEFAULT_PARSER_OPTIONS;
    AST_DOCUMENT_NODE_T* root = herb_parse(string, &parser_options, &allocator);
    if (root != NULL) { ast_node_free((AST_NODE_T*) root, &allocator); }

    hb_allocator_tracking_stats_T* stats = hb_allocator_tracking_stats(&allocator);
    rb_hash_aset(result, ID2SYM(rb_intern("parse")), make_tracking_hash(stats));

    hb_allocator_destroy(&allocator);
  }

  {
    hb_allocator_T allocator;
    if (!hb_allocator_init(&allocator, HB_ALLOCATOR_TRACKING)) { return Qnil; }

    hb_buffer_T output;
    if (!hb_buffer_init(&output, strlen(string), &allocator)) { return Qnil; }

    herb_extract_ruby_options_T extract_options = HERB_EXTRACT_RUBY_DEFAULT_OPTIONS;
    herb_extract_ruby_to_buffer_with_options(string, &output, &extract_options, &allocator);

    hb_allocator_tracking_stats_T* stats = hb_allocator_tracking_stats(&allocator);
    rb_hash_aset(result, ID2SYM(rb_intern("extract_ruby")), make_tracking_hash(stats));

    hb_buffer_free(&output);
    hb_allocator_destroy(&allocator);
  }

  {
    hb_allocator_T allocator;
    if (!hb_allocator_init(&allocator, HB_ALLOCATOR_TRACKING)) { return Qnil; }

    hb_buffer_T output;
    if (!hb_buffer_init(&output, strlen(string), &allocator)) { return Qnil; }

    herb_extract_html_to_buffer(string, &output, &allocator);

    hb_allocator_tracking_stats_T* stats = hb_allocator_tracking_stats(&allocator);
    rb_hash_aset(result, ID2SYM(rb_intern("extract_html")), make_tracking_hash(stats));

    hb_buffer_free(&output);
    hb_allocator_destroy(&allocator);
  }

  return result;
}

.lex(*args) ⇒ Object



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'ext/herb/extension.c', line 86

static VALUE Herb_lex(int argc, VALUE* argv, VALUE self) {
  VALUE source, options;
  rb_scan_args(argc, argv, "1:", &source, &options);

  char* string = (char*) check_string(source);
  bool print_arena_stats = false;

  if (!NIL_P(options)) {
    VALUE arena_stats = rb_hash_lookup(options, rb_utf8_str_new_cstr("arena_stats"));
    if (NIL_P(arena_stats)) { arena_stats = rb_hash_lookup(options, ID2SYM(rb_intern("arena_stats"))); }
    if (!NIL_P(arena_stats) && RTEST(arena_stats)) { print_arena_stats = true; }
  }

  lex_args_T args = { 0 };
  args.source = source;

  if (!hb_allocator_init(&args.allocator, HB_ALLOCATOR_ARENA)) { return Qnil; }

  args.tokens = herb_lex(string, &args.allocator);

  if (print_arena_stats) { hb_arena_print_stats((hb_arena_T*) args.allocator.context); }

  return rb_ensure(lex_convert_body, (VALUE) &args, lex_cleanup, (VALUE) &args);
}

.lex_file(path) ⇒ Object

: (String path, ?arena_stats: bool) -> LexResult



84
85
86
# File 'lib/herb.rb', line 84

def lex_file(path, **)
  lex(File.read(path), **)
end

.parse(*args) ⇒ Object



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'ext/herb/extension.c', line 111

static VALUE Herb_parse(int argc, VALUE* argv, VALUE self) {
  VALUE source, options;
  rb_scan_args(argc, argv, "1:", &source, &options);

  char* string = (char*) check_string(source);
  bool print_arena_stats = false;

  parser_options_T parser_options = HERB_DEFAULT_PARSER_OPTIONS;

  if (!NIL_P(options)) {
    VALUE track_whitespace = rb_hash_lookup(options, rb_utf8_str_new_cstr("track_whitespace"));
    if (NIL_P(track_whitespace)) { track_whitespace = rb_hash_lookup(options, ID2SYM(rb_intern("track_whitespace"))); }
    if (!NIL_P(track_whitespace) && RTEST(track_whitespace)) { parser_options.track_whitespace = true; }

    VALUE analyze = rb_hash_lookup(options, rb_utf8_str_new_cstr("analyze"));
    if (NIL_P(analyze)) { analyze = rb_hash_lookup(options, ID2SYM(rb_intern("analyze"))); }
    if (!NIL_P(analyze) && !RTEST(analyze)) { parser_options.analyze = false; }

    VALUE strict = rb_hash_lookup(options, rb_utf8_str_new_cstr("strict"));
    if (NIL_P(strict)) { strict = rb_hash_lookup(options, ID2SYM(rb_intern("strict"))); }
    if (!NIL_P(strict)) { parser_options.strict = RTEST(strict); }

    VALUE action_view_helpers = rb_hash_lookup(options, rb_utf8_str_new_cstr("action_view_helpers"));
    if (NIL_P(action_view_helpers)) {
      action_view_helpers = rb_hash_lookup(options, ID2SYM(rb_intern("action_view_helpers")));
    }
    if (!NIL_P(action_view_helpers) && RTEST(action_view_helpers)) { parser_options.action_view_helpers = true; }

    VALUE transform_conditionals = rb_hash_lookup(options, rb_utf8_str_new_cstr("transform_conditionals"));
    if (NIL_P(transform_conditionals)) {
      transform_conditionals = rb_hash_lookup(options, ID2SYM(rb_intern("transform_conditionals")));
    }
    if (!NIL_P(transform_conditionals) && RTEST(transform_conditionals)) {
      parser_options.transform_conditionals = true;
    }

    VALUE dot_notation_tags = rb_hash_lookup(options, rb_utf8_str_new_cstr("dot_notation_tags"));
    if (NIL_P(dot_notation_tags)) {
      dot_notation_tags = rb_hash_lookup(options, ID2SYM(rb_intern("dot_notation_tags")));
    }
    if (!NIL_P(dot_notation_tags) && RTEST(dot_notation_tags)) { parser_options.dot_notation_tags = true; }

    VALUE render_nodes = rb_hash_lookup(options, rb_utf8_str_new_cstr("render_nodes"));
    if (NIL_P(render_nodes)) { render_nodes = rb_hash_lookup(options, ID2SYM(rb_intern("render_nodes"))); }
    if (!NIL_P(render_nodes) && RTEST(render_nodes)) { parser_options.render_nodes = true; }

    VALUE strict_locals = rb_hash_lookup(options, rb_utf8_str_new_cstr("strict_locals"));
    if (NIL_P(strict_locals)) { strict_locals = rb_hash_lookup(options, ID2SYM(rb_intern("strict_locals"))); }
    if (!NIL_P(strict_locals) && RTEST(strict_locals)) { parser_options.strict_locals = true; }

    VALUE prism_nodes = rb_hash_lookup(options, rb_utf8_str_new_cstr("prism_nodes"));
    if (NIL_P(prism_nodes)) { prism_nodes = rb_hash_lookup(options, ID2SYM(rb_intern("prism_nodes"))); }
    if (!NIL_P(prism_nodes) && RTEST(prism_nodes)) { parser_options.prism_nodes = true; }

    VALUE prism_nodes_deep = rb_hash_lookup(options, rb_utf8_str_new_cstr("prism_nodes_deep"));
    if (NIL_P(prism_nodes_deep)) { prism_nodes_deep = rb_hash_lookup(options, ID2SYM(rb_intern("prism_nodes_deep"))); }
    if (!NIL_P(prism_nodes_deep) && RTEST(prism_nodes_deep)) { parser_options.prism_nodes_deep = true; }

    VALUE prism_program = rb_hash_lookup(options, rb_utf8_str_new_cstr("prism_program"));
    if (NIL_P(prism_program)) { prism_program = rb_hash_lookup(options, ID2SYM(rb_intern("prism_program"))); }
    if (!NIL_P(prism_program) && RTEST(prism_program)) { parser_options.prism_program = true; }

    VALUE html = rb_hash_lookup(options, rb_utf8_str_new_cstr("html"));
    if (NIL_P(html)) { html = rb_hash_lookup(options, ID2SYM(rb_intern("html"))); }
    if (!NIL_P(html) && !RTEST(html)) { parser_options.html = false; }

    VALUE arena_stats = rb_hash_lookup(options, rb_utf8_str_new_cstr("arena_stats"));
    if (NIL_P(arena_stats)) { arena_stats = rb_hash_lookup(options, ID2SYM(rb_intern("arena_stats"))); }
    if (!NIL_P(arena_stats) && RTEST(arena_stats)) { print_arena_stats = true; }
  }

  parse_args_T args = { 0 };
  args.source = source;
  args.parser_options = &parser_options;

  if (!hb_allocator_init(&args.allocator, HB_ALLOCATOR_ARENA)) { return Qnil; }

  args.root = herb_parse(string, &parser_options, &args.allocator);

  if (print_arena_stats) { hb_arena_print_stats((hb_arena_T*) args.allocator.context); }

  return rb_ensure(parse_convert_body, (VALUE) &args, parse_cleanup, (VALUE) &args);
}

.parse_file(path) ⇒ Object

: (String path, ?track_whitespace: bool, ?analyze: bool, ?strict: bool, ?action_view_helpers: bool, ?transform_conditionals: bool, ?strict_locals: bool, ?prism_nodes: bool, ?prism_nodes_deep: bool, ?prism_program: bool, ?arena_stats: bool) -> ParseResult



89
90
91
# File 'lib/herb.rb', line 89

def parse_file(path, **)
  parse(File.read(path), **)
end

.parse_ruby(source) ⇒ Object

: (String source) -> Prism::ParseResult



94
95
96
97
98
# File 'lib/herb.rb', line 94

def parse_ruby(source)
  require "prism"

  Prism.parse(source)
end

.reset_configuration!Object



108
109
110
# File 'lib/herb.rb', line 108

def reset_configuration!
  @configuration = nil
end

.versionObject



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'ext/herb/extension.c', line 384

static VALUE Herb_version(VALUE self) {
  VALUE gem_version = rb_const_get(self, rb_intern("VERSION"));
  VALUE libherb_version = rb_utf8_str_new_cstr(herb_version());
  VALUE libprism_version = rb_utf8_str_new_cstr(herb_prism_version());

#ifdef HERB_GIT_BUILD
#  ifdef HERB_GIT_SHA
  VALUE format_string = rb_utf8_str_new_cstr(
    "herb gem " HERB_GIT_SHA ", libprism v%s, libherb " HERB_GIT_SHA " (Ruby C native extension, built from source)"
  );

  return rb_funcall(rb_mKernel, rb_intern("sprintf"), 2, format_string, libprism_version);
#  else
  VALUE format_string =
    rb_utf8_str_new_cstr("herb gem v%s, libprism v%s, libherb v%s (Ruby C native extension, built from source)");

  return rb_funcall(rb_mKernel, rb_intern("sprintf"), 4, format_string, gem_version, libprism_version, libherb_version);
#  endif
#else
  return rb_funcall(
    rb_mKernel,
    rb_intern("sprintf"),
    4,
    rb_utf8_str_new_cstr("herb gem v%s, libprism v%s, libherb v%s (Ruby C native extension)"),
    gem_version,
    libprism_version,
    libherb_version
  );
#endif
}