aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-23 06:34:39 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-23 06:34:39 -0800
commit3282727dea3722cad8bcebd15390861b2938c7f8 (patch)
tree6ee29b400ad67d8de8fdf91768723ee2add688c2
parentc24141adbb26a3d93f5a00edbffa22075f3c2d71 (diff)
downloadbun-3282727dea3722cad8bcebd15390861b2938c7f8.tar.gz
bun-3282727dea3722cad8bcebd15390861b2938c7f8.tar.zst
bun-3282727dea3722cad8bcebd15390861b2938c7f8.zip
zig fmt
-rw-r--r--src/bun.js/api/html_rewriter.zig2
-rw-r--r--src/bun.js/event_loop.zig2
-rw-r--r--src/mdx/mdx_parser.zig86
-rw-r--r--src/sourcemap/sourcemap.zig1
4 files changed, 45 insertions, 46 deletions
diff --git a/src/bun.js/api/html_rewriter.zig b/src/bun.js/api/html_rewriter.zig
index 1dcb44f4f..e99e49f07 100644
--- a/src/bun.js/api/html_rewriter.zig
+++ b/src/bun.js/api/html_rewriter.zig
@@ -817,7 +817,7 @@ fn HandlerCallback(
) (fn (*HandlerType, *LOLHTMLType) bool) {
return struct {
pub fn callback(this: *HandlerType, value: *LOLHTMLType) bool {
- JSC.markBinding(@src());
+ JSC.markBinding(@src());
var zig_element = bun.default_allocator.create(ZigType) catch unreachable;
@field(zig_element, field_name) = value;
// At the end of this scope, the value is no longer valid
diff --git a/src/bun.js/event_loop.zig b/src/bun.js/event_loop.zig
index 22a016862..d83bd3575 100644
--- a/src/bun.js/event_loop.zig
+++ b/src/bun.js/event_loop.zig
@@ -132,7 +132,7 @@ pub fn IOTask(comptime Context: type) type {
pub fn deinit(this: *This) void {
var allocator = this.allocator;
this.ref.unref(this.event_loop.virtual_machine);
-
+
allocator.destroy(this);
}
};
diff --git a/src/mdx/mdx_parser.zig b/src/mdx/mdx_parser.zig
index 4261c0504..76a6ee8ef 100644
--- a/src/mdx/mdx_parser.zig
+++ b/src/mdx/mdx_parser.zig
@@ -98,48 +98,48 @@ pub const Block = struct {
}
pub const Tag = enum {
- /// <body>...</body>
+ /// <body>...</body>
doc,
- /// <blockquote>...</blockquote>
+ /// <blockquote>...</blockquote>
quote,
/// <ul>...</ul>
- ///Detail: Structure ul_detail.
+ ///Detail: Structure ul_detail.
ul,
/// <ol>...</ol>
- ///Detail: Structure ol_detail.
+ ///Detail: Structure ol_detail.
ol,
/// <li>...</li>
- ///Detail: Structure li_detail.
+ ///Detail: Structure li_detail.
li,
- /// <hr>
+ /// <hr>
hr,
/// <h1>...</h1> (for levels up to 6)
- ///Detail: Structure h_detail.
+ ///Detail: Structure h_detail.
h,
/// <pre><code>...</code></pre>
///Note the text lines within code blocks are terminated with '\n'
- ///instead of explicit MD_TEXT_BR.
+ ///instead of explicit MD_TEXT_BR.
code,
/// Raw HTML block. This itself does not correspond to any particular HTML
///tag. The contents of it _is_ raw HTML source intended to be put
- ///in verbatim form to the HTML output.
+ ///in verbatim form to the HTML output.
html,
- /// <p>...</p>
+ /// <p>...</p>
p,
/// <table>...</table> and its contents.
///Detail: Structure table_detail (for table),
/// structure td_detail (for th and td)
- ///Note all of these are used only if extension MD_FLAG_TABLES is enabled.
+ ///Note all of these are used only if extension MD_FLAG_TABLES is enabled.
table,
thead,
tbody,
@@ -164,7 +164,7 @@ pub const Block = struct {
task: bool = false,
/// is_task, then one of 'x', 'X' or ' '. Undefined otherwise.
task_mark: u8 = 'x',
- /// If is_task, then offset in the input of the char between '[' and ']'.
+ /// If is_task, then offset in the input of the char between '[' and ']'.
task_mark_off: u32 = 0,
};
@@ -178,11 +178,11 @@ pub const Block = struct {
};
pub const Table = struct {
- /// Count of columns in the table.
+ /// Count of columns in the table.
column_count: u32 = 0,
- /// Count of rows in the table header (currently always 1)
+ /// Count of rows in the table header (currently always 1)
head_row_count: u32 = 1,
- /// Count of rows in the table body
+ /// Count of rows in the table body
body_row_count: u32 = 0,
};
@@ -250,20 +250,20 @@ pub const Span = struct {
};
pub const Text = enum {
- /// Normal text.
+ /// Normal text.
normal,
/// NULL character. CommonMark requires replacing NULL character with
- /// the replacement char U+FFFD, so this allows caller to do that easily.
+ /// the replacement char U+FFFD, so this allows caller to do that easily.
nullchar,
/// Line breaks.
/// Note these are not sent from blocks with verbatim output (MD_BLOCK_CODE
- /// or MD_BLOCK_HTML). In such cases, '\n' is part of the text itself.
- /// <br> (hard break)
+ /// or MD_BLOCK_HTML). In such cases, '\n' is part of the text itself.
+ /// <br> (hard break)
br,
- /// '\n' in source text where it is not semantically meaningful (soft break)
+ /// '\n' in source text where it is not semantically meaningful (soft break)
softbr,
/// Entity.
- /// (a) Named entity, e.g. &nbsp;
+ /// (a) Named entity, e.g. &nbsp;
/// (Note MD4C does not have a list of known entities.
/// Anything matching the regexp /&[A-Za-z][A-Za-z0-9]{1,47};/ is
/// treated as a named entity.)
@@ -271,19 +271,19 @@ pub const Text = enum {
/// (c) Hexadecimal entity, e.g. &#x12AB;
///
/// As MD4C is mostly encoding agnostic, application gets the verbatim
- /// entity text into the MD_PARSER::text_callback().
+ /// entity text into the MD_PARSER::text_callback().
entity,
/// Text in a code block (inside MD_BLOCK_CODE) or inlined code (`code`).
/// If it is inside MD_BLOCK_CODE, it includes spaces for indentation and
/// '\n' for new lines. br and softbr are not sent for this
- /// kind of text.
+ /// kind of text.
code,
/// Text is a raw HTML. If it is contents of a raw HTML block (i.e. not
/// an inline raw HTML), then br and softbr are not used.
- /// The text contains verbatim '\n' for the new lines.
+ /// The text contains verbatim '\n' for the new lines.
html,
/// Text is inside an equation. This is processed the same way as inlined code
- /// spans (`code`).
+ /// spans (`code`).
latexmath,
};
pub const Align = enum(u3) {
@@ -339,15 +339,15 @@ pub const Mark = struct {
ch: u8 = 0,
flags: u16 = 0,
- /// Maybe closer.
+ /// Maybe closer.
pub const potential_closer = 0x02;
- /// Maybe opener.
+ /// Maybe opener.
pub const potential_opener = 0x01;
- /// Definitely opener.
+ /// Definitely opener.
pub const opener = 0x04;
- /// Definitely closer.
+ /// Definitely closer.
pub const closer = 0x08;
- /// Resolved in any definite way.
+ /// Resolved in any definite way.
pub const resolved = 0x10;
/// Helper for the "rule of 3". */
@@ -476,33 +476,33 @@ pub const MDParser = struct {
last_list_item_starts_with_two_blank_lines: bool = false,
pub const Flags = enum {
- /// In MD_TEXT_NORMAL, collapse non-trivial whitespace into single ' '
+ /// In MD_TEXT_NORMAL, collapse non-trivial whitespace into single ' '
collapse_whitespace,
- /// Do not require space in ATX headers ( ###header )
+ /// Do not require space in ATX headers ( ###header )
permissive_atxheaders,
- /// Recognize URLs as autolinks even without '<', '>'
+ /// Recognize URLs as autolinks even without '<', '>'
permissive_url_autolinks,
- /// Recognize e-mails as autolinks even without '<', '>' and 'mailto:'
+ /// Recognize e-mails as autolinks even without '<', '>' and 'mailto:'
permissive_email_autolinks,
- /// Disable indented code blocks. (Only fenced code works.)
+ /// Disable indented code blocks. (Only fenced code works.)
noindented_codeblocks,
- /// Disable raw HTML blocks.
+ /// Disable raw HTML blocks.
no_html_blocks,
- /// Disable raw HTML (inline).
+ /// Disable raw HTML (inline).
no_html_spans,
- /// Enable tables extension.
+ /// Enable tables extension.
tables,
- /// Enable strikethrough extension.
+ /// Enable strikethrough extension.
strikethrough,
- /// Enable WWW autolinks (even without any scheme prefix, if they begin with 'www.')
+ /// Enable WWW autolinks (even without any scheme prefix, if they begin with 'www.')
permissive_www_autolinks,
/// Enable task list extension.
tasklists,
- /// Enable $ and $$ containing LaTeX equations.
+ /// Enable $ and $$ containing LaTeX equations.
latex_mathspans,
- /// Enable wiki links extension.
+ /// Enable wiki links extension.
wikilinks,
- /// Enable underline extension (and disables '_' for normal emphasis).
+ /// Enable underline extension (and disables '_' for normal emphasis).
underline,
pub const Set = std.enums.EnumSet(Flags);
diff --git a/src/sourcemap/sourcemap.zig b/src/sourcemap/sourcemap.zig
index 92bd6189c..aa914332d 100644
--- a/src/sourcemap/sourcemap.zig
+++ b/src/sourcemap/sourcemap.zig
@@ -569,7 +569,6 @@ pub fn decodeVLQ(encoded: []const u8, start: usize) VLQResult {
}
pub const LineOffsetTable = struct {
-
/// The source map specification is very loose and does not specify what
/// column numbers actually mean. The popular "source-map" library from Mozilla
/// appears to interpret them as counts of UTF-16 code units, so we generate