diff --git a/CHANGELOG.md b/CHANGELOG.md index 45a92d6..604947b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,42 @@ # herb-embedded Changelog Follows [Semantic Versioning](https://semver.org/). Gem version mirrors the vendored -`@herb-tools/linter` version plus a gem-side segment: `0.10.3.N` vendors `@herb-tools/linter@0.10.3`. +`@herb-tools/linter` version plus a gem-side segment: `0.11.1.N` vendors `@herb-tools/linter@0.11.1`. --- ## unreleased -(nothing yet) +### Changed + +* Upgraded the vendored `@herb-tools/linter` from 0.10.3 to 0.11.1 (and the `herb` gem + dependency to `~> 0.11.1`). The bundle now registers 170 rules, up from 100, including the + new Action View, ERB, HTML, SVG, Turbo, and UJS rules and the `herb-*` directive rules. +* `.herb.yml`'s top-level `framework` key is now read and passed to the engine. Rules scoped + to Action View only run when it is `actionview`; omitting it keeps upstream's `ruby` + default (and the informational `herb-config-framework-option` diagnostic). +* Explicit rule selection (`--only` / `Bridge#lint(rules:)`) now mirrors upstream's `--only`: + it bypasses framework, environment, and path filters, since naming a rule is itself the + answer to whether it should run. +* `ResultEnvelope` forwards the new parser options the 0.11 rule set uses: + `herb_directives`, `iteration_nodes`, and `erb_openers`. +* The bundle now includes `postcss` for the CSS/scoped-style rules. Its Node-only source-map + and terminal-color paths are replaced at build time with filesystem-free stubs + (`stubs/fs.mjs`, `stubs/path.mjs`, etc.), keeping the runtime free of Node built-ins. + +### Fixed + +* Added the `defaultERBOpenings` callback required by `HerbBackend` in Herb 0.11. + +### Conformance + +* Added a fixture for every newly registered rule (170 total). +* Two fixtures are marked pending rather than compared: `actionview-no-strict-locals-error` + and `actionview-no-mistyped-locals` need a project-wide partial index that the standalone + conformance harness does not build. `actionview-no-void-element-content` and + `erb-no-javascript-tag-helper` are asserted on the bridge only because upstream 0.11.1's + CLI computes parser options before merging the config's framework, so it cannot trigger + them even with `framework: actionview`. --- diff --git a/CHARTER.md b/CHARTER.md index e83a7fd..ff13748 100644 --- a/CHARTER.md +++ b/CHARTER.md @@ -2,7 +2,7 @@ ## What this is -herb-embedded runs [Herb](https://herb-tools.dev)'s real HTML+ERB lint rules — all 107 of +herb-embedded runs [Herb](https://herb-tools.dev)'s real HTML+ERB lint rules — all 170 of them, spanning accessibility, Action View, ERB, HTML, SVG, Turbo, and UJS, plus autofix — in a pure Ruby process, with no Node.js required at runtime. It does this by vendoring Herb's rule engine as JavaScript and executing it in-process through a pluggable embedded @@ -48,7 +48,7 @@ already sitting in the `herb` gem's native C extension the whole time. ## Out of scope -- **Porting rules to Ruby.** The 107 rules are imperative TypeScript, not data. Porting them +- **Porting rules to Ruby.** The 170 rules are imperative TypeScript, not data. Porting them forks the rule set the day it ships and it diverges from there. - **`herb format`.** The formatter is a separate package with its own semantics, and formatter bugs are more visible than linter bugs because they rewrite whole files. @@ -116,7 +116,7 @@ already sitting in the `herb` gem's native C extension the whole time. gates nothing under 0.x semver. `Bundle` records the exact `herb` gem versions it was validated against; `Bridge` checks at boot against that set. - **Gem version mirrors the vendored linter version, plus a gem-side segment:** - `herb-embedded 0.10.3.N` vendors `@herb-tools/linter@0.10.3`. `Gemfile.lock` then answers + `herb-embedded 0.11.1.N` vendors `@herb-tools/linter@0.11.1`. `Gemfile.lock` then answers "which rules do I have" unambiguously. - **Namespace `Herb::Embedded`; executable `herb-lint-rb`.** The `-rb` suffix lets it coexist with the npm `herb-lint` binary rather than shadowing it. @@ -164,7 +164,7 @@ already sitting in the `herb` gem's native C extension the whole time. `prism_program`/`prism_nodes`, see the Shape decisions entry above) are resolved; each had a named cause tracked as implementation work in `bd` (`herb-embedded-6dp` and related beads), not a design gap. `spec/conformance/conformance_spec.rb` now runs the differential - offense-for-offense diff against a hand-written fixture for every one of the 100 rules the + offense-for-offense diff against a hand-written fixture for every one of the 170 rules the vendored bundle registers (`herb-embedded-ag7`), gated so an upstream rule with no fixture fails the build — not just the 5 general-purpose fixtures from before. `.herb.yml` config application is unaffected by that work and still worth a look if it's ever suspected of diff --git a/CLAUDE.md b/CLAUDE.md index ff0ac30..cf53f61 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -124,11 +124,12 @@ Two shapes cross the Ruby/JS boundary, for two different reasons: self-describing versioned binary format, wrapped as `MiniRacer::Binary` so the adapter marshals it as a `Uint8Array`. -`Bridge` currently attaches **six** callbacks — `rbParse`, `rbLex`, -`rbExtractRuby`, `rbExtractHTML`, `rbParseRuby`, `rbVersion` — one per -`HerbBackend` method the bundle calls, not just the two (`parse`/`parseRuby`) -that matter for rule execution. The other three exist because `HerbBackend`'s -interface requires them, not because more rules depend on them. +`Bridge` currently attaches **seven** callbacks — `rbParse`, `rbLex`, +`rbExtractRuby`, `rbExtractHTML`, `rbDefaultERBOpenings`, `rbParseRuby`, +`rbVersion` — one per `HerbBackend` method the bundle calls, not just the two +(`parse`/`parseRuby`) that matter for rule execution. The other five exist +because `HerbBackend`'s interface requires them, not because more rules depend +on them. ### Extension points diff --git a/Gemfile.lock b/Gemfile.lock index 16dbef3..4794c85 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ PATH remote: . specs: - herb-embedded (0.10.3.0) - herb (~> 0.10.3) + herb-embedded (0.11.1.0) + herb (~> 0.11.1) mini_racer (~> 0.22) GEM @@ -13,13 +13,13 @@ GEM bundler (>= 1.2.0) thor (~> 1.0) diff-lcs (1.6.2) - herb (0.10.3) - herb (0.10.3-aarch64-linux-gnu) - herb (0.10.3-aarch64-linux-musl) - herb (0.10.3-arm64-darwin) - herb (0.10.3-x86_64-darwin) - herb (0.10.3-x86_64-linux-gnu) - herb (0.10.3-x86_64-linux-musl) + herb (0.11.1) + herb (0.11.1-aarch64-linux-gnu) + herb (0.11.1-aarch64-linux-musl) + herb (0.11.1-arm64-darwin) + herb (0.11.1-x86_64-darwin) + herb (0.11.1-x86_64-linux-gnu) + herb (0.11.1-x86_64-linux-musl) json (2.21.2) language_server-protocol (3.17.0.6) libv8-node (24.12.0.1) @@ -104,14 +104,14 @@ CHECKSUMS bundler (4.0.16) sha256=d6ca5dd440c24f9abce9844cf44cc8e18c6a553de65a47efb4544137af92c47d bundler-audit (0.9.3) sha256=81c8766c71e47d0d28a0f98c7eed028539f21a6ea3cd8f685eb6f42333c9b4e9 diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962 - herb (0.10.3) sha256=da76e8bfbb302586ee51a4fb608624f48218fbfea198a9493540b42f7654024b - herb (0.10.3-aarch64-linux-gnu) sha256=1eaea87e6577557492a1b0ddaae989fba8a8ddd382e888ee5f939ce6ded06eb8 - herb (0.10.3-aarch64-linux-musl) sha256=4ac7ccd194f8f284ffc7bf093676f5194cf0f44ea4a7d3888eac095e81c43e1f - herb (0.10.3-arm64-darwin) sha256=1a5bef57d925d775496328e7a01a9c1260e1d83bed8038b60a4f8c81b12c15a3 - herb (0.10.3-x86_64-darwin) sha256=e02e43b3bb1977f4fd08f3330b5f2aa3292ca2d572a8bd59688eca8b79725f46 - herb (0.10.3-x86_64-linux-gnu) sha256=cbb49b66f2bdc92d17109d1ea9452e88ba6a8ae52e9ddd5279deff83dcc4c66d - herb (0.10.3-x86_64-linux-musl) sha256=c84482d6b57f13c2e1a0fa029649efb0e5fdc876a3fd564bae09cf42bd4d5ae1 - herb-embedded (0.10.3.0) + herb (0.11.1) sha256=7a5a74c4931b341a2b7b7f5a530616801f5721a633d2655f002156ff553cd2d7 + herb (0.11.1-aarch64-linux-gnu) sha256=5484e0fc0bd5d040380cbbf503e86dccf3fc1d33428b7ad02715ee7dcaa018f9 + herb (0.11.1-aarch64-linux-musl) sha256=1113663d5e7832dad601547edb4606557ac84def516479ee5136fc7072747a58 + herb (0.11.1-arm64-darwin) sha256=c5d3c1d5f88a504bcfa6a4bb52f56650dc40345e23cdf051b02f3390cf184d9e + herb (0.11.1-x86_64-darwin) sha256=f73cad010299bf998bd4ead676b80ae2c1f0ff5487a2ef852e8d83652f74ced0 + herb (0.11.1-x86_64-linux-gnu) sha256=e3104c5dab07300a2ea6fc3898014cf57db978fbf09f5554a2a6ef6c46f973f8 + herb (0.11.1-x86_64-linux-musl) sha256=0c687b667b612e7cc2403e9991ee7c8e8d10cfef026cf41165f9d99284630b09 + herb-embedded (0.11.1.0) json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0 libv8-node (24.12.0.1) sha256=d93d23b861bfe5de3ba829e34a142402fb83b4c3592dd58d9ac4e027588d739a diff --git a/README.md b/README.md index 4005190..2f3f24e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # herb-embedded -Lints ERB templates with [Herb](https://herb-tools.dev)'s actual rule set — 100 built-in +Lints ERB templates with [Herb](https://herb-tools.dev)'s actual rule set — 170 built-in rules spanning accessibility, Action View, ERB, HTML, SVG, and Turbo markup, plus autofix — as a plain Ruby dependency. Nothing shells out to Node while it runs. @@ -77,7 +77,7 @@ Exit codes: `0` clean, `1` offenses found at or above the fail level, `2` a conf `bundle exec herb-lint-rb --init` writes a starter file: ```yaml -version: "0.10.3" +version: "0.11.1" files: include: - "**/*.html.erb" @@ -92,6 +92,9 @@ linter: informational, not enforced. - `files.include` / `files.exclude` are glob lists (relative to the directory `herb-lint-rb` runs from) that control which files a no-argument run discovers. +- `framework` tells the engine which framework's helpers and conventions to assume + (`ruby`, `actionview`, `hanami`, or `sinatra`). It defaults to `ruby` when absent; + Action View-specific rules only run when it is set to `actionview`. - `linter.fail_level` sets the default minimum severity that produces a non-zero exit code (overridable per-run with `--fail-level`). - `linter.rules..enabled: false` disables a built-in rule: @@ -103,8 +106,9 @@ linter: enabled: false ``` -Only these keys are read; any other key from upstream `@herb-tools/config`'s schema is parsed -but ignored, not an error. +Only these keys (`version`, `framework`, `files.include`, `files.exclude`, +`linter.fail_level`, and `linter.rules`) are read; any other key from upstream +`@herb-tools/config`'s schema is parsed but ignored, not an error. ## Custom rules diff --git a/herb-embedded.gemspec b/herb-embedded.gemspec index 524be4f..7774ba0 100644 --- a/herb-embedded.gemspec +++ b/herb-embedded.gemspec @@ -33,6 +33,6 @@ Gem::Specification.new do |spec| "rubygems_mfa_required" => "true", } - spec.add_dependency "herb", "~> 0.10.3" + spec.add_dependency "herb", "~> 0.11.1" spec.add_dependency "mini_racer", "~> 0.22" end diff --git a/js/entry.mjs b/js/entry.mjs index 354458c..c78408b 100644 --- a/js/entry.mjs +++ b/js/entry.mjs @@ -1,24 +1,16 @@ // Bundle entry point for vendor/herb-linter.js. Imports directly from -// dist/linter.js and dist/rules.js, bypassing @herb-tools/linter's -// package exports map — its exports map only exposes "." (the CLI's -// composed entry point, which pulls in cli.js), "./cli", and "./loader", -// none of which fit. Going straight to the dist files excludes the -// three files with Node built-in references: cli.js, lint-worker.js, -// and custom-rule-loader.js. -export * from "../node_modules/@herb-tools/linter/dist/linter.js"; -export * from "../node_modules/@herb-tools/linter/dist/rules.js"; - -// ParserRule/LexerRule/SourceRule (the base classes custom rules extend) -// live in dist/types.js, which dist/linter.js only partially imports -// (DEFAULT_RULE_CONFIG) without re-exporting the rest. types.js has no -// imports of its own — zero risk of pulling in Node builtins, unlike the -// package's main "." export (dist/index.js), which unconditionally -// imports "fs" and "path". -export * from "../node_modules/@herb-tools/linter/dist/types.js"; +// dist/index.js, bypassing @herb-tools/linter's package exports map — +// "." resolves to that same file in 0.11, but the public entry point is +// the only stable path across releases. The CLI and lint worker (the +// files full of Node built-in imports) live in dist/cli.js and +// dist/lint-worker.js, which this does not touch; the remaining Node +// references come from postcss and are replaced by build-time stubs (see +// rakelib/bundle.rake). +export * from "../node_modules/@herb-tools/linter/dist/index.js"; // @herb-tools/core's package exports map correctly exposes its ESM entry // (unlike @herb-tools/linter's), so this needs no exports-map bypass. It's -// already present in the bundle transitively (dist/linter.js imports from +// already present in the bundle transitively (dist/index.js imports from // it internally); re-exporting it by the same specifier lets esbuild // resolve both to the same module instance rather than duplicating it. // HerbBackend, ParseResult, LexResult, and friends aren't otherwise diff --git a/js/ruby_backend.js b/js/ruby_backend.js index fa4a4dc..a7cd013 100644 --- a/js/ruby_backend.js +++ b/js/ruby_backend.js @@ -1,5 +1,5 @@ // Wires the vendored @herb-tools/linter bundle to Ruby. Must load after -// vendor/herb-linter.js and after the six rbXxx callbacks below are +// vendor/herb-linter.js and after the seven rbXxx callbacks below are // attached (Bridge#boot handles the ordering). // // HerbBackend (from @herb-tools/core) must be subclassed: its `version` @@ -18,6 +18,9 @@ var libHerbBackend = { extractHTML: function (source) { return rbExtractHTML(source); }, + defaultERBOpenings: function () { + return rbDefaultERBOpenings(); + }, parseRuby: function (source) { return rbParseRuby(source); }, @@ -98,6 +101,22 @@ function __herbRuleNames() { }); } +// Rule metadata the Ruby side needs to reproduce upstream's framework +// scoping (e.g. so the conformance harness can lint an Action View rule +// under `framework: actionview`, the only framework it answers in). +function __herbRuleFrameworks() { + return HerbLinter.rules.map(function (ruleClass) { + var config; + try { + config = new ruleClass().defaultConfig; + } catch (e) { + config = null; + } + + return { name: ruleClass.ruleName, frameworks: (config && config.frameworks) || null }; + }); +} + // Rule selection happens before execution: Linter's constructor takes an // explicit rules array, so an unselected rule is never instantiated or // checked, not merely filtered out of the offenses it already produced. @@ -119,6 +138,19 @@ function __herbSelectRules(ruleNames) { }); } +// Mirrors Linter.from({ only }): naming rules explicitly must bypass the +// framework/environment/path filters that apply to a normal default run. +// Without this, `--only actionview-no-silent-render` stays silent because +// the context has no framework (so it defaults to "ruby") even though the +// caller asked for that rule by name. +function __herbApplyExplicitSelection(linter, ruleNames) { + if (ruleNames && ruleNames.length) { + linter.onlyRules = Array.from(new Set(ruleNames)); + } + + return linter; +} + // Registers a custom rule from Ruby-rewritten source (see // CustomRuleLoader.rewrite): an IIFE expression that destructures its // base class from HerbLinter and returns the rule class. A rule sharing @@ -158,10 +190,11 @@ function __herbRegisterCustomRule(rewrittenSource, path) { // it walks offenses from every selected rule together, unlike #lint's // per-rule crash isolation). The parse-doesn't-break safety check lives // on the Ruby side (Bridge#autofix), since it just needs Herb.parse. -function __herbAutofix(source, file, ruleNames, includeUnsafe) { +function __herbAutofix(source, file, ruleNames, includeUnsafe, framework) { var ruleClasses = __herbSelectRules(ruleNames); - var context = { fileName: file, filename: file }; + var context = { fileName: file, filename: file, framework: framework || undefined }; var linter = new HerbLinter.Linter(__herbEmbeddedBridge.instance, ruleClasses, undefined, HerbLinter.rules); + __herbApplyExplicitSelection(linter, ruleNames); var result = linter.autofix(source, context, undefined, { includeUnsafe: !!includeUnsafe }); return JSON.stringify({ source: result.source, fixed: result.fixed }); @@ -180,14 +213,15 @@ function __herbAutofix(source, file, ruleNames, includeUnsafe) { // left validRuleNames scoped to whatever single rule __herbLint happened // to be running, so the rule silently never matched anything outside // itself. Caught by conformance fixture coverage (herb-embedded-ag7). -function __herbLint(source, file, ruleNames) { +function __herbLint(source, file, ruleNames, framework) { var ruleClasses = __herbSelectRules(ruleNames); - var context = { fileName: file, filename: file }; + var context = { fileName: file, filename: file, framework: framework || undefined }; var offenses = []; ruleClasses.forEach(function (ruleClass) { try { var linter = new HerbLinter.Linter(__herbEmbeddedBridge.instance, [ruleClass], undefined, HerbLinter.rules); + __herbApplyExplicitSelection(linter, ruleNames); var result = linter.lint(source, context); offenses = offenses.concat(result.offenses); } catch (e) { diff --git a/lib/herb/embedded/bridge.rb b/lib/herb/embedded/bridge.rb index 477fe35..dc00282 100644 --- a/lib/herb/embedded/bridge.rb +++ b/lib/herb/embedded/bridge.rb @@ -10,7 +10,7 @@ module Herb module Embedded # Boots the JS engine: loads the host shim and vendored bundle, - # attaches the six Ruby callbacks HerbBackend needs, then loads the + # attaches the seven Ruby callbacks HerbBackend needs, then loads the # RubyBackend subclass and waits for its async init to resolve. class Bridge # Rescuing Herb::Embedded::Error catches any of these without also @@ -68,9 +68,18 @@ def rule_names @adapter.call("__herbRuleNames") end - def lint(source, file:, rules: nil) + # Rule name => list of frameworks the rule is scoped to (nil when + # it applies everywhere). Used by conformance to lint each rule the + # way upstream looks at it, and by callers that need to know + # whether a rule only answers under `framework: actionview`. + def rule_frameworks ensure_booted! - offenses = JSON.parse(@adapter.call("__herbLint", source, file, rules)) + @adapter.call("__herbRuleFrameworks").to_h { |entry| [entry["name"], entry["frameworks"]] } + end + + def lint(source, file:, rules: nil, framework: nil) + ensure_booted! + offenses = JSON.parse(@adapter.call("__herbLint", source, file, rules, framework)) offenses.map { |offense| Diagnostic.from_js(offense, file: file) } end @@ -83,9 +92,9 @@ def register_custom_rule(source, path) # parse into a user's working tree. If the fixed output fails to # parse while the original input parsed cleanly, the fix is # discarded rather than trusted. - def autofix(source, file:, rules: nil, unsafe: false) + def autofix(source, file:, rules: nil, unsafe: false, framework: nil) ensure_booted! - raw = JSON.parse(@adapter.call("__herbAutofix", source, file, rules, unsafe)) + raw = JSON.parse(@adapter.call("__herbAutofix", source, file, rules, unsafe, framework)) if source_parses?(source) && !source_parses?(raw["source"]) return { source: source, applied: [], discarded: true } @@ -106,10 +115,19 @@ def ensure_booted! end def attach_callbacks + attach_parse_callbacks + attach_ruby_callbacks + end + + def attach_parse_callbacks @adapter.attach("rbParse") { |source, options| ResultEnvelope.parse(source, options || {}) } @adapter.attach("rbLex") { |source| ResultEnvelope.lex(source) } @adapter.attach("rbExtractRuby") { |source, options| ::Herb.extract_ruby(source, **symbolize(options)) } @adapter.attach("rbExtractHTML") { |source| ::Herb.extract_html(source) } + end + + def attach_ruby_callbacks + @adapter.attach("rbDefaultERBOpenings") { ::Herb.default_erb_openings } @adapter.attach("rbParseRuby") { |source| EngineAdapter.binary(::Prism.dump(source)) } @adapter.attach("rbVersion") { ::Herb.version } end diff --git a/lib/herb/embedded/bundle.rb b/lib/herb/embedded/bundle.rb index b2b27e3..c30cd5d 100644 --- a/lib/herb/embedded/bundle.rb +++ b/lib/herb/embedded/bundle.rb @@ -4,8 +4,8 @@ module Herb module Embedded # The vendored @herb-tools/linter JS bundle (see rakelib/bundle.rake). module Bundle - LINTER_VERSION = "0.10.3" - HERB_VERSIONS = ["0.10.3"].freeze + LINTER_VERSION = "0.11.1" + HERB_VERSIONS = ["0.11.1"].freeze VENDOR_PATH = File.expand_path("../../../vendor/herb-linter.js", __dir__) diff --git a/lib/herb/embedded/config.rb b/lib/herb/embedded/config.rb index 9724c8b..8ecc705 100644 --- a/lib/herb/embedded/config.rb +++ b/lib/herb/embedded/config.rb @@ -6,8 +6,8 @@ module Herb module Embedded # Reads .herb.yml. The engine has no filesystem, so Ruby owns config # entirely. Uses the same nested schema as upstream @herb-tools/config - # (only version, files.include/exclude, linter.fail_level, and - # linter.rules..enabled are read; other upstream keys are + # (only version, framework, files.include/exclude, linter.fail_level, + # and linter.rules..enabled are read; other upstream keys are # parsed as inert and ignored, not errored on). class Config CONFIG_FILENAME = ".herb.yml" @@ -15,7 +15,7 @@ class Config DEFAULT_EXCLUDE_GLOBS = [].freeze DEFAULT_FAIL_LEVEL = :error - attr_reader :include_globs, :exclude_globs, :fail_level, :linter_version + attr_reader :include_globs, :exclude_globs, :fail_level, :linter_version, :framework def self.load(dir) path = File.join(dir, CONFIG_FILENAME) @@ -32,6 +32,7 @@ def initialize(data) @exclude_globs = files["exclude"] || DEFAULT_EXCLUDE_GLOBS.dup @fail_level = (linter["fail_level"] || DEFAULT_FAIL_LEVEL).to_sym @linter_version = data["version"] + @framework = data["framework"] @disabled_rule_names = disabled_rule_names(linter["rules"]) end diff --git a/lib/herb/embedded/result_envelope.rb b/lib/herb/embedded/result_envelope.rb index 60f1575..5df05fd 100644 --- a/lib/herb/embedded/result_envelope.rb +++ b/lib/herb/embedded/result_envelope.rb @@ -26,6 +26,9 @@ module ResultEnvelope transform_conditionals render_nodes strict_locals + herb_directives + iteration_nodes + erb_openers ].freeze module_function diff --git a/lib/herb/embedded/runner.rb b/lib/herb/embedded/runner.rb index c74634d..14f01ff 100644 --- a/lib/herb/embedded/runner.rb +++ b/lib/herb/embedded/runner.rb @@ -24,7 +24,7 @@ def run(paths = nil, rules: nil) Report.new.tap do |report| files_for(paths).each do |absolute_path| file = relative_path(absolute_path) - diagnostics = @bridge.lint(File.read(absolute_path), file: file, rules: rules) + diagnostics = @bridge.lint(File.read(absolute_path), file: file, rules: rules, framework: @config.framework) report.add(LintResult.new(file: file, diagnostics: diagnostics)) end end @@ -35,14 +35,7 @@ def fix(paths = nil, rules: nil, unsafe: false) Report.new.tap do |report| files_for(paths).each do |absolute_path| - file = relative_path(absolute_path) - original_source = File.read(absolute_path) - result = @bridge.autofix(original_source, file: file, rules: rules, unsafe: unsafe) - - File.write(absolute_path, result[:source]) if result[:source] != original_source - - diagnostics = @bridge.lint(result[:source], file: file, rules: rules) - report.add(LintResult.new(file: file, diagnostics: diagnostics)) + fix_file(absolute_path, report, rules: rules, unsafe: unsafe) end end end @@ -59,6 +52,23 @@ def load_custom_rules! private + def fix_file(absolute_path, report, rules:, unsafe:) + file = relative_path(absolute_path) + original_source = File.read(absolute_path) + result = @bridge.autofix( + original_source, + file: file, + rules: rules, + unsafe: unsafe, + framework: @config.framework, + ) + + File.write(absolute_path, result[:source]) if result[:source] != original_source + + diagnostics = @bridge.lint(result[:source], file: file, rules: rules, framework: @config.framework) + report.add(LintResult.new(file: file, diagnostics: diagnostics)) + end + def files_for(paths) return discover_files unless paths diff --git a/lib/herb/embedded/version.rb b/lib/herb/embedded/version.rb index 3e0efb0..f05759c 100644 --- a/lib/herb/embedded/version.rb +++ b/lib/herb/embedded/version.rb @@ -2,6 +2,6 @@ module Herb module Embedded - VERSION = "0.10.3.0" + VERSION = "0.11.1.0" end end diff --git a/package-lock.json b/package-lock.json index a57688a..e5187ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "herb-embedded-bundle-build", "devDependencies": { - "@herb-tools/linter": "0.10.3", + "@herb-tools/linter": "0.11.1", "dedent": "1.7.2", "esbuild": "0.28.2" } @@ -453,23 +453,45 @@ "node": ">=18" } }, + "node_modules/@herb-tools/analysis": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@herb-tools/analysis/-/analysis-0.11.1.tgz", + "integrity": "sha512-8KDK1n4PD1FWVNvTY9XmTKee5v01sqA1nqZHvj41sphrfPhPMU0b9J63Ui7gwIfe9EZuKFDYJPdFZDCTc/ofpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@herb-tools/core": "0.11.1", + "picomatch": "^4.0.7", + "tinyglobby": "^0.2.15" + }, + "peerDependencies": { + "@herb-tools/core": "0.11.1" + } + }, + "node_modules/@herb-tools/client": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@herb-tools/client/-/client-0.11.1.tgz", + "integrity": "sha512-CNneeRGATkVM3pN8mfhEVoi68gSdG0OLcOHhvUK4/hZgl7c0W35HirTHmerqQ4IeOcxc3BAnolh9ll55gcqSsQ==", + "dev": true, + "license": "MIT" + }, "node_modules/@herb-tools/config": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/@herb-tools/config/-/config-0.10.3.tgz", - "integrity": "sha512-cSaOwuWnij1wiB4Xh9Zfx/s+lhis7cN/+PXssanT/mXQLSRU2QeYasivyCQ1tRnpIVdGGOC/rqHVJQeNmj4pqg==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@herb-tools/config/-/config-0.11.1.tgz", + "integrity": "sha512-yZaRCuJZDwfokoqOA0rmjpZIAMQlAUmsaF1AUj/MvTeNTAU/urCPIg4oXYMg/fqme88pukis9ZpFd/T6icv+MA==", "dev": true, "license": "MIT", "dependencies": { - "@herb-tools/core": "0.10.3", - "picomatch": "^4.0.5", + "@herb-tools/core": "0.11.1", + "picomatch": "^4.0.7", "tinyglobby": "^0.2.16", - "yaml": "^2.9.0" + "yaml": "^2.9.1" } }, "node_modules/@herb-tools/core": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/@herb-tools/core/-/core-0.10.3.tgz", - "integrity": "sha512-rtDoh6C/EMYLEtFwYpuY+IlnV7PLsF5hQszq7uMDE/bwEpLVBlPFd2Wlk9E0RB31PVQKV1MwgGqstte87XqF9g==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@herb-tools/core/-/core-0.11.1.tgz", + "integrity": "sha512-vWqHV+wh/BXOfg8EUmUZTuojb+YcQy2atIhs5X8pS12YQHtZB3924Uv5yA/Z+OIGc8U3mO8B07UH53O07WbJsA==", "dev": true, "license": "MIT", "dependencies": { @@ -477,34 +499,39 @@ } }, "node_modules/@herb-tools/highlighter": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/@herb-tools/highlighter/-/highlighter-0.10.3.tgz", - "integrity": "sha512-vyBPl/oWalPcXrhni6RrQzeizzC0i7An3yMAg/Xx+4HDhgU/zOlRqSUYLU7SpzjfK4OU5QhRDdc3OBI8dT5qmg==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@herb-tools/highlighter/-/highlighter-0.11.1.tgz", + "integrity": "sha512-N+0b8fy8Xi4YNBklXVftWkJ56lXEI4MRix3BAtWGy6RdvLbMaS3KnC+Zck8hx7ZXPDyYz5y6WVwyZwt3TeuFKw==", "dev": true, "license": "MIT", "dependencies": { - "@herb-tools/core": "0.10.3", - "@herb-tools/node-wasm": "0.10.3" + "@herb-tools/core": "0.11.1", + "@herb-tools/node-wasm": "0.11.1", + "ansi_up": "^6.0.6" }, "bin": { "herb-highlight": "bin/herb-highlight" } }, "node_modules/@herb-tools/linter": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/@herb-tools/linter/-/linter-0.10.3.tgz", - "integrity": "sha512-uNwJZkzswJ/IcpsjbuEzOXQQcfc40KGy8Ao1L69na2J6H7b4LFig2OIZ22vJasGdv4jODWJWnMDozRvWuv1vFA==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@herb-tools/linter/-/linter-0.11.1.tgz", + "integrity": "sha512-y3rcYCZGHd39gPJN23GSSiXCJO/cXIEHz1z0AbmEhx9OLYKQuIX1UJeGfOr+bGberkFkOl7ypYfneZFGJAnBOQ==", "dev": true, "license": "MIT", "dependencies": { - "@herb-tools/config": "0.10.3", - "@herb-tools/core": "0.10.3", - "@herb-tools/highlighter": "0.10.3", - "@herb-tools/node-wasm": "0.10.3", - "@herb-tools/printer": "0.10.3", - "@herb-tools/rewriter": "0.10.3", + "@herb-tools/analysis": "0.11.1", + "@herb-tools/client": "0.11.1", + "@herb-tools/config": "0.11.1", + "@herb-tools/core": "0.11.1", + "@herb-tools/highlighter": "0.11.1", + "@herb-tools/node-wasm": "0.11.1", + "@herb-tools/printer": "0.11.1", + "@herb-tools/rewriter": "0.11.1", "@ruby/prism": "^1.9.0", - "picomatch": "^4.0.5", + "picomatch": "^4.0.7", + "postcss": "^8.5.29", + "postcss-selector-parser": "^7.1.6", "tinyglobby": "^0.2.15" }, "bin": { @@ -512,24 +539,26 @@ } }, "node_modules/@herb-tools/node-wasm": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/@herb-tools/node-wasm/-/node-wasm-0.10.3.tgz", - "integrity": "sha512-KUwHUMB6kluyvRiW0A9wbTiuO/qlvXLlSAnewmH2za7yePvYRSiThfAZEmXPqEmpmMRcIksFxaNaxUc6nBqyuA==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@herb-tools/node-wasm/-/node-wasm-0.11.1.tgz", + "integrity": "sha512-K/JBMe5ql6iFNOzS2GPL9z+xydrYHxn9MZafvXal/nAnfY6yNZLMfCsQED3FMKfOsQq4f8FSK2yhZrYYYn92lg==", "dev": true, "license": "MIT", "dependencies": { - "@herb-tools/core": "0.10.3", + "@herb-tools/core": "0.11.1", "@ruby/prism": "^1.9.0" } }, "node_modules/@herb-tools/printer": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/@herb-tools/printer/-/printer-0.10.3.tgz", - "integrity": "sha512-OuuIisERq3TLnms/Wm5N6w/ITYqlBPPLsc1FNHdN3qedPOA/ey1dF2rKewUzQAsAZheRCs5nem7tDYRhPb2D/Q==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@herb-tools/printer/-/printer-0.11.1.tgz", + "integrity": "sha512-2tgruUQkJQBu1Hl5wAApuyTWgoG7NkqatT4nTYdtTiNVrroz/gksRtZjN5FN+yQ8ijpDRGIBN9SNGKGOiJq16g==", "dev": true, "license": "MIT", "dependencies": { - "@herb-tools/core": "0.10.3", + "@herb-tools/config": "0.11.1", + "@herb-tools/core": "0.11.1", + "@herb-tools/node-wasm": "0.11.1", "tinyglobby": "^0.2.15" }, "bin": { @@ -537,36 +566,42 @@ } }, "node_modules/@herb-tools/rewriter": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/@herb-tools/rewriter/-/rewriter-0.10.3.tgz", - "integrity": "sha512-UsqWOJVcmB7lptLtjUeFpVvOn44LFae+I44p5ixQ9nDLNnZiN/2+R52tJmVLOWijQORvtMInCWOHrSvXF6Bf/g==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@herb-tools/rewriter/-/rewriter-0.11.1.tgz", + "integrity": "sha512-+CSgfK7oiJMqqbt38LGoPFvBVfBOFMWv9CpxKl7sRt967q2UeGhtjzhzb2suowboXJ5gDUDWPMf8cKCZfpXBjA==", "dev": true, "license": "MIT", "dependencies": { - "@herb-tools/core": "0.10.3", - "@herb-tools/tailwind-class-sorter": "0.10.3", + "@herb-tools/core": "0.11.1", + "@herb-tools/printer": "0.11.1", + "@herb-tools/tailwind-class-sorter": "0.11.1", "@ruby/prism": "^1.9.0", "tinyglobby": "^0.2.15" } }, "node_modules/@herb-tools/tailwind-class-sorter": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/@herb-tools/tailwind-class-sorter/-/tailwind-class-sorter-0.10.3.tgz", - "integrity": "sha512-KAowwSS6NmcRTQrQ591DR6dGI675KB0o/yxZt113BNDWiBB+bl4xdnd3hT19JV6Jsh3sS/0e90hYGUj/6PBW0g==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@herb-tools/tailwind-class-sorter/-/tailwind-class-sorter-0.11.1.tgz", + "integrity": "sha512-MBdTDXoRC0Nsz+VtiaAenl2LlIHfi9wuQeqg+F5rdrznsgvzc9DLCi76UflYFreNZ1j5ihRxF4fD19Sn31UenA==", "dev": true, "license": "MIT", "dependencies": { "clear-module": "^4.1.3", "escalade": "^3.2.0", "jiti": "^2.7.0", - "postcss": "^8.5.18", - "postcss-import": "^16.1.1" + "postcss": "^8.5.29", + "postcss-import": "^17.0.0" }, "engines": { "node": ">=14.21.3" }, "peerDependencies": { "tailwindcss": "^3.0 || ^4.0" + }, + "peerDependenciesMeta": { + "tailwindcss": { + "optional": true + } } }, "node_modules/@ruby/prism": { @@ -576,6 +611,16 @@ "dev": true, "license": "MIT" }, + "node_modules/ansi_up": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/ansi_up/-/ansi_up-6.0.6.tgz", + "integrity": "sha512-yIa1x3Ecf8jWP4UWEunNjqNX6gzE4vg2gGz+xqRGY+TBSucnYp6RRdPV4brmtg6bQ1ljD48mZ5iGSEj7QEpRKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -603,6 +648,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/dedent": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.2.tgz", @@ -722,13 +780,13 @@ } }, "node_modules/is-core-module": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", - "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.17.0.tgz", + "integrity": "sha512-J/vG0zBCbIKOQFfufSwyXdMrsohyJIUNkrnmo6WZGzoM7tr/lsbfW5b2BvisL6zsyMzK9UxV9L6c7AoFbyXHOA==", "dev": true, "license": "MIT", "dependencies": { - "hasown": "^2.0.3" + "hasown": "^2.0.4" }, "engines": { "node": ">= 0.4" @@ -748,9 +806,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.18", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz", - "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==", + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", "dev": true, "funding": [ { @@ -794,9 +852,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", - "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", "dev": true, "license": "MIT", "engines": { @@ -806,20 +864,10 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/postcss": { - "version": "8.5.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.26.tgz", - "integrity": "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==", + "version": "8.5.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.31.tgz", + "integrity": "sha512-YUbWYCgErwnMAVkjUnYa+KlMBzGpHwiIt/DE7f0G33AuX2LH9UcTk6KgWxd3zRU+pN3u/C+Xl3EnMLM4Hea7Sg==", "dev": true, "funding": [ { @@ -837,18 +885,18 @@ ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.17", + "nanoid": "^3.3.20", "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" + "source-map-js": "^1.2.2" }, "engines": { "node": "^10 || ^12 || >=14" } }, "node_modules/postcss-import": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-16.2.0.tgz", - "integrity": "sha512-0mQUGlSp87Zl70K58RNwQAN1WS9plFE6KWGui9nyK6ninduMyjW/Khaoy/BpBoFTBh7ndAvAKrSKVbwy6vd/BA==", + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-17.0.1.tgz", + "integrity": "sha512-lthLZRa+sMc/xo+lG7TMUvOviwP9ngR0VULnvfXTyOE3JIc0mFrbjcubI6Jx52X+B3IKt9yfp6wwVWE768JezA==", "dev": true, "license": "MIT", "dependencies": { @@ -857,12 +905,26 @@ "resolve": "^1.1.7" }, "engines": { - "node": ">=18.0.0" + "node": ">=22.0.0" }, "peerDependencies": { "postcss": "^8.0.0" } }, + "node_modules/postcss-selector-parser": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.7.tgz", + "integrity": "sha512-wWBro/7hJ40ye6TPiXkUQoXKCw23xSsjriUvqd7Uls9Sso3oLiON1flc18cCdnjgCRXw4fBVqUJJeOdDTh3P3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/postcss-value-parser": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", @@ -871,24 +933,21 @@ "license": "MIT" }, "node_modules/read-cache": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", - "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.2.tgz", + "integrity": "sha512-/peqiBB/n07gQGLsWaHho3WfvUyRscw0gYTsEFMhrIe/nWLkYaf5SbKYjGYqtRV3aPwykJgF2VEMo1ac4bnsGA==", "dev": true, - "license": "MIT", - "dependencies": { - "pify": "^2.3.0" - } + "license": "MIT" }, "node_modules/resolve": { - "version": "1.22.12", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz", - "integrity": "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==", + "version": "1.22.13", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.13.tgz", + "integrity": "sha512-Dj/cW9zBV2aRj6XzCxuGIs3ESZKv02jixne3q6jFZYZ3/Tg09gHHviSMDL4kObh9pqSahdRHEnDoaP2gn8YLhA==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", - "is-core-module": "^2.16.1", + "is-core-module": "^2.17.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -913,9 +972,9 @@ } }, "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -935,14 +994,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tailwindcss": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.3.tgz", - "integrity": "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ==", - "dev": true, - "license": "MIT", - "peer": true - }, "node_modules/tinyglobby": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", @@ -960,10 +1011,17 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, "node_modules/yaml": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", - "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz", + "integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==", "dev": true, "license": "ISC", "bin": { diff --git a/package.json b/package.json index 815d4e9..e35f9cc 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "private": true, "description": "Build-time only: vendors @herb-tools/linter into vendor/herb-linter.js. Node is required to build this gem, never to use it.", "devDependencies": { - "@herb-tools/linter": "0.10.3", + "@herb-tools/linter": "0.11.1", "dedent": "1.7.2", "esbuild": "0.28.2" } diff --git a/rakelib/bundle.rake b/rakelib/bundle.rake index ef611f5..7787478 100644 --- a/rakelib/bundle.rake +++ b/rakelib/bundle.rake @@ -17,7 +17,16 @@ namespace :bundle do "--format=iife", "--global-name=HerbLinter", "--platform=neutral", - "--alias:@herb-tools/config=./stubs/config.mjs", + "--main-fields=module,main", + # postcss (pulled in by the scoped-style and CSS rules in linter + # 0.11) reaches for Node built-ins it only needs for source maps + # and terminal colors. Alias those to our no-filesystem stubs; + # parsing in-memory CSS never takes those paths. + "--alias:path=./stubs/path.mjs", + "--alias:fs=./stubs/fs.mjs", + "--alias:url=./stubs/url.mjs", + "--alias:util=./stubs/util.mjs", + "--alias:picocolors=./stubs/picocolors.mjs", "--outfile=#{tmp_outfile}" node_builtin_reference = %r{ diff --git a/spec/bridge_lint_spec.rb b/spec/bridge_lint_spec.rb index 9e852e9..7e5287b 100644 --- a/spec/bridge_lint_spec.rb +++ b/spec/bridge_lint_spec.rb @@ -25,6 +25,26 @@ expect(bridge.rule_names.size).to be > 50 end + it "reports which frameworks a rule is scoped to" do + expect(bridge.rule_frameworks["erb-no-javascript-tag-helper"]).to eq(["actionview"]) + expect(bridge.rule_frameworks["html-no-space-in-tag"]).to be_nil + end + + it "threads framework: into the lint context, enabling Action View helper parsing" do + source = <<~ERB + <%= javascript_tag do %> + console.log("hi"); + <% end %> + ERB + + default_run = bridge.lint(source, file: "x.html.erb", rules: ["erb-no-javascript-tag-helper"]) + actionview_run = bridge.lint(source, file: "x.html.erb", rules: ["erb-no-javascript-tag-helper"], + framework: "actionview") + + expect(default_run).to be_empty + expect(actionview_run.map(&:rule)).to eq(["erb-no-javascript-tag-helper"]) + end + it "restricts execution to exactly the selected rules, confirmed by a side-channel instantiation count" do bridge diff --git a/spec/bundle_spec.rb b/spec/bundle_spec.rb index e4cb3bf..c447de0 100644 --- a/spec/bundle_spec.rb +++ b/spec/bundle_spec.rb @@ -34,14 +34,14 @@ end describe ".linter_version" do - it 'is "0.10.3"' do - expect(described_class.linter_version).to eq("0.10.3") + it 'is "0.11.1"' do + expect(described_class.linter_version).to eq("0.11.1") end end describe ".herb_versions" do - it 'is ["0.10.3"]' do - expect(described_class.herb_versions).to eq(["0.10.3"]) + it 'is ["0.11.1"]' do + expect(described_class.herb_versions).to eq(["0.11.1"]) end end end diff --git a/spec/config_spec.rb b/spec/config_spec.rb index a278f31..56cdf41 100644 --- a/spec/config_spec.rb +++ b/spec/config_spec.rb @@ -25,7 +25,7 @@ def with_herb_yml(contents) end it "returns documented defaults for keys omitted from a present .herb.yml" do - with_herb_yml("version: \"0.10.3\"\n") do |dir| + with_herb_yml("version: \"0.11.1\"\n") do |dir| config = described_class.load(dir) expect(config.include_globs).to eq(["**/*.html.erb", "**/*.herb"]) @@ -64,8 +64,22 @@ def with_herb_yml(contents) describe "#linter_version" do it "reads the top-level version key" do - with_herb_yml("version: \"0.10.3\"\n") do |dir| - expect(described_class.load(dir).linter_version).to eq("0.10.3") + with_herb_yml("version: \"0.11.1\"\n") do |dir| + expect(described_class.load(dir).linter_version).to eq("0.11.1") + end + end + end + + describe "#framework" do + it "reads the top-level framework key" do + with_herb_yml("framework: actionview\n") do |dir| + expect(described_class.load(dir).framework).to eq("actionview") + end + end + + it "is nil when omitted, leaving upstream's ruby default in place" do + with_herb_yml(nil) do |dir| + expect(described_class.load(dir).framework).to be_nil end end end diff --git a/spec/conformance/actionview.herb.yml b/spec/conformance/actionview.herb.yml new file mode 100644 index 0000000..bb14799 --- /dev/null +++ b/spec/conformance/actionview.herb.yml @@ -0,0 +1,2 @@ +version: "0.11.1" +framework: "actionview" diff --git a/spec/conformance/conformance_spec.rb b/spec/conformance/conformance_spec.rb index 0f82908..de64b01 100644 --- a/spec/conformance/conformance_spec.rb +++ b/spec/conformance/conformance_spec.rb @@ -10,7 +10,28 @@ CONFORMANCE_ROOT = File.expand_path("../..", __dir__) CONFORMANCE_REFERENCE_LINTER = File.join(CONFORMANCE_ROOT, "node_modules", ".bin", "herb-lint") CONFORMANCE_FIXTURES = Dir.glob(File.join(__dir__, "fixtures", "*.html.erb")) -CONFORMANCE_RULE_FIXTURES = Dir.glob(File.join(__dir__, "fixtures", "rules", "*.html.erb")) +CONFORMANCE_RULE_FIXTURES = ( + Dir.glob(File.join(__dir__, "fixtures", "rules", "*.html.erb")) + + Dir.glob(File.join(__dir__, "fixtures", "rules", "*.erb")) +).uniq +CONFORMANCE_ACTIONVIEW_CONFIG = File.join(__dir__, "actionview.herb.yml") +CONFORMANCE_ERB_FILES_CONFIG = File.join(__dir__, "erb-files.herb.yml") + +# Rules whose reference CLI run cannot exercise them in 0.11.1, with why. +# Their fixtures stay in place (the coverage gate still requires one per +# registered rule); the differential assertion is adjusted or skipped. +KNOWN_REFERENCE_GAPS = { + # Upstream 0.11.1 computes parser options from the per-file context's + # framework before merging in the config's framework, so the CLI never + # enables action_view_helpers even with `framework: actionview`. The + # bridge passes framework in the lint context, so it does trigger. + "actionview-no-void-element-content" => :upstream_parser_options, + "erb-no-javascript-tag-helper" => :upstream_parser_options, + # These answer cross-file questions from a PartialIndex built from the + # project tree; a standalone fixture has no partials to resolve. + "actionview-no-strict-locals-error" => :needs_partial_index, + "actionview-no-mistyped-locals" => :needs_partial_index, +}.freeze # A handful of rules (erb-no-instance-variables-in-partials and friends) # only enable themselves for partial files (basename starting with `_`), @@ -20,7 +41,7 @@ # method) since it's needed both at spec-definition time, to build each # `it` description, and at example-run time. def conformance_rule_name_for(fixture_path) - File.basename(fixture_path, ".html.erb").sub(/\A_/, "") + File.basename(fixture_path).sub(/\A_/, "").sub(/\.html\.erb\z/, "").sub(/\.erb\z/, "") end # Node at test time is acceptable — the guarantee this repo makes is @@ -35,22 +56,8 @@ def conformance_rule_name_for(fixture_path) after { adapter.dispose } - def reference_offenses(fixture_path, only: nil) - # --no-github: herb-lint auto-enables GitHub Actions annotations whenever - # GITHUB_ACTIONS=true is set (i.e. inside our own CI job), which then - # conflicts fatally with --json ("--github cannot be used with --json - # format"). Explicitly disabling it makes --json behavior independent of - # the invoking environment. - # - # --only ignores .herb.yml config entirely (including a rule's own - # defaultConfig.enabled), matching rules: [...] on the bridge side — - # both let a per-rule fixture exercise a not-enabled-by-default rule - # directly, the same way gu7/ada's Bridge#lint specs already do. - args = [ - CONFORMANCE_REFERENCE_LINTER, fixture_path, "--json", "--no-custom-rules", "--no-color", "--no-github", - "--jobs", "1" - ] - args += ["--only", only] if only + def reference_offenses(fixture_path, only: nil, framework: nil) + args = reference_args(fixture_path, only: only, framework: framework) stdout, stderr, status = Open3.capture3(*args, chdir: CONFORMANCE_ROOT) unless status.exitstatus.zero? || status.exitstatus == 1 @@ -64,9 +71,51 @@ def reference_offenses(fixture_path, only: nil) JSON.parse(stdout)["offenses"].map { |o| [o["code"], o["location"]["start"]["line"], o["location"]["start"]["column"]] } end - def bridge_offenses(fixture_path, rules: nil) + # --no-github: herb-lint auto-enables GitHub Actions annotations whenever + # GITHUB_ACTIONS=true is set (i.e. inside our own CI job), which then + # conflicts fatally with --json ("--github cannot be used with --json + # format"). Explicitly disabling it makes --json behavior independent of + # the invoking environment. + # + # --only ignores .herb.yml config entirely (including a rule's own + # defaultConfig.enabled), matching rules: [...] on the bridge side — + # both let a per-rule fixture exercise a not-enabled-by-default rule + # directly, the same way gu7/ada's Bridge#lint specs already do. + # + # Action View-scoped rules only see helper calls as elements under + # `framework: actionview`, which lives in a config file rather than a + # CLI flag. The framework config is passed only for those fixtures; a + # default (ruby) run is what the general fixtures compare against. + def reference_args(fixture_path, only:, framework:) + args = [ + CONFORMANCE_REFERENCE_LINTER, fixture_path, "--json", "--no-custom-rules", "--no-color", "--no-github", + "--jobs", "1" + ] + args += ["--config-file", CONFORMANCE_ACTIONVIEW_CONFIG] if framework == "actionview" + + # A format-less `.erb` file is outside the CLI's default file set + # (which is why erb-require-template-format needs this fixture at all); + # --force is the CLI's documented way to lint it anyway. + if fixture_path.end_with?(".erb") && !fixture_path.end_with?(".html.erb") + args += ["--config-file", CONFORMANCE_ERB_FILES_CONFIG, "--force"] + end + + args += ["--only", only] if only + args + end + + def bridge_offenses(fixture_path, rules: nil, framework: nil) source = File.read(fixture_path) - bridge.lint(source, file: File.basename(fixture_path), rules: rules).map { |d| [d.rule, d.line, d.column] } + bridge.lint(source, file: File.basename(fixture_path), rules: rules, framework: framework) + .map { |d| [d.rule, d.line, d.column] } + end + + # Action View rules are gated on the framework the file is linted as, + # and their parser options (action_view_helpers) are disabled outside + # it. Use the same framework the reference run is given. + def framework_for(rule) + frameworks = bridge.rule_frameworks[rule] + "actionview" if frameworks&.include?("actionview") end CONFORMANCE_FIXTURES.each do |fixture_path| @@ -102,8 +151,23 @@ def bridge_offenses(fixture_path, rules: nil) # rubocop:enable RSpec/LeakyLocalVariable it "matches npx @herb-tools/linter offense-for-offense on the #{rule} fixture, exercising the rule" do - reference = reference_offenses(fixture_path, only: rule).sort - actual = bridge_offenses(fixture_path, rules: [rule]).sort + framework = framework_for(rule) + + case KNOWN_REFERENCE_GAPS[rule] + when :upstream_parser_options + # The bridge should still find the offense even though the 0.11.1 + # CLI cannot (see the constant's comment). Asserting non-empty is + # the strongest check available without a working reference. + bridge_only = bridge_offenses(fixture_path, rules: [rule], framework: framework) + expect(bridge_only).not_to be_empty, + "Fixture #{File.basename(fixture_path)} no longer triggers #{rule} on the bridge either" + next + when :needs_partial_index + skip "needs a project-wide PartialIndex; the conformance harness has no cross-file context" + end + + reference = reference_offenses(fixture_path, only: rule, framework: framework).sort + actual = bridge_offenses(fixture_path, rules: [rule], framework: framework).sort expect(reference).not_to be_empty, "Fixture #{File.basename(fixture_path)} produced no reference offenses for " \ diff --git a/spec/conformance/erb-files.herb.yml b/spec/conformance/erb-files.herb.yml new file mode 100644 index 0000000..e8aa9e7 --- /dev/null +++ b/spec/conformance/erb-files.herb.yml @@ -0,0 +1,4 @@ +version: "0.11.1" +files: + include: + - "**/*.erb" diff --git a/spec/conformance/fixtures/rules/_actionview-no-redundant-local-assigns.html.erb b/spec/conformance/fixtures/rules/_actionview-no-redundant-local-assigns.html.erb new file mode 100644 index 0000000..f7f3ae9 --- /dev/null +++ b/spec/conformance/fixtures/rules/_actionview-no-redundant-local-assigns.html.erb @@ -0,0 +1,3 @@ +<%# locals: (user:) %> + +<%= local_assigns[:user].name %> diff --git a/spec/conformance/fixtures/rules/_actionview-no-unused-strict-locals.html.erb b/spec/conformance/fixtures/rules/_actionview-no-unused-strict-locals.html.erb new file mode 100644 index 0000000..e0176be --- /dev/null +++ b/spec/conformance/fixtures/rules/_actionview-no-unused-strict-locals.html.erb @@ -0,0 +1,4 @@ +<%# locals: (name:, age:) %> + +<%= name %> +FAIL actionview-prefer-collection-render: unsupported arg diff --git a/spec/conformance/fixtures/rules/a11y-no-visually-hidden-interactive-elements.html.erb b/spec/conformance/fixtures/rules/a11y-no-visually-hidden-interactive-elements.html.erb new file mode 100644 index 0000000..5d856e1 --- /dev/null +++ b/spec/conformance/fixtures/rules/a11y-no-visually-hidden-interactive-elements.html.erb @@ -0,0 +1 @@ + diff --git a/spec/conformance/fixtures/rules/actionview-no-content-argument-with-block.html.erb b/spec/conformance/fixtures/rules/actionview-no-content-argument-with-block.html.erb new file mode 100644 index 0000000..fdb9367 --- /dev/null +++ b/spec/conformance/fixtures/rules/actionview-no-content-argument-with-block.html.erb @@ -0,0 +1,3 @@ +<%= tag.div "Hello" do %> + World +<% end %> diff --git a/spec/conformance/fixtures/rules/actionview-no-dynamic-partial-path.html.erb b/spec/conformance/fixtures/rules/actionview-no-dynamic-partial-path.html.erb new file mode 100644 index 0000000..5729ac4 --- /dev/null +++ b/spec/conformance/fixtures/rules/actionview-no-dynamic-partial-path.html.erb @@ -0,0 +1 @@ +<%= render partial: "users/#{user.role}" %> diff --git a/spec/conformance/fixtures/rules/actionview-no-helper-shadowing.html.erb b/spec/conformance/fixtures/rules/actionview-no-helper-shadowing.html.erb new file mode 100644 index 0000000..38c11c5 --- /dev/null +++ b/spec/conformance/fixtures/rules/actionview-no-helper-shadowing.html.erb @@ -0,0 +1,3 @@ +<% @tags.each do |tag| %> + <%= tag.name %> +<% end %> diff --git a/spec/conformance/fixtures/rules/actionview-no-implicit-partial.html.erb b/spec/conformance/fixtures/rules/actionview-no-implicit-partial.html.erb new file mode 100644 index 0000000..9ba7c52 --- /dev/null +++ b/spec/conformance/fixtures/rules/actionview-no-implicit-partial.html.erb @@ -0,0 +1 @@ +<%= render @products %> diff --git a/spec/conformance/fixtures/rules/actionview-no-implicit-polymorphic-url.html.erb b/spec/conformance/fixtures/rules/actionview-no-implicit-polymorphic-url.html.erb new file mode 100644 index 0000000..b77f95f --- /dev/null +++ b/spec/conformance/fixtures/rules/actionview-no-implicit-polymorphic-url.html.erb @@ -0,0 +1 @@ +<%= link_to @profile %> diff --git a/spec/conformance/fixtures/rules/actionview-no-local-assigns.html.erb b/spec/conformance/fixtures/rules/actionview-no-local-assigns.html.erb new file mode 100644 index 0000000..787fb44 --- /dev/null +++ b/spec/conformance/fixtures/rules/actionview-no-local-assigns.html.erb @@ -0,0 +1 @@ +<%= local_assigns[:title] %> diff --git a/spec/conformance/fixtures/rules/actionview-no-mistyped-locals.html.erb b/spec/conformance/fixtures/rules/actionview-no-mistyped-locals.html.erb new file mode 100644 index 0000000..2c3cd0e --- /dev/null +++ b/spec/conformance/fixtures/rules/actionview-no-mistyped-locals.html.erb @@ -0,0 +1 @@ +<%= render "application/menu", open_initially: "yes" %> diff --git a/spec/conformance/fixtures/rules/actionview-no-render-option-shadowing.html.erb b/spec/conformance/fixtures/rules/actionview-no-render-option-shadowing.html.erb new file mode 100644 index 0000000..3e1f108 --- /dev/null +++ b/spec/conformance/fixtures/rules/actionview-no-render-option-shadowing.html.erb @@ -0,0 +1 @@ +<%= render "card", layout: "wide" %> diff --git a/spec/conformance/fixtures/rules/actionview-no-strict-locals-error.html.erb b/spec/conformance/fixtures/rules/actionview-no-strict-locals-error.html.erb new file mode 100644 index 0000000..ce0ac2d --- /dev/null +++ b/spec/conformance/fixtures/rules/actionview-no-strict-locals-error.html.erb @@ -0,0 +1 @@ +<%= render "users/card" %> diff --git a/spec/conformance/fixtures/rules/actionview-no-unnecessary-html-safe.html.erb b/spec/conformance/fixtures/rules/actionview-no-unnecessary-html-safe.html.erb new file mode 100644 index 0000000..361bf6d --- /dev/null +++ b/spec/conformance/fixtures/rules/actionview-no-unnecessary-html-safe.html.erb @@ -0,0 +1 @@ +
>
diff --git a/spec/conformance/fixtures/rules/actionview-prefer-collection-render.html.erb b/spec/conformance/fixtures/rules/actionview-prefer-collection-render.html.erb new file mode 100644 index 0000000..1339f64 --- /dev/null +++ b/spec/conformance/fixtures/rules/actionview-prefer-collection-render.html.erb @@ -0,0 +1,3 @@ +<% @users.each do |user| %> + <%= render "user", user: user %> +<% end %> diff --git a/spec/conformance/fixtures/rules/actionview-prefer-form-with.html.erb b/spec/conformance/fixtures/rules/actionview-prefer-form-with.html.erb new file mode 100644 index 0000000..01c6a27 --- /dev/null +++ b/spec/conformance/fixtures/rules/actionview-prefer-form-with.html.erb @@ -0,0 +1,3 @@ +<%= form_for @user do |form| %> + <%= form.text_field :name %> +<% end %> diff --git a/spec/conformance/fixtures/rules/actionview-prefer-link-to-helper.html.erb b/spec/conformance/fixtures/rules/actionview-prefer-link-to-helper.html.erb new file mode 100644 index 0000000..62d6dcc --- /dev/null +++ b/spec/conformance/fixtures/rules/actionview-prefer-link-to-helper.html.erb @@ -0,0 +1 @@ +Dashboard diff --git a/spec/conformance/fixtures/rules/actionview-prefer-pluralize-helper.html.erb b/spec/conformance/fixtures/rules/actionview-prefer-pluralize-helper.html.erb new file mode 100644 index 0000000..6166dd5 --- /dev/null +++ b/spec/conformance/fixtures/rules/actionview-prefer-pluralize-helper.html.erb @@ -0,0 +1 @@ +<%= aliases.size %><%= "Known Alias".pluralize(aliases.size) %> diff --git a/spec/conformance/fixtures/rules/actionview-prefer-qualified-partial-path.html.erb b/spec/conformance/fixtures/rules/actionview-prefer-qualified-partial-path.html.erb new file mode 100644 index 0000000..3f733c1 --- /dev/null +++ b/spec/conformance/fixtures/rules/actionview-prefer-qualified-partial-path.html.erb @@ -0,0 +1 @@ +<%= render "card" %> diff --git a/spec/conformance/fixtures/rules/erb-closing-tag-indent.html.erb b/spec/conformance/fixtures/rules/erb-closing-tag-indent.html.erb new file mode 100644 index 0000000..a9e26fa --- /dev/null +++ b/spec/conformance/fixtures/rules/erb-closing-tag-indent.html.erb @@ -0,0 +1,4 @@ +<%= render(<<~TEXT) + hello +TEXT + %> diff --git a/spec/conformance/fixtures/rules/erb-no-byte-order-mark.html.erb b/spec/conformance/fixtures/rules/erb-no-byte-order-mark.html.erb new file mode 100644 index 0000000..79ed011 --- /dev/null +++ b/spec/conformance/fixtures/rules/erb-no-byte-order-mark.html.erb @@ -0,0 +1 @@ +
hello
diff --git a/spec/conformance/fixtures/rules/erb-no-class-definitions.html.erb b/spec/conformance/fixtures/rules/erb-no-class-definitions.html.erb new file mode 100644 index 0000000..a980cf0 --- /dev/null +++ b/spec/conformance/fixtures/rules/erb-no-class-definitions.html.erb @@ -0,0 +1 @@ +<% class BadgeComponent < ViewComponent::Base; end %> diff --git a/spec/conformance/fixtures/rules/erb-no-method-definitions.html.erb b/spec/conformance/fixtures/rules/erb-no-method-definitions.html.erb new file mode 100644 index 0000000..12bd3f7 --- /dev/null +++ b/spec/conformance/fixtures/rules/erb-no-method-definitions.html.erb @@ -0,0 +1,3 @@ +<% def format_date(date) %> + <%= date.strftime("%B %d") %> +<% end %> diff --git a/spec/conformance/fixtures/rules/erb-no-module-definitions.html.erb b/spec/conformance/fixtures/rules/erb-no-module-definitions.html.erb new file mode 100644 index 0000000..dbc55df --- /dev/null +++ b/spec/conformance/fixtures/rules/erb-no-module-definitions.html.erb @@ -0,0 +1 @@ +<% module DisplayHelpers; end %> diff --git a/spec/conformance/fixtures/rules/erb-no-multiple-statements.html.erb b/spec/conformance/fixtures/rules/erb-no-multiple-statements.html.erb new file mode 100644 index 0000000..1240e2a --- /dev/null +++ b/spec/conformance/fixtures/rules/erb-no-multiple-statements.html.erb @@ -0,0 +1,3 @@ +<% posts.each do |post| %> + <% title = post.title; author = post.author %> +<% end %> diff --git a/spec/conformance/fixtures/rules/erb-no-return.html.erb b/spec/conformance/fixtures/rules/erb-no-return.html.erb new file mode 100644 index 0000000..26b1aab --- /dev/null +++ b/spec/conformance/fixtures/rules/erb-no-return.html.erb @@ -0,0 +1,2 @@ +<% return "" unless condition? %> +FAIL erb-no-shadowed-block-argument: unsupported arg diff --git a/spec/conformance/fixtures/rules/erb-no-shadowed-block-argument.html.erb b/spec/conformance/fixtures/rules/erb-no-shadowed-block-argument.html.erb new file mode 100644 index 0000000..7126729 --- /dev/null +++ b/spec/conformance/fixtures/rules/erb-no-shadowed-block-argument.html.erb @@ -0,0 +1,5 @@ +<% @groups.each do |item| %> + <% @items.each do |item| %> + <%= item %> + <% end %> +<% end %> diff --git a/spec/conformance/fixtures/rules/erb-no-sleep.html.erb b/spec/conformance/fixtures/rules/erb-no-sleep.html.erb new file mode 100644 index 0000000..073abba --- /dev/null +++ b/spec/conformance/fixtures/rules/erb-no-sleep.html.erb @@ -0,0 +1 @@ +<% sleep 2 %> diff --git a/spec/conformance/fixtures/rules/erb-no-unused-block-argument.html.erb b/spec/conformance/fixtures/rules/erb-no-unused-block-argument.html.erb new file mode 100644 index 0000000..81cece0 --- /dev/null +++ b/spec/conformance/fixtures/rules/erb-no-unused-block-argument.html.erb @@ -0,0 +1,3 @@ +<% @users.each do |user| %> +

Hello

+<% end %> diff --git a/spec/conformance/fixtures/rules/erb-no-unused-local-variable.html.erb b/spec/conformance/fixtures/rules/erb-no-unused-local-variable.html.erb new file mode 100644 index 0000000..b263d4a --- /dev/null +++ b/spec/conformance/fixtures/rules/erb-no-unused-local-variable.html.erb @@ -0,0 +1,3 @@ +<% number = posts.count %> + +New posts today: - diff --git a/spec/conformance/fixtures/rules/erb-prefer-do-end-blocks.html.erb b/spec/conformance/fixtures/rules/erb-prefer-do-end-blocks.html.erb new file mode 100644 index 0000000..5d58711 --- /dev/null +++ b/spec/conformance/fixtures/rules/erb-prefer-do-end-blocks.html.erb @@ -0,0 +1,5 @@ +<% @users.each { |user| %> +

<%= user.name %>

+<% } %> +FAIL erb-prefer-each-over-map: unsupported arg +FAIL erb-prefer-explicit-conditionals: unsupported arg diff --git a/spec/conformance/fixtures/rules/erb-prefer-each-over-map.html.erb b/spec/conformance/fixtures/rules/erb-prefer-each-over-map.html.erb new file mode 100644 index 0000000..e1ccc7b --- /dev/null +++ b/spec/conformance/fixtures/rules/erb-prefer-each-over-map.html.erb @@ -0,0 +1,3 @@ +<% @users.map do |user| %> +

<%= user.name %>

+<% end %> diff --git a/spec/conformance/fixtures/rules/erb-prefer-explicit-conditionals.html.erb b/spec/conformance/fixtures/rules/erb-prefer-explicit-conditionals.html.erb new file mode 100644 index 0000000..073d50d --- /dev/null +++ b/spec/conformance/fixtures/rules/erb-prefer-explicit-conditionals.html.erb @@ -0,0 +1 @@ +<%= avatar_for(user) if user.avatar? %> diff --git a/spec/conformance/fixtures/rules/erb-require-template-format.erb b/spec/conformance/fixtures/rules/erb-require-template-format.erb new file mode 100644 index 0000000..f95bef3 --- /dev/null +++ b/spec/conformance/fixtures/rules/erb-require-template-format.erb @@ -0,0 +1 @@ +

Home

diff --git a/spec/conformance/fixtures/rules/herb-component-requires-slots.html.erb b/spec/conformance/fixtures/rules/herb-component-requires-slots.html.erb new file mode 100644 index 0000000..0d53b94 --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-component-requires-slots.html.erb @@ -0,0 +1,4 @@ + +

<%= @value %>

+

waiting

+
diff --git a/spec/conformance/fixtures/rules/herb-config-framework-option.html.erb b/spec/conformance/fixtures/rules/herb-config-framework-option.html.erb new file mode 100644 index 0000000..db6d29e --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-config-framework-option.html.erb @@ -0,0 +1,4 @@ +
+

Hello

+
+SKIP herb-disable-comment-out-of-date: no test file diff --git a/spec/conformance/fixtures/rules/herb-disable-comment-out-of-date.html.erb b/spec/conformance/fixtures/rules/herb-disable-comment-out-of-date.html.erb new file mode 100644 index 0000000..5b39817 --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-disable-comment-out-of-date.html.erb @@ -0,0 +1,2 @@ +<%# herb:disable html-tag-name-lowercase 2 %> +
hello
diff --git a/spec/conformance/fixtures/rules/herb-into-requires-collection.html.erb b/spec/conformance/fixtures/rules/herb-into-requires-collection.html.erb new file mode 100644 index 0000000..4ada6b7 --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-into-requires-collection.html.erb @@ -0,0 +1,7 @@ +
    + <% @messages.each do |message| %> + <%# herb:key %> +
  • <%= message.body %>
  • + <% end %> +
+
diff --git a/spec/conformance/fixtures/rules/herb-scoped-style-no-unused-selector.html.erb b/spec/conformance/fixtures/rules/herb-scoped-style-no-unused-selector.html.erb new file mode 100644 index 0000000..63e30fb --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-scoped-style-no-unused-selector.html.erb @@ -0,0 +1,5 @@ + + +
Hi
diff --git a/spec/conformance/fixtures/rules/herb-scoped-style-require-top-level.html.erb b/spec/conformance/fixtures/rules/herb-scoped-style-require-top-level.html.erb new file mode 100644 index 0000000..3bec1bd --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-scoped-style-require-top-level.html.erb @@ -0,0 +1,4 @@ +
+ +

Hi

+
diff --git a/spec/conformance/fixtures/rules/herb-scoped-style-single-declaration.html.erb b/spec/conformance/fixtures/rules/herb-scoped-style-single-declaration.html.erb new file mode 100644 index 0000000..da9d92d --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-scoped-style-single-declaration.html.erb @@ -0,0 +1,3 @@ + +
Hi
+ diff --git a/spec/conformance/fixtures/rules/herb-slots-single-directive.html.erb b/spec/conformance/fixtures/rules/herb-slots-single-directive.html.erb new file mode 100644 index 0000000..981c70e --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-slots-single-directive.html.erb @@ -0,0 +1,3 @@ +<%# herb:slots client %> +
<%= @title %>
+<%# herb:slots server %> diff --git a/spec/conformance/fixtures/rules/herb-slots-valid-components.html.erb b/spec/conformance/fixtures/rules/herb-slots-valid-components.html.erb new file mode 100644 index 0000000..48824f4 --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-slots-valid-components.html.erb @@ -0,0 +1,4 @@ +<%# herb:slots client %> + +

<%= @value %>

+
diff --git a/spec/conformance/fixtures/rules/herb-slots-valid-mode.html.erb b/spec/conformance/fixtures/rules/herb-slots-valid-mode.html.erb new file mode 100644 index 0000000..21f549c --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-slots-valid-mode.html.erb @@ -0,0 +1,2 @@ +<%# herb:slots clien %> +
<%= @name %>
diff --git a/spec/conformance/fixtures/rules/herb-state-directive-syntax.html.erb b/spec/conformance/fixtures/rules/herb-state-directive-syntax.html.erb new file mode 100644 index 0000000..df32bc8 --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-state-directive-syntax.html.erb @@ -0,0 +1 @@ +<%#- herb:state (open: false) -%> diff --git a/spec/conformance/fixtures/rules/herb-state-no-server-writes.html.erb b/spec/conformance/fixtures/rules/herb-state-no-server-writes.html.erb new file mode 100644 index 0000000..e37b2ba --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-state-no-server-writes.html.erb @@ -0,0 +1,3 @@ +<%# herb:state (pending: false) %> +<% pending = true %> +<% if pending? %>Sending<% end %> diff --git a/spec/conformance/fixtures/rules/herb-state-no-shadowed-states.html.erb b/spec/conformance/fixtures/rules/herb-state-no-shadowed-states.html.erb new file mode 100644 index 0000000..0bba6d2 --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-state-no-shadowed-states.html.erb @@ -0,0 +1,4 @@ +<%# herb:state (track: "") %> +<% songs.each do |track| %> +

<%= track %>

+<% end %> diff --git a/spec/conformance/fixtures/rules/herb-state-no-silent-reads.html.erb b/spec/conformance/fixtures/rules/herb-state-no-silent-reads.html.erb new file mode 100644 index 0000000..9c7b01e --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-state-no-silent-reads.html.erb @@ -0,0 +1,4 @@ +<%# herb:slots client %> +<%# herb:state (draft: "") %> +<% draft %> + diff --git a/spec/conformance/fixtures/rules/herb-state-no-unused-states.html.erb b/spec/conformance/fixtures/rules/herb-state-no-unused-states.html.erb new file mode 100644 index 0000000..90e269d --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-state-no-unused-states.html.erb @@ -0,0 +1,3 @@ +<%# herb:state (open: false) %> +<%# open drives the menu %> +

static

diff --git a/spec/conformance/fixtures/rules/herb-state-requires-slots.html.erb b/spec/conformance/fixtures/rules/herb-state-requires-slots.html.erb new file mode 100644 index 0000000..b0d7217 --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-state-requires-slots.html.erb @@ -0,0 +1,2 @@ +<%# herb:state (open: false) %> +
diff --git a/spec/conformance/fixtures/rules/herb-state-single-declaration.html.erb b/spec/conformance/fixtures/rules/herb-state-single-declaration.html.erb new file mode 100644 index 0000000..2e590b0 --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-state-single-declaration.html.erb @@ -0,0 +1,5 @@ +<%# herb:slots client %> +<%# herb:state (open: false) %> +<%# herb:state (draft: "") %> +<% if open? %><% end %> + diff --git a/spec/conformance/fixtures/rules/herb-state-valid-actions.html.erb b/spec/conformance/fixtures/rules/herb-state-valid-actions.html.erb new file mode 100644 index 0000000..2120a16 --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-state-valid-actions.html.erb @@ -0,0 +1,2 @@ +<%# herb:state (open: false) %> + diff --git a/spec/conformance/fixtures/rules/herb-state-valid-bindings.html.erb b/spec/conformance/fixtures/rules/herb-state-valid-bindings.html.erb new file mode 100644 index 0000000..7b0bf36 --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-state-valid-bindings.html.erb @@ -0,0 +1,2 @@ +<%# herb:state (draft: "") %> + diff --git a/spec/conformance/fixtures/rules/herb-state-valid-declaration.html.erb b/spec/conformance/fixtures/rules/herb-state-valid-declaration.html.erb new file mode 100644 index 0000000..efd7c33 --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-state-valid-declaration.html.erb @@ -0,0 +1,2 @@ +<%# herb:state (pending:) %> +
diff --git a/spec/conformance/fixtures/rules/herb-state-valid-reads.html.erb b/spec/conformance/fixtures/rules/herb-state-valid-reads.html.erb new file mode 100644 index 0000000..56a78d0 --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-state-valid-reads.html.erb @@ -0,0 +1,2 @@ +<%# herb:state (count: 0) %> +<%= tag.button "More", data: { herb_increment: "count" }, title: count + 1 %> diff --git a/spec/conformance/fixtures/rules/herb-valid-slot-names.html.erb b/spec/conformance/fixtures/rules/herb-valid-slot-names.html.erb new file mode 100644 index 0000000..e290c5e --- /dev/null +++ b/spec/conformance/fixtures/rules/herb-valid-slot-names.html.erb @@ -0,0 +1 @@ +
<%= body %>
diff --git a/spec/conformance/fixtures/rules/html-attribute-name-valid-characters.html.erb b/spec/conformance/fixtures/rules/html-attribute-name-valid-characters.html.erb new file mode 100644 index 0000000..3d6e838 --- /dev/null +++ b/spec/conformance/fixtures/rules/html-attribute-name-valid-characters.html.erb @@ -0,0 +1 @@ +
diff --git a/spec/conformance/fixtures/rules/html-no-empty-css-rule.html.erb b/spec/conformance/fixtures/rules/html-no-empty-css-rule.html.erb new file mode 100644 index 0000000..f414b01 --- /dev/null +++ b/spec/conformance/fixtures/rules/html-no-empty-css-rule.html.erb @@ -0,0 +1,3 @@ + diff --git a/spec/conformance/fixtures/rules/html-no-event-handler-attributes.html.erb b/spec/conformance/fixtures/rules/html-no-event-handler-attributes.html.erb new file mode 100644 index 0000000..c67dce6 --- /dev/null +++ b/spec/conformance/fixtures/rules/html-no-event-handler-attributes.html.erb @@ -0,0 +1 @@ + diff --git a/spec/conformance/fixtures/rules/html-no-inline-script-elements.html.erb b/spec/conformance/fixtures/rules/html-no-inline-script-elements.html.erb new file mode 100644 index 0000000..c623cca --- /dev/null +++ b/spec/conformance/fixtures/rules/html-no-inline-script-elements.html.erb @@ -0,0 +1,3 @@ + diff --git a/spec/conformance/fixtures/rules/html-no-literal-nbsp.html.erb b/spec/conformance/fixtures/rules/html-no-literal-nbsp.html.erb new file mode 100644 index 0000000..8e4ac0f --- /dev/null +++ b/spec/conformance/fixtures/rules/html-no-literal-nbsp.html.erb @@ -0,0 +1 @@ +
hello there
diff --git a/spec/conformance/fixtures/rules/html-no-nested-forms.html.erb b/spec/conformance/fixtures/rules/html-no-nested-forms.html.erb new file mode 100644 index 0000000..78d4041 --- /dev/null +++ b/spec/conformance/fixtures/rules/html-no-nested-forms.html.erb @@ -0,0 +1,4 @@ +
+ +
+ diff --git a/spec/conformance/fixtures/rules/html-no-obsolete-tags.html.erb b/spec/conformance/fixtures/rules/html-no-obsolete-tags.html.erb new file mode 100644 index 0000000..0a5436b --- /dev/null +++ b/spec/conformance/fixtures/rules/html-no-obsolete-tags.html.erb @@ -0,0 +1 @@ +
Welcome
diff --git a/spec/conformance/fixtures/rules/html-no-style-attributes.html.erb b/spec/conformance/fixtures/rules/html-no-style-attributes.html.erb new file mode 100644 index 0000000..702a1c4 --- /dev/null +++ b/spec/conformance/fixtures/rules/html-no-style-attributes.html.erb @@ -0,0 +1 @@ + diff --git a/spec/conformance/fixtures/rules/html-no-style-elements.html.erb b/spec/conformance/fixtures/rules/html-no-style-elements.html.erb new file mode 100644 index 0000000..bc6ff4b --- /dev/null +++ b/spec/conformance/fixtures/rules/html-no-style-elements.html.erb @@ -0,0 +1,3 @@ + diff --git a/spec/conformance/fixtures/rules/svg-no-deprecated-tags.html.erb b/spec/conformance/fixtures/rules/svg-no-deprecated-tags.html.erb new file mode 100644 index 0000000..cca585b --- /dev/null +++ b/spec/conformance/fixtures/rules/svg-no-deprecated-tags.html.erb @@ -0,0 +1,4 @@ + + + + diff --git a/spec/conformance/fixtures/rules/turbo-permanent-no-misleading-value.html.erb b/spec/conformance/fixtures/rules/turbo-permanent-no-misleading-value.html.erb new file mode 100644 index 0000000..e0ee2e3 --- /dev/null +++ b/spec/conformance/fixtures/rules/turbo-permanent-no-misleading-value.html.erb @@ -0,0 +1 @@ +
1 item
diff --git a/spec/conformance/fixtures/rules/ujs-no-remote-attribute.html.erb b/spec/conformance/fixtures/rules/ujs-no-remote-attribute.html.erb new file mode 100644 index 0000000..d7080ef --- /dev/null +++ b/spec/conformance/fixtures/rules/ujs-no-remote-attribute.html.erb @@ -0,0 +1 @@ +Load posts diff --git a/spec/conformance/fixtures/rules/ujs-prefer-turbo-confirm.html.erb b/spec/conformance/fixtures/rules/ujs-prefer-turbo-confirm.html.erb new file mode 100644 index 0000000..ef4d3be --- /dev/null +++ b/spec/conformance/fixtures/rules/ujs-prefer-turbo-confirm.html.erb @@ -0,0 +1 @@ +Delete diff --git a/spec/conformance/fixtures/rules/ujs-prefer-turbo-method.html.erb b/spec/conformance/fixtures/rules/ujs-prefer-turbo-method.html.erb new file mode 100644 index 0000000..b86d0a1 --- /dev/null +++ b/spec/conformance/fixtures/rules/ujs-prefer-turbo-method.html.erb @@ -0,0 +1 @@ +Delete diff --git a/spec/conformance/fixtures/rules/ujs-prefer-turbo-submits-with.html.erb b/spec/conformance/fixtures/rules/ujs-prefer-turbo-submits-with.html.erb new file mode 100644 index 0000000..6479c02 --- /dev/null +++ b/spec/conformance/fixtures/rules/ujs-prefer-turbo-submits-with.html.erb @@ -0,0 +1 @@ + diff --git a/spec/result_envelope_spec.rb b/spec/result_envelope_spec.rb index d7b2261..8d7c1a6 100644 --- a/spec/result_envelope_spec.rb +++ b/spec/result_envelope_spec.rb @@ -14,6 +14,9 @@ transform_conditionals render_nodes strict_locals + herb_directives + iteration_nodes + erb_openers ]) end end diff --git a/spec/runner_spec.rb b/spec/runner_spec.rb index 241aa9b..416681a 100644 --- a/spec/runner_spec.rb +++ b/spec/runner_spec.rb @@ -39,7 +39,7 @@ def write(root, relative_path, contents) expect(report.files_checked).to eq(1) expect(report.diagnostics).not_to be_empty - expect(report.diagnostics.map(&:file)).to eq(["good.html.erb"]) + expect(report.diagnostics.map(&:file)).to all(eq("good.html.erb")) end end @@ -53,7 +53,7 @@ def write(root, relative_path, contents) report = runner.run([path]) expect(report.files_checked).to eq(1) - expect(report.diagnostics.map(&:file)).to eq(["explicit.html.erb"]) + expect(report.diagnostics.map(&:file)).to all(eq("explicit.html.erb")) end end @@ -71,6 +71,28 @@ def write(root, relative_path, contents) end end + it "passes the configured framework through to the engine" do + Dir.mktmpdir do |root| + write(root, "script.html.erb", <<~ERB) + <%= javascript_tag do %> + console.log("hi"); + <% end %> + ERB + + ruby_config = Herb::Embedded::Config.new("files" => { "include" => ["**/*.html.erb"] }) + actionview_config = Herb::Embedded::Config.new( + "framework" => "actionview", + "files" => { "include" => ["**/*.html.erb"] }, + ) + + ruby_report = described_class.new(root: root, config: ruby_config, bridge: bridge).run + actionview_report = described_class.new(root: root, config: actionview_config, bridge: bridge).run + + expect(ruby_report.diagnostics.map(&:rule)).not_to include("erb-no-javascript-tag-helper") + expect(actionview_report.diagnostics.map(&:rule)).to include("erb-no-javascript-tag-helper") + end + end + it "loads custom rules once per Runner instance, not reloaded on subsequent run/fix calls" do Dir.mktmpdir do |root| write(root, "clean.html.erb", "
hi
\n") diff --git a/stubs/config.mjs b/stubs/config.mjs deleted file mode 100644 index 70943a5..0000000 --- a/stubs/config.mjs +++ /dev/null @@ -1,10 +0,0 @@ -// Stands in for @herb-tools/config in the vendored bundle. The real -// package reads .herb.yml from disk (fs/path), which isn't available -// in a bare V8 context and isn't needed here — this gem reads config -// on the Ruby side (Task 8). Only resolveSeverity, the one export -// @herb-tools/linter's linter.js actually imports, is reproduced here, -// verbatim from @herb-tools/config@0.10.3's own implementation. -export function resolveSeverity(severity, mode) { - if (typeof severity === "string") return severity; - return severity[mode]; -} diff --git a/stubs/fs.mjs b/stubs/fs.mjs new file mode 100644 index 0000000..481bb8a --- /dev/null +++ b/stubs/fs.mjs @@ -0,0 +1,16 @@ +// Stands in for Node's "fs" module when bundling postcss for the bare V8 +// runtime. Only postcss's PreviousMap (source-map loading) imports it, and +// that path is unreachable when parsing in-memory CSS with no `from` +// option — as the linter does. Reporting "nothing on disk" matches a +// filesystem-free engine honestly rather than pretending reads succeeded. +export function existsSync() { + return false; +} + +export function readFileSync() { + throw new Error("herb-embedded: filesystem access is unavailable in the embedded engine"); +} + +export function realpathSync(path) { + return path; +} diff --git a/stubs/path.mjs b/stubs/path.mjs new file mode 100644 index 0000000..331027a --- /dev/null +++ b/stubs/path.mjs @@ -0,0 +1,30 @@ +// Stands in for Node's "path" module when bundling postcss for the bare +// V8 runtime. The linter only calls postcss.parse(css) with no `from` +// option, so none of postcss's source-map path handling is reachable; +// these implementations exist to satisfy postcss's module-level +// `pathAvailable` feature check and its (unused) code paths. Pure POSIX +// string handling — never touches a filesystem. +export function isAbsolute(path) { + return path.startsWith("/"); +} + +export function resolve(...parts) { + const joined = parts.filter(Boolean).join("/").replace(/\/+/g, "/"); + return joined.startsWith("/") ? joined : "/" + joined; +} + +export function dirname(path) { + const index = path.lastIndexOf("/"); + return index <= 0 ? "/" : path.slice(0, index); +} + +export function join(...parts) { + return parts.filter(Boolean).join("/").replace(/\/+/g, "/"); +} + +export function relative(from, to) { + if (to.startsWith(from + "/")) return to.slice(from.length + 1); + return to; +} + +export const sep = "/"; diff --git a/stubs/picocolors.mjs b/stubs/picocolors.mjs new file mode 100644 index 0000000..10f3346 --- /dev/null +++ b/stubs/picocolors.mjs @@ -0,0 +1,101 @@ +// Stands in for picocolors when bundling postcss for the bare V8 runtime. +// The embedded engine's output is never a TTY and herb-embedded's own +// formatters own color choices on the Ruby side, so every color function +// is the identity. postcss only consults these from CssSyntaxError +// formatting. +const identity = (value) => value; + +export const isColorSupported = false; +export const createColors = () => colorSet; + +export const reset = identity; +export const bold = identity; +export const dim = identity; +export const italic = identity; +export const underline = identity; +export const inverse = identity; +export const hidden = identity; +export const strikethrough = identity; +export const black = identity; +export const red = identity; +export const green = identity; +export const yellow = identity; +export const blue = identity; +export const magenta = identity; +export const cyan = identity; +export const white = identity; +export const gray = identity; +export const grey = identity; +export const blackBright = identity; +export const redBright = identity; +export const greenBright = identity; +export const yellowBright = identity; +export const blueBright = identity; +export const magentaBright = identity; +export const cyanBright = identity; +export const whiteBright = identity; +export const bgBlack = identity; +export const bgRed = identity; +export const bgGreen = identity; +export const bgYellow = identity; +export const bgBlue = identity; +export const bgMagenta = identity; +export const bgCyan = identity; +export const bgWhite = identity; +export const bgBlackBright = identity; +export const bgRedBright = identity; +export const bgGreenBright = identity; +export const bgYellowBright = identity; +export const bgBlueBright = identity; +export const bgMagentaBright = identity; +export const bgCyanBright = identity; +export const bgWhiteBright = identity; + +const colorSet = { + isColorSupported, + createColors, + reset, + bold, + dim, + italic, + underline, + inverse, + hidden, + strikethrough, + black, + red, + green, + yellow, + blue, + magenta, + cyan, + white, + gray, + grey, + blackBright, + redBright, + greenBright, + yellowBright, + blueBright, + magentaBright, + cyanBright, + whiteBright, + bgBlack, + bgRed, + bgGreen, + bgYellow, + bgBlue, + bgMagenta, + bgCyan, + bgWhite, + bgBlackBright, + bgRedBright, + bgGreenBright, + bgYellowBright, + bgBlueBright, + bgMagentaBright, + bgCyanBright, + bgWhiteBright, +}; + +export default colorSet; diff --git a/stubs/url.mjs b/stubs/url.mjs new file mode 100644 index 0000000..ff434ab --- /dev/null +++ b/stubs/url.mjs @@ -0,0 +1,6 @@ +// Stands in for Node's "url" module when bundling postcss for the bare V8 +// runtime. postcss guards every use with `if (pathToFileURL)` / +// `if (fileURLToPath)`, so exporting them as undefined disables its +// file-URL handling without pretending URLs are supported. +export const fileURLToPath = undefined; +export const pathToFileURL = undefined; diff --git a/stubs/util.mjs b/stubs/util.mjs new file mode 100644 index 0000000..bcd25f3 --- /dev/null +++ b/stubs/util.mjs @@ -0,0 +1,7 @@ +// Stands in for Node's "util" module when bundling for the bare V8 +// runtime. The only consumer is util-deprecate (via source-map-js's Node +// entry), which wraps a function to emit a one-time deprecation warning +// — irrelevant here, so the wrapper is the identity. +export function deprecate(fn) { + return fn; +} diff --git a/vendor/herb-linter.js b/vendor/herb-linter.js index 0012b40..367b687 100644 --- a/vendor/herb-linter.js +++ b/vendor/herb-linter.js @@ -5,6 +5,14 @@ var HerbLinter = (() => { var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; + var __esm = (fn, res, err) => function __init() { + if (err) throw err[0]; + try { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; + } catch (e) { + throw err = [e], e; + } + }; var __commonJS = (cb, mod) => function __require() { try { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; @@ -12,9 +20,9 @@ var HerbLinter = (() => { throw mod = 0, e; } }; - var __export = (target2, all) => { + var __export = (target, all) => { for (var name2 in all) - __defProp(target2, name2, { get: all[name2], enumerable: true }); + __defProp(target, name2, { get: all[name2], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { @@ -24,12 +32,12 @@ var HerbLinter = (() => { } return to; }; - var __toESM = (mod, isNodeMode, target2) => (target2 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target2, "default", { value: mod, enumerable: true }) : target2, + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); @@ -340,15 +348,15 @@ var HerbLinter = (() => { var isPathSeparator = (code) => { return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; }; - var depth = (token) => { - if (token.isPrefix !== true) { - token.depth = token.isGlobstar ? Infinity : 1; + var depth = (token2) => { + if (token2.isPrefix !== true) { + token2.depth = token2.isGlobstar ? Infinity : 1; } }; var scan = (input, options) => { const opts = options || {}; const length = input.length - 1; - const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const scanToEnd = opts.parts === true || opts.tokens === true || opts.scanToEnd === true; const slashes = []; const tokens = []; const parts = []; @@ -369,7 +377,7 @@ var HerbLinter = (() => { let braces = 0; let prev; let code; - let token = { value: "", depth: 0, isGlob: false }; + let token2 = { value: "", depth: 0, isGlob: false }; const eos = () => index >= length; const peek = () => str.charCodeAt(index + 1); const advance = () => { @@ -380,7 +388,7 @@ var HerbLinter = (() => { code = advance(); let next; if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; + backslashes = token2.backslashes = true; code = advance(); if (code === CHAR_LEFT_CURLY_BRACE) { braceEscaped = true; @@ -391,7 +399,7 @@ var HerbLinter = (() => { braces++; while (eos() !== true && (code = advance())) { if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; + backslashes = token2.backslashes = true; advance(); continue; } @@ -400,8 +408,8 @@ var HerbLinter = (() => { continue; } if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { - isBrace = token.isBrace = true; - isGlob = token.isGlob = true; + isBrace = token2.isBrace = true; + isGlob = token2.isGlob = true; finished = true; if (scanToEnd === true) { continue; @@ -409,8 +417,8 @@ var HerbLinter = (() => { break; } if (braceEscaped !== true && code === CHAR_COMMA) { - isBrace = token.isBrace = true; - isGlob = token.isGlob = true; + isBrace = token2.isBrace = true; + isGlob = token2.isGlob = true; finished = true; if (scanToEnd === true) { continue; @@ -421,7 +429,7 @@ var HerbLinter = (() => { braces--; if (braces === 0) { braceEscaped = false; - isBrace = token.isBrace = true; + isBrace = token2.isBrace = true; finished = true; break; } @@ -434,8 +442,8 @@ var HerbLinter = (() => { } if (code === CHAR_FORWARD_SLASH) { slashes.push(index); - tokens.push(token); - token = { value: "", depth: 0, isGlob: false }; + tokens.push(token2); + token2 = { value: "", depth: 0, isGlob: false }; if (finished === true) continue; if (prev === CHAR_DOT && index === start + 1) { start += 2; @@ -447,21 +455,25 @@ var HerbLinter = (() => { if (opts.noext !== true) { const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK; if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { - isGlob = token.isGlob = true; - isExtglob = token.isExtglob = true; + isGlob = token2.isGlob = true; + isExtglob = token2.isExtglob = true; finished = true; if (code === CHAR_EXCLAMATION_MARK && index === start) { negatedExtglob = true; } if (scanToEnd === true) { + let parens = 0; while (eos() !== true && (code = advance())) { if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - code = advance(); + backslashes = token2.backslashes = true; + advance(); + continue; + } + if (code === CHAR_LEFT_PARENTHESES) { + parens++; continue; } - if (code === CHAR_RIGHT_PARENTHESES) { - isGlob = token.isGlob = true; + if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) { finished = true; break; } @@ -472,8 +484,8 @@ var HerbLinter = (() => { } } if (code === CHAR_ASTERISK) { - if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; - isGlob = token.isGlob = true; + if (prev === CHAR_ASTERISK) isGlobstar = token2.isGlobstar = true; + isGlob = token2.isGlob = true; finished = true; if (scanToEnd === true) { continue; @@ -481,7 +493,7 @@ var HerbLinter = (() => { break; } if (code === CHAR_QUESTION_MARK) { - isGlob = token.isGlob = true; + isGlob = token2.isGlob = true; finished = true; if (scanToEnd === true) { continue; @@ -491,13 +503,13 @@ var HerbLinter = (() => { if (code === CHAR_LEFT_SQUARE_BRACKET) { while (eos() !== true && (next = advance())) { if (next === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; + backslashes = token2.backslashes = true; advance(); continue; } if (next === CHAR_RIGHT_SQUARE_BRACKET) { - isBracket = token.isBracket = true; - isGlob = token.isGlob = true; + isBracket = token2.isBracket = true; + isGlob = token2.isGlob = true; finished = true; break; } @@ -508,20 +520,25 @@ var HerbLinter = (() => { break; } if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { - negated = token.negated = true; + negated = token2.negated = true; start++; continue; } if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { - isGlob = token.isGlob = true; + isGlob = token2.isGlob = true; if (scanToEnd === true) { + let parens = 1; while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token2.backslashes = true; + advance(); + continue; + } if (code === CHAR_LEFT_PARENTHESES) { - backslashes = token.backslashes = true; - code = advance(); + parens++; continue; } - if (code === CHAR_RIGHT_PARENTHESES) { + if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) { finished = true; break; } @@ -587,39 +604,38 @@ var HerbLinter = (() => { if (opts.tokens === true) { state.maxDepth = 0; if (!isPathSeparator(code)) { - tokens.push(token); + tokens.push(token2); } state.tokens = tokens; } if (opts.parts === true || opts.tokens === true) { let prevIndex; for (let idx = 0; idx < slashes.length; idx++) { - const n = prevIndex ? prevIndex + 1 : start; + const n2 = prevIndex !== void 0 ? prevIndex + 1 : start; const i = slashes[idx]; - const value = input.slice(n, i); + const value2 = input.slice(n2, i); if (opts.tokens) { if (idx === 0 && start !== 0) { tokens[idx].isPrefix = true; tokens[idx].value = prefix; } else { - tokens[idx].value = value; + tokens[idx].value = value2; } depth(tokens[idx]); state.maxDepth += tokens[idx].depth; } - if (idx !== 0 || value !== "") { - parts.push(value); + if (i >= start) { + parts.push(value2); + prevIndex = i; } - prevIndex = i; } - if (prevIndex && prevIndex + 1 < input.length) { - const value = input.slice(prevIndex + 1); - parts.push(value); - if (opts.tokens) { - tokens[tokens.length - 1].value = value; - depth(tokens[tokens.length - 1]); - state.maxDepth += tokens[tokens.length - 1].depth; - } + const n = prevIndex !== void 0 ? prevIndex + 1 : start; + const value = input.slice(n); + parts.push(value); + if (opts.tokens && prevIndex && prevIndex + 1 < input.length) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; } state.slashes = slashes; state.parts = parts; @@ -652,7 +668,7 @@ var HerbLinter = (() => { try { new RegExp(value); } catch (ex) { - return args.map((v) => utils.escapeRegex(v)).join(".."); + return args.map((v3) => utils.escapeRegex(v3)).join(".."); } return value; }; @@ -739,14 +755,14 @@ var HerbLinter = (() => { var hasRepeatedCharPrefixOverlap = (branches) => { const values = branches.map(normalizeSimpleBranch).filter(Boolean); for (let i = 0; i < values.length; i++) { - for (let j = i + 1; j < values.length; j++) { + for (let j2 = i + 1; j2 < values.length; j2++) { const a = values[i]; - const b = values[j]; + const b3 = values[j2]; const char = a[0]; - if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) { + if (!char || a !== char.repeat(a.length) || b3 !== char.repeat(b3.length)) { continue; } - if (a === b || a.startsWith(b) || b.startsWith(a)) { + if (a === b3 || a.startsWith(b3) || b3.startsWith(a)) { return true; } } @@ -868,9 +884,9 @@ var HerbLinter = (() => { safeChars.push(...chars); continue; } - const literal = normalizeSimpleBranch(branch); - if (literal && literal.length === 1) { - safeChars.push(literal); + const literal2 = normalizeSimpleBranch(branch); + if (literal2 && literal2.length === 1) { + safeChars.push(literal2); continue; } combinable = false; @@ -883,7 +899,7 @@ var HerbLinter = (() => { } return { risky: false }; }; - var parse = (input, options) => { + var parse3 = (input, options) => { if (typeof input !== "string") { throw new TypeError("Expected a string"); } @@ -918,9 +934,9 @@ var HerbLinter = (() => { }; const nodot = opts.dot ? "" : NO_DOT; const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; - let star2 = opts.bash === true ? globstar(opts) : STAR; + let star = opts.bash === true ? globstar(opts) : STAR; if (opts.capture) { - star2 = `(${star2})`; + star = `(${star})`; } if (typeof opts.noext === "boolean") { opts.noextglob = opts.noext; @@ -953,13 +969,13 @@ var HerbLinter = (() => { const peek = state.peek = (n = 1) => input[state.index + n]; const advance = state.advance = () => input[++state.index] || ""; const remaining = () => input.slice(state.index + 1); - const consume = (value2 = "", num2 = 0) => { + const consume = (value2 = "", num = 0) => { state.consumed += value2; - state.index += num2; + state.index += num; }; - const append = (token) => { - state.output += token.output != null ? token.output : token.value; - consume(token.value); + const append = (token2) => { + state.output += token2.output != null ? token2.output : token2.value; + consume(token2.value); }; const negate = () => { let count = 1; @@ -991,7 +1007,7 @@ var HerbLinter = (() => { state.output = state.output.slice(0, -prev.output.length); prev.type = "star"; prev.value = "*"; - prev.output = star2; + prev.output = star; state.output += prev.output; } } @@ -1009,54 +1025,54 @@ var HerbLinter = (() => { prev = tok; }; const extglobOpen = (type, value2) => { - const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" }; - token.prev = prev; - token.parens = state.parens; - token.output = state.output; - token.startIndex = state.index; - token.tokensIndex = tokens.length; - const output = (opts.capture ? "(" : "") + token.open; + const token2 = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" }; + token2.prev = prev; + token2.parens = state.parens; + token2.output = state.output; + token2.startIndex = state.index; + token2.tokensIndex = tokens.length; + const output = (opts.capture ? "(" : "") + token2.open; increment("parens"); push({ type, value: value2, output: state.output ? "" : ONE_CHAR }); push({ type: "paren", extglob: true, value: advance(), output }); - extglobs.push(token); + extglobs.push(token2); }; - const extglobClose = (token) => { - const literal = input.slice(token.startIndex, state.index + 1); - const body = input.slice(token.startIndex + 2, state.index); + const extglobClose = (token2) => { + const literal2 = input.slice(token2.startIndex, state.index + 1); + const body = input.slice(token2.startIndex + 2, state.index); const analysis = analyzeRepeatedExtglob(body, opts); - if ((token.type === "plus" || token.type === "star") && analysis.risky) { - const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0; - const open = tokens[token.tokensIndex]; - open.type = "text"; - open.value = literal; - open.output = safeOutput || utils.escapeRegex(literal); - for (let i = token.tokensIndex + 1; i < tokens.length; i++) { + if ((token2.type === "plus" || token2.type === "star") && analysis.risky) { + const safeOutput = analysis.safeOutput ? (token2.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0; + const open2 = tokens[token2.tokensIndex]; + open2.type = "text"; + open2.value = literal2; + open2.output = safeOutput || utils.escapeRegex(literal2); + for (let i = token2.tokensIndex + 1; i < tokens.length; i++) { tokens[i].value = ""; tokens[i].output = ""; delete tokens[i].suffix; } - state.output = token.output + open.output; + state.output = token2.output + open2.output; state.backtrack = true; push({ type: "paren", extglob: true, value, output: "" }); decrement("parens"); return; } - let output = token.close + (opts.capture ? ")" : ""); + let output = token2.close + (opts.capture ? ")" : ""); let rest; - if (token.type === "negate") { - let extglobStar = star2; - if (token.inner && token.inner.length > 1 && token.inner.includes("/")) { + if (token2.type === "negate") { + let extglobStar = star; + if (token2.inner && token2.inner.length > 1 && token2.inner.includes("/")) { extglobStar = globstar(opts); } - if (extglobStar !== star2 || eos() || /^\)+$/.test(remaining())) { - output = token.close = `)$))${extglobStar}`; + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token2.close = `)$))${extglobStar}`; } - if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { - const expression = parse(rest, { ...options, fastpaths: false }).output; - output = token.close = `)${expression})${extglobStar})`; + if (token2.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + const expression = parse3(rest, { ...options, fastpaths: false }).output; + output = token2.close = `)${expression})${extglobStar})`; } - if (token.prev.type === "bos") { + if (token2.prev.type === "bos") { state.negatedExtglob = true; } } @@ -1065,14 +1081,14 @@ var HerbLinter = (() => { }; if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { let backslashes = false; - let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m2, esc2, chars, first, rest, index) => { if (first === "\\") { backslashes = true; - return m; + return m2; } if (first === "?") { - if (esc) { - return esc + first + (rest ? QMARK.repeat(rest.length) : ""); + if (esc2) { + return esc2 + first + (rest ? QMARK.repeat(rest.length) : ""); } if (index === 0) { return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ""); @@ -1083,19 +1099,19 @@ var HerbLinter = (() => { return DOT_LITERAL.repeat(chars.length); } if (first === "*") { - if (esc) { - return esc + first + (rest ? star2 : ""); + if (esc2) { + return esc2 + first + (rest ? star : ""); } - return star2; + return star; } - return esc ? m : `\\${m}`; + return esc2 ? m2 : `\\${m2}`; }); if (backslashes === true) { if (opts.unescape === true) { output = output.replace(/\\/g, ""); } else { - output = output.replace(/\\+/g, (m) => { - return m.length % 2 === 0 ? "\\\\" : m ? "\\" : ""; + output = output.replace(/\\+/g, (m2) => { + return m2.length % 2 === 0 ? "\\\\" : m2 ? "\\" : ""; }); } } @@ -1150,11 +1166,11 @@ var HerbLinter = (() => { prev.posix = true; if (inner.includes(":")) { const idx = prev.value.lastIndexOf("["); - const pre2 = prev.value.slice(0, idx); + const pre = prev.value.slice(0, idx); const rest2 = prev.value.slice(idx + 2); const posix = POSIX_REGEX_SOURCE[rest2]; if (posix) { - prev.value = pre2 + posix; + prev.value = pre + posix; state.backtrack = true; advance(); if (!bos.output && tokens.indexOf(prev) === 1) { @@ -1256,15 +1272,15 @@ var HerbLinter = (() => { } if (value === "{" && opts.nobrace !== true) { increment("braces"); - const open = { + const open2 = { type: "brace", value, output: "(", outputIndex: state.output.length, tokensIndex: state.tokens.length }; - braces.push(open); - push(open); + braces.push(open2); + push(open2); continue; } if (value === "}") { @@ -1276,17 +1292,17 @@ var HerbLinter = (() => { let output = ")"; if (brace.dots === true) { const arr = tokens.slice(); - const range2 = []; + const range = []; for (let i = arr.length - 1; i >= 0; i--) { tokens.pop(); if (arr[i].type === "brace") { break; } if (arr[i].type !== "dots") { - range2.unshift(arr[i].value); + range.unshift(arr[i].value); } } - output = expandRange(range2, opts); + output = expandRange(range, opts); state.backtrack = true; } if (brace.comma !== true && brace.dots !== true) { @@ -1424,7 +1440,7 @@ var HerbLinter = (() => { prev.type = "star"; prev.star = true; prev.value += value; - prev.output = star2; + prev.output = star; state.backtrack = true; state.globstar = true; consume(value); @@ -1462,6 +1478,7 @@ var HerbLinter = (() => { rest = rest.slice(3); consume("/**", 3); } + const isEnd = eos() || state.parens > 0 && rest === ")".repeat(state.parens) && !extglobs.some((extglob) => extglob.type === "negate"); if (prior.type === "bos" && eos()) { prev.type = "globstar"; prev.value += value; @@ -1471,7 +1488,7 @@ var HerbLinter = (() => { consume(value); continue; } - if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) { + if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && isEnd) { state.output = state.output.slice(0, -(prior.output + prev.output).length); prior.output = `(?:${prior.output}`; prev.type = "globstar"; @@ -1514,18 +1531,18 @@ var HerbLinter = (() => { consume(value); continue; } - const token = { type: "star", value, output: star2 }; + const token2 = { type: "star", value, output: star }; if (opts.bash === true) { - token.output = ".*?"; + token2.output = ".*?"; if (prev.type === "bos" || prev.type === "slash") { - token.output = nodot + token.output; + token2.output = nodot + token2.output; } - push(token); + push(token2); continue; } if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) { - token.output = value; - push(token); + token2.output = value; + push(token2); continue; } if (state.index === state.start || prev.type === "slash" || prev.type === "dot") { @@ -1544,7 +1561,7 @@ var HerbLinter = (() => { prev.output += ONE_CHAR; } } - push(token); + push(token2); } while (state.brackets > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]")); @@ -1566,16 +1583,16 @@ var HerbLinter = (() => { } if (state.backtrack === true) { state.output = ""; - for (const token of state.tokens) { - state.output += token.output != null ? token.output : token.value; - if (token.suffix) { - state.output += token.suffix; + for (const token2 of state.tokens) { + state.output += token2.output != null ? token2.output : token2.value; + if (token2.suffix) { + state.output += token2.suffix; } } } return state; }; - parse.fastpaths = (input, options) => { + parse3.fastpaths = (input, options) => { const opts = { ...options }; const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; const len = input.length; @@ -1598,32 +1615,32 @@ var HerbLinter = (() => { const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; const capture = opts.capture ? "" : "?:"; const state = { negated: false, prefix: "" }; - let star2 = opts.bash === true ? ".*?" : STAR; + let star = opts.bash === true ? ".*?" : STAR; if (opts.capture) { - star2 = `(${star2})`; + star = `(${star})`; } const globstar = (opts2) => { - if (opts2.noglobstar === true) return star2; + if (opts2.noglobstar === true) return star; return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; }; const create = (str) => { switch (str) { case "*": - return `${nodot}${ONE_CHAR}${star2}`; + return `${nodot}${ONE_CHAR}${star}`; case ".*": - return `${DOT_LITERAL}${ONE_CHAR}${star2}`; + return `${DOT_LITERAL}${ONE_CHAR}${star}`; case "*.*": - return `${nodot}${star2}${DOT_LITERAL}${ONE_CHAR}${star2}`; + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; case "*/*": - return `${nodot}${star2}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star2}`; + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; case "**": return nodot + globstar(opts); case "**/*": - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star2}`; + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; case "**/*.*": - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star2}${DOT_LITERAL}${ONE_CHAR}${star2}`; + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; case "**/.*": - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star2}`; + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; default: { const match = /^(.*?)\.(\w+)$/.exec(str); if (!match) return; @@ -1640,7 +1657,7 @@ var HerbLinter = (() => { } return source; }; - module.exports = parse; + module.exports = parse3; } }); @@ -1649,10 +1666,10 @@ var HerbLinter = (() => { "node_modules/picomatch/lib/picomatch.js"(exports, module) { "use strict"; var scan = require_scan(); - var parse = require_parse(); + var parse3 = require_parse(); var utils = require_utils(); var constants = require_constants(); - var isObject = (val) => val && typeof val === "object" && !Array.isArray(val); + var isObject2 = (val) => val && typeof val === "object" && !Array.isArray(val); var picomatch2 = (glob, options, returnState = false) => { if (Array.isArray(glob)) { const fns = glob.map((input) => picomatch2(input, options, returnState)); @@ -1665,7 +1682,7 @@ var HerbLinter = (() => { }; return arrayMatcher; } - const isState = isObject(glob) && glob.tokens && glob.input; + const isState = isObject2(glob) && glob.tokens && glob.input; if (glob === "" || typeof glob !== "string" && !isState) { throw new TypeError("Expected pattern to be a non-empty string"); } @@ -1736,8 +1753,8 @@ var HerbLinter = (() => { }; picomatch2.isMatch = (str, patterns, options) => picomatch2(patterns, options)(str); picomatch2.parse = (pattern, options) => { - if (Array.isArray(pattern)) return pattern.map((p) => picomatch2.parse(p, options)); - return parse(pattern, { ...options, fastpaths: false }); + if (Array.isArray(pattern)) return pattern.map((p2) => picomatch2.parse(p2, options)); + return parse3(pattern, { ...options, fastpaths: false }); }; picomatch2.scan = (input, options) => scan(input, options); picomatch2.compileRe = (state, options, returnOutput = false, returnState = false) => { @@ -1763,10 +1780,10 @@ var HerbLinter = (() => { } let parsed = { negated: false, fastpaths: true }; if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) { - parsed.output = parse.fastpaths(input, options); + parsed.output = parse3.fastpaths(input, options); } if (!parsed.output) { - parsed = parse(input, options); + parsed = parse3(input, options); } return picomatch2.compileRe(parsed, options, returnOutput, returnState); }; @@ -1801,2882 +1818,12250 @@ var HerbLinter = (() => { } }); - // js/entry.mjs - var entry_exports = {}; - __export(entry_exports, { - AST_TYPE_GUARDS: () => AST_TYPE_GUARDS, - CDATANode: () => CDATANode, - CHARACTER_REFERENCE_PATTERN: () => CHARACTER_REFERENCE_PATTERN, - ConditionalElementConditionMismatchError: () => ConditionalElementConditionMismatchError, - ConditionalElementMultipleTagsError: () => ConditionalElementMultipleTagsError, - DEFAULT_CONFIG: () => DEFAULT_CONFIG, - DEFAULT_EXTRACT_RUBY_OPTIONS: () => DEFAULT_EXTRACT_RUBY_OPTIONS, - DEFAULT_FRAMEWORK: () => DEFAULT_FRAMEWORK, - DEFAULT_LINTER_PARSER_OPTIONS: () => DEFAULT_LINTER_PARSER_OPTIONS, - DEFAULT_LINT_CONTEXT: () => DEFAULT_LINT_CONTEXT, - DEFAULT_PARSER_OPTIONS: () => DEFAULT_PARSER_OPTIONS, - DEFAULT_RULE_CONFIG: () => DEFAULT_RULE_CONFIG, - DEFAULT_TEMPLATE_ENGINE: () => DEFAULT_TEMPLATE_ENGINE, - DocumentNode: () => DocumentNode, - DotNotationCasingError: () => DotNotationCasingError, - ERBBeginNode: () => ERBBeginNode, - ERBBlockNode: () => ERBBlockNode, - ERBCaseMatchNode: () => ERBCaseMatchNode, - ERBCaseNode: () => ERBCaseNode, - ERBCaseWithConditionsError: () => ERBCaseWithConditionsError, - ERBContentNode: () => ERBContentNode, - ERBControlFlowScopeError: () => ERBControlFlowScopeError, - ERBElseNode: () => ERBElseNode, - ERBEndNode: () => ERBEndNode, - ERBEnsureNode: () => ERBEnsureNode, - ERBForNode: () => ERBForNode, - ERBIfNode: () => ERBIfNode, - ERBInNode: () => ERBInNode, - ERBMultipleBlocksInTagError: () => ERBMultipleBlocksInTagError, - ERBNodeClasses: () => ERBNodeClasses, - ERBOpenTagNode: () => ERBOpenTagNode, - ERBRenderNode: () => ERBRenderNode, - ERBRescueNode: () => ERBRescueNode, - ERBStrictLocalsNode: () => ERBStrictLocalsNode, - ERBUnlessNode: () => ERBUnlessNode, - ERBUntilNode: () => ERBUntilNode, - ERBWhenNode: () => ERBWhenNode, - ERBWhileNode: () => ERBWhileNode, - ERBYieldNode: () => ERBYieldNode, - HELPERS_BY_TAG_NAME: () => HELPERS_BY_TAG_NAME, - HELPER_BY_SOURCE: () => HELPER_BY_SOURCE, - HELPER_REGISTRY: () => HELPER_REGISTRY, - HTMLAttributeNameNode: () => HTMLAttributeNameNode, - HTMLAttributeNode: () => HTMLAttributeNode, - HTMLAttributeValueNode: () => HTMLAttributeValueNode, - HTMLCloseTagNode: () => HTMLCloseTagNode, - HTMLCommentNode: () => HTMLCommentNode, - HTMLConditionalElementNode: () => HTMLConditionalElementNode, - HTMLConditionalOpenTagNode: () => HTMLConditionalOpenTagNode, - HTMLDoctypeNode: () => HTMLDoctypeNode, - HTMLElementNode: () => HTMLElementNode, - HTMLOmittedCloseTagNode: () => HTMLOmittedCloseTagNode, - HTMLOpenTagNode: () => HTMLOpenTagNode, - HTMLTextNode: () => HTMLTextNode, - HTMLVirtualCloseTagNode: () => HTMLVirtualCloseTagNode, - HTML_BOOLEAN_ATTRIBUTES: () => HTML_BOOLEAN_ATTRIBUTES, - HTML_NAMED_CHARACTER_REFERENCES: () => HTML_NAMED_CHARACTER_REFERENCES, - HelperType: () => HelperType, - HerbBackend: () => HerbBackend, - HerbError: () => HerbError, - HerbWarning: () => HerbWarning, - InvalidCommentClosingTagError: () => InvalidCommentClosingTagError, - LexResult: () => LexResult, - LexerRule: () => LexerRule, - Linter: () => Linter, - LiteralNode: () => LiteralNode, - Location: () => Location, - MissingAttributeValueError: () => MissingAttributeValueError, - MissingClosingTagError: () => MissingClosingTagError, - MissingERBEndTagError: () => MissingERBEndTagError, - MissingOpeningTagError: () => MissingOpeningTagError, - NODE_TYPE_GUARDS: () => NODE_TYPE_GUARDS, - NestedERBTagError: () => NestedERBTagError, - Node: () => Node, - OmittedClosingTagError: () => OmittedClosingTagError, - ParseResult: () => ParseResult2, - ParserOptions: () => ParserOptions, - ParserRule: () => ParserRule, - Position: () => Position, - PrismBasicVisitor: () => PrismBasicVisitor, - PrismNodes: () => nodes_exports, - PrismVisitor: () => PrismVisitor, - Range: () => Range, - RenderAmbiguousLocalsError: () => RenderAmbiguousLocalsError, - RenderConflictingPartialError: () => RenderConflictingPartialError, - RenderInvalidAsOptionError: () => RenderInvalidAsOptionError, - RenderLayoutWithoutBlockError: () => RenderLayoutWithoutBlockError, - RenderMissingLocalsError: () => RenderMissingLocalsError, - RenderNoArgumentsError: () => RenderNoArgumentsError, - RenderObjectAndCollectionError: () => RenderObjectAndCollectionError, - Result: () => Result, - RubyHTMLAttributesSplatNode: () => RubyHTMLAttributesSplatNode, - RubyLiteralNode: () => RubyLiteralNode, - RubyParameterNode: () => RubyParameterNode, - RubyParseError: () => RubyParseError, - RubyRenderKeywordsNode: () => RubyRenderKeywordsNode, - RubyRenderLocalNode: () => RubyRenderLocalNode, - SourceRule: () => SourceRule, - StrayERBClosingTagError: () => StrayERBClosingTagError, - StrictLocalsBlockArgumentError: () => StrictLocalsBlockArgumentError, - StrictLocalsDuplicateDeclarationError: () => StrictLocalsDuplicateDeclarationError, - StrictLocalsMissingParenthesisError: () => StrictLocalsMissingParenthesisError, - StrictLocalsPositionalArgumentError: () => StrictLocalsPositionalArgumentError, - StrictLocalsSplatArgumentError: () => StrictLocalsSplatArgumentError, - TOKEN_LIST_ATTRIBUTES: () => TOKEN_LIST_ATTRIBUTES, - TagNamesMismatchError: () => TagNamesMismatchError, - TimeoutError: () => TimeoutError, - Token: () => Token, - TokenList: () => TokenList, - UnclosedCloseTagError: () => UnclosedCloseTagError, - UnclosedERBTagError: () => UnclosedERBTagError, - UnclosedElementError: () => UnclosedElementError, - UnclosedOpenTagError: () => UnclosedOpenTagError, - UnclosedQuoteError: () => UnclosedQuoteError, - UnexpectedError: () => UnexpectedError, - UnexpectedTokenError: () => UnexpectedTokenError, - VALID_FRAMEWORKS: () => VALID_FRAMEWORKS, - VALID_TEMPLATE_ENGINES: () => VALID_TEMPLATE_ENGINES, - Visitor: () => Visitor2, - VoidElementClosingTagError: () => VoidElementClosingTagError, - VoidElementContentError: () => VoidElementContentError, - WhitespaceNode: () => WhitespaceNode, - XMLDeclarationNode: () => XMLDeclarationNode, - _TYPECHECK: () => _TYPECHECK, - areAllOfType: () => areAllOfType, - createERBOutputNode: () => createERBOutputNode, - createERBSilentNode: () => createERBSilentNode, - createLiteral: () => createLiteral, - createSyntheticToken: () => createSyntheticToken, - createWhitespaceNode: () => createWhitespaceNode, - deserializeDiagnostic: () => deserializeDiagnostic, - deserializePrismNode: () => deserializePrismNode, - deserializePrismParseResult: () => deserializePrismParseResult, - didyoumean: () => didyoumean, - didyoumeanRanked: () => didyoumeanRanked, - ensureLibHerbBackend: () => ensureLibHerbBackend, - ensureString: () => ensureString, - filterCDATANodes: () => filterCDATANodes, - filterDocumentNodes: () => filterDocumentNodes, - filterERBBeginNodes: () => filterERBBeginNodes, - filterERBBlockNodes: () => filterERBBlockNodes, - filterERBCaseMatchNodes: () => filterERBCaseMatchNodes, - filterERBCaseNodes: () => filterERBCaseNodes, - filterERBContentNodes: () => filterERBContentNodes, - filterERBElseNodes: () => filterERBElseNodes, - filterERBEndNodes: () => filterERBEndNodes, - filterERBEnsureNodes: () => filterERBEnsureNodes, - filterERBForNodes: () => filterERBForNodes, - filterERBIfNodes: () => filterERBIfNodes, - filterERBInNodes: () => filterERBInNodes, - filterERBOpenTagNodes: () => filterERBOpenTagNodes, - filterERBRenderNodes: () => filterERBRenderNodes, - filterERBRescueNodes: () => filterERBRescueNodes, - filterERBStrictLocalsNodes: () => filterERBStrictLocalsNodes, - filterERBUnlessNodes: () => filterERBUnlessNodes, - filterERBUntilNodes: () => filterERBUntilNodes, - filterERBWhenNodes: () => filterERBWhenNodes, - filterERBWhileNodes: () => filterERBWhileNodes, - filterERBYieldNodes: () => filterERBYieldNodes, - filterHTMLAttributeNameNodes: () => filterHTMLAttributeNameNodes, - filterHTMLAttributeNodes: () => filterHTMLAttributeNodes, - filterHTMLAttributeValueNodes: () => filterHTMLAttributeValueNodes, - filterHTMLCloseTagNodes: () => filterHTMLCloseTagNodes, - filterHTMLCommentNodes: () => filterHTMLCommentNodes, - filterHTMLConditionalElementNodes: () => filterHTMLConditionalElementNodes, - filterHTMLConditionalOpenTagNodes: () => filterHTMLConditionalOpenTagNodes, - filterHTMLDoctypeNodes: () => filterHTMLDoctypeNodes, - filterHTMLElementNodes: () => filterHTMLElementNodes, - filterHTMLOmittedCloseTagNodes: () => filterHTMLOmittedCloseTagNodes, - filterHTMLOpenTagNodes: () => filterHTMLOpenTagNodes, - filterHTMLTextNodes: () => filterHTMLTextNodes, - filterHTMLVirtualCloseTagNodes: () => filterHTMLVirtualCloseTagNodes, - filterLiteralNodes: () => filterLiteralNodes, - filterNodes: () => filterNodes, - filterRubyHTMLAttributesSplatNodes: () => filterRubyHTMLAttributesSplatNodes, - filterRubyLiteralNodes: () => filterRubyLiteralNodes, - filterRubyParameterNodes: () => filterRubyParameterNodes, - filterRubyRenderKeywordsNodes: () => filterRubyRenderKeywordsNodes, - filterRubyRenderLocalNodes: () => filterRubyRenderLocalNodes, - filterWhitespaceNodes: () => filterWhitespaceNodes, - filterXMLDeclarationNodes: () => filterXMLDeclarationNodes, - findAttributeByName: () => findAttributeByName, - findParentArray: () => findParentArray, - findPreferredHelperForTag: () => findPreferredHelperForTag, - forEachAttribute: () => forEachAttribute, - fromSerializedError: () => fromSerializedError, - fromSerializedNode: () => fromSerializedNode, - getAttribute: () => getAttribute, - getAttributeName: () => getAttributeName, - getAttributeValue: () => getAttributeValue, - getAttributeValueNodes: () => getAttributeValueNodes, - getAttributeValueQuoteType: () => getAttributeValueQuoteType, - getAttributes: () => getAttributes, - getCombinedAttributeName: () => getCombinedAttributeName, - getCombinedAttributeNameString: () => getCombinedAttributeNameString, - getCombinedStringFromNodes: () => getCombinedStringFromNodes, - getHelper: () => getHelper, - getHelperBySource: () => getHelperBySource, - getHelperEntries: () => getHelperEntries, - getHelpersByGem: () => getHelpersByGem, - getHelpersByModule: () => getHelpersByModule, - getHelpersByOutput: () => getHelpersByOutput, - getHelpersForTag: () => getHelpersForTag, - getNamedCharacterReference: () => getNamedCharacterReference, - getNodesAfterLocation: () => getNodesAfterLocation, - getNodesAfterPosition: () => getNodesAfterPosition, - getNodesBeforeLocation: () => getNodesBeforeLocation, - getNodesBeforePosition: () => getNodesBeforePosition, - getOpenTag: () => getOpenTag, - getStaticAttributeName: () => getStaticAttributeName, - getStaticAttributeValue: () => getStaticAttributeValue, - getStaticAttributeValueContent: () => getStaticAttributeValueContent, - getStaticBodyText: () => getStaticBodyText, - getStaticContentFromNodes: () => getStaticContentFromNodes, - getStaticStringFromNodes: () => getStaticStringFromNodes, - getSupportedHelpers: () => getSupportedHelpers, - getTagLocalName: () => getTagLocalName, - getTagName: () => getTagName, - getTokenList: () => getTokenList, - getValidatableStaticContent: () => getValidatableStaticContent, - groupNodesByClass: () => groupNodesByClass, - hasAttribute: () => hasAttribute, - hasAttributeValue: () => hasAttributeValue, - hasChildren: () => hasChildren, - hasDynamicAttributeName: () => hasDynamicAttributeName, - hasDynamicAttributeNameNode: () => hasDynamicAttributeNameNode, - hasDynamicAttributeValue: () => hasDynamicAttributeValue, - hasERBContent: () => hasERBContent, - hasERBOutput: () => hasERBOutput, - hasStaticAttributeName: () => hasStaticAttributeName, - hasStaticAttributeValue: () => hasStaticAttributeValue, - hasStaticAttributeValueContent: () => hasStaticAttributeValueContent, - hasStaticContent: () => hasStaticContent, - helperExists: () => helperExists, - inspectPrismNode: () => inspectPrismNode, - inspectPrismSerialized: () => inspectPrismSerialized, - isAnyOf: () => isAnyOf, - isAttributeValueQuoted: () => isAttributeValueQuoted, - isBooleanAttribute: () => isBooleanAttribute, - isCDATANode: () => isCDATANode, - isCommentNode: () => isCommentNode, - isDocumentNode: () => isDocumentNode, - isERBBeginNode: () => isERBBeginNode, - isERBBlockNode: () => isERBBlockNode, - isERBCaseMatchNode: () => isERBCaseMatchNode, - isERBCaseNode: () => isERBCaseNode, - isERBCommentNode: () => isERBCommentNode, - isERBContentNode: () => isERBContentNode, - isERBControlFlowNode: () => isERBControlFlowNode, - isERBElseNode: () => isERBElseNode, - isERBEndNode: () => isERBEndNode, - isERBEnsureNode: () => isERBEnsureNode, - isERBEscapedNode: () => isERBEscapedNode, - isERBForNode: () => isERBForNode, - isERBIfNode: () => isERBIfNode, - isERBInNode: () => isERBInNode, - isERBNode: () => isERBNode, - isERBOpenTagNode: () => isERBOpenTagNode, - isERBOutputNode: () => isERBOutputNode, - isERBRenderNode: () => isERBRenderNode, - isERBRescueNode: () => isERBRescueNode, - isERBStrictLocalsNode: () => isERBStrictLocalsNode, - isERBUnlessNode: () => isERBUnlessNode, - isERBUntilNode: () => isERBUntilNode, - isERBWhenNode: () => isERBWhenNode, - isERBWhileNode: () => isERBWhileNode, - isERBYieldNode: () => isERBYieldNode, - isEffectivelyStatic: () => isEffectivelyStatic, - isEquivalentAttribute: () => isEquivalentAttribute, - isEquivalentElement: () => isEquivalentElement, - isEquivalentOpenTag: () => isEquivalentOpenTag, - isHTMLAttributeNameNode: () => isHTMLAttributeNameNode, - isHTMLAttributeNode: () => isHTMLAttributeNode, - isHTMLAttributeValueNode: () => isHTMLAttributeValueNode, - isHTMLCloseTagNode: () => isHTMLCloseTagNode, - isHTMLCommentNode: () => isHTMLCommentNode, - isHTMLConditionalElementNode: () => isHTMLConditionalElementNode, - isHTMLConditionalOpenTagNode: () => isHTMLConditionalOpenTagNode, - isHTMLDoctypeNode: () => isHTMLDoctypeNode, - isHTMLElementNode: () => isHTMLElementNode, - isHTMLNode: () => isHTMLNode, - isHTMLOmittedCloseTagNode: () => isHTMLOmittedCloseTagNode, - isHTMLOpenTagNode: () => isHTMLOpenTagNode, - isHTMLTextNode: () => isHTMLTextNode, - isHTMLVirtualCloseTagNode: () => isHTMLVirtualCloseTagNode, - isHelperSupported: () => isHelperSupported, - isLibHerbBackend: () => isLibHerbBackend, - isLiteralNode: () => isLiteralNode, - isNamedCharacterReference: () => isNamedCharacterReference, - isNode: () => isNode, - isNoneOf: () => isNoneOf, - isParseResult: () => isParseResult, - isPositionAfter: () => isPositionAfter, - isPositionEqual: () => isPositionEqual, - isPrismNodeType: () => isPrismNodeType, - isPureWhitespaceNode: () => isPureWhitespaceNode, - isRubyHTMLAttributesSplatNode: () => isRubyHTMLAttributesSplatNode, - isRubyLiteralNode: () => isRubyLiteralNode, - isRubyParameterNode: () => isRubyParameterNode, - isRubyRenderKeywordsNode: () => isRubyRenderKeywordsNode, - isRubyRenderLocalNode: () => isRubyRenderLocalNode, - isToken: () => isToken, - isValidCharacterReference: () => isValidCharacterReference, - isValidFramework: () => isValidFramework, - isValidTemplateEngine: () => isValidTemplateEngine, - isWhitespaceNode: () => isWhitespaceNode, - isXMLDeclarationNode: () => isXMLDeclarationNode, - levenshtein: () => levenshtein, - locationFromByteOffset: () => locationFromByteOffset, - positionFromOffset: () => positionFromOffset, - removeNodeFromArray: () => removeNodeFromArray, - replaceNodeWithBody: () => replaceNodeWithBody, - rules: () => rules, - splitLiteralsAtWhitespace: () => splitLiteralsAtWhitespace, - splitNodesAroundLocation: () => splitNodesAroundLocation, - splitNodesAroundPosition: () => splitNodesAroundPosition, - stringIndexFromByteOffset: () => stringIndexFromByteOffset, - substringFromByteOffset: () => substringFromByteOffset, - toMonacoDiagnostic: () => toMonacoDiagnostic + // stubs/picocolors.mjs + var picocolors_exports = {}; + __export(picocolors_exports, { + bgBlack: () => bgBlack, + bgBlackBright: () => bgBlackBright, + bgBlue: () => bgBlue, + bgBlueBright: () => bgBlueBright, + bgCyan: () => bgCyan, + bgCyanBright: () => bgCyanBright, + bgGreen: () => bgGreen, + bgGreenBright: () => bgGreenBright, + bgMagenta: () => bgMagenta, + bgMagentaBright: () => bgMagentaBright, + bgRed: () => bgRed, + bgRedBright: () => bgRedBright, + bgWhite: () => bgWhite, + bgWhiteBright: () => bgWhiteBright, + bgYellow: () => bgYellow, + bgYellowBright: () => bgYellowBright, + black: () => black, + blackBright: () => blackBright, + blue: () => blue, + blueBright: () => blueBright, + bold: () => bold, + createColors: () => createColors, + cyan: () => cyan, + cyanBright: () => cyanBright, + default: () => picocolors_default, + dim: () => dim, + gray: () => gray, + green: () => green, + greenBright: () => greenBright, + grey: () => grey, + hidden: () => hidden, + inverse: () => inverse, + isColorSupported: () => isColorSupported, + italic: () => italic, + magenta: () => magenta, + magentaBright: () => magentaBright, + red: () => red, + redBright: () => redBright, + reset: () => reset, + strikethrough: () => strikethrough, + underline: () => underline, + white: () => white, + whiteBright: () => whiteBright, + yellow: () => yellow, + yellowBright: () => yellowBright }); - - // node_modules/@herb-tools/linter/dist/linter.js - var import_picomatch = __toESM(require_picomatch2()); - - // node_modules/@ruby/prism/src/nodes.js - var nodes_exports = {}; - __export(nodes_exports, { - AliasGlobalVariableNode: () => AliasGlobalVariableNode, - AliasMethodNode: () => AliasMethodNode, - AlternationPatternNode: () => AlternationPatternNode, - AndNode: () => AndNode, - ArgumentsNode: () => ArgumentsNode, - ArrayNode: () => ArrayNode, - ArrayPatternNode: () => ArrayPatternNode, - AssocNode: () => AssocNode, - AssocSplatNode: () => AssocSplatNode, - BackReferenceReadNode: () => BackReferenceReadNode, - BeginNode: () => BeginNode, - BlockArgumentNode: () => BlockArgumentNode, - BlockLocalVariableNode: () => BlockLocalVariableNode, - BlockNode: () => BlockNode, - BlockParameterNode: () => BlockParameterNode, - BlockParametersNode: () => BlockParametersNode, - BreakNode: () => BreakNode, - CallAndWriteNode: () => CallAndWriteNode, - CallNode: () => CallNode, - CallOperatorWriteNode: () => CallOperatorWriteNode, - CallOrWriteNode: () => CallOrWriteNode, - CallTargetNode: () => CallTargetNode, - CapturePatternNode: () => CapturePatternNode, - CaseMatchNode: () => CaseMatchNode, - CaseNode: () => CaseNode, - ClassNode: () => ClassNode, - ClassVariableAndWriteNode: () => ClassVariableAndWriteNode, - ClassVariableOperatorWriteNode: () => ClassVariableOperatorWriteNode, - ClassVariableOrWriteNode: () => ClassVariableOrWriteNode, - ClassVariableReadNode: () => ClassVariableReadNode, - ClassVariableTargetNode: () => ClassVariableTargetNode, - ClassVariableWriteNode: () => ClassVariableWriteNode, - ConstantAndWriteNode: () => ConstantAndWriteNode, - ConstantOperatorWriteNode: () => ConstantOperatorWriteNode, - ConstantOrWriteNode: () => ConstantOrWriteNode, - ConstantPathAndWriteNode: () => ConstantPathAndWriteNode, - ConstantPathNode: () => ConstantPathNode, - ConstantPathOperatorWriteNode: () => ConstantPathOperatorWriteNode, - ConstantPathOrWriteNode: () => ConstantPathOrWriteNode, - ConstantPathTargetNode: () => ConstantPathTargetNode, - ConstantPathWriteNode: () => ConstantPathWriteNode, - ConstantReadNode: () => ConstantReadNode, - ConstantTargetNode: () => ConstantTargetNode, - ConstantWriteNode: () => ConstantWriteNode, - DefNode: () => DefNode, - DefinedNode: () => DefinedNode, - ElseNode: () => ElseNode, - EmbeddedStatementsNode: () => EmbeddedStatementsNode, - EmbeddedVariableNode: () => EmbeddedVariableNode, - EnsureNode: () => EnsureNode, - FalseNode: () => FalseNode, - FindPatternNode: () => FindPatternNode, - FlipFlopNode: () => FlipFlopNode, - FloatNode: () => FloatNode, - ForNode: () => ForNode, - ForwardingArgumentsNode: () => ForwardingArgumentsNode, - ForwardingParameterNode: () => ForwardingParameterNode, - ForwardingSuperNode: () => ForwardingSuperNode, - GlobalVariableAndWriteNode: () => GlobalVariableAndWriteNode, - GlobalVariableOperatorWriteNode: () => GlobalVariableOperatorWriteNode, - GlobalVariableOrWriteNode: () => GlobalVariableOrWriteNode, - GlobalVariableReadNode: () => GlobalVariableReadNode, - GlobalVariableTargetNode: () => GlobalVariableTargetNode, - GlobalVariableWriteNode: () => GlobalVariableWriteNode, - HashNode: () => HashNode, - HashPatternNode: () => HashPatternNode, - IfNode: () => IfNode, - ImaginaryNode: () => ImaginaryNode, - ImplicitNode: () => ImplicitNode, - ImplicitRestNode: () => ImplicitRestNode, - InNode: () => InNode, - IndexAndWriteNode: () => IndexAndWriteNode, - IndexOperatorWriteNode: () => IndexOperatorWriteNode, - IndexOrWriteNode: () => IndexOrWriteNode, - IndexTargetNode: () => IndexTargetNode, - InstanceVariableAndWriteNode: () => InstanceVariableAndWriteNode, - InstanceVariableOperatorWriteNode: () => InstanceVariableOperatorWriteNode, - InstanceVariableOrWriteNode: () => InstanceVariableOrWriteNode, - InstanceVariableReadNode: () => InstanceVariableReadNode, - InstanceVariableTargetNode: () => InstanceVariableTargetNode, - InstanceVariableWriteNode: () => InstanceVariableWriteNode, - IntegerNode: () => IntegerNode, - InterpolatedMatchLastLineNode: () => InterpolatedMatchLastLineNode, - InterpolatedRegularExpressionNode: () => InterpolatedRegularExpressionNode, - InterpolatedStringNode: () => InterpolatedStringNode, - InterpolatedSymbolNode: () => InterpolatedSymbolNode, - InterpolatedXStringNode: () => InterpolatedXStringNode, - ItLocalVariableReadNode: () => ItLocalVariableReadNode, - ItParametersNode: () => ItParametersNode, - KeywordHashNode: () => KeywordHashNode, - KeywordRestParameterNode: () => KeywordRestParameterNode, - LambdaNode: () => LambdaNode, - LocalVariableAndWriteNode: () => LocalVariableAndWriteNode, - LocalVariableOperatorWriteNode: () => LocalVariableOperatorWriteNode, - LocalVariableOrWriteNode: () => LocalVariableOrWriteNode, - LocalVariableReadNode: () => LocalVariableReadNode, - LocalVariableTargetNode: () => LocalVariableTargetNode, - LocalVariableWriteNode: () => LocalVariableWriteNode, - MatchLastLineNode: () => MatchLastLineNode, - MatchPredicateNode: () => MatchPredicateNode, - MatchRequiredNode: () => MatchRequiredNode, - MatchWriteNode: () => MatchWriteNode, - MissingNode: () => MissingNode, - ModuleNode: () => ModuleNode, - MultiTargetNode: () => MultiTargetNode, - MultiWriteNode: () => MultiWriteNode, - NextNode: () => NextNode, - NilNode: () => NilNode, - NoKeywordsParameterNode: () => NoKeywordsParameterNode, - NumberedParametersNode: () => NumberedParametersNode, - NumberedReferenceReadNode: () => NumberedReferenceReadNode, - OptionalKeywordParameterNode: () => OptionalKeywordParameterNode, - OptionalParameterNode: () => OptionalParameterNode, - OrNode: () => OrNode, - ParametersNode: () => ParametersNode, - ParenthesesNode: () => ParenthesesNode, - PinnedExpressionNode: () => PinnedExpressionNode, - PinnedVariableNode: () => PinnedVariableNode, - PostExecutionNode: () => PostExecutionNode, - PreExecutionNode: () => PreExecutionNode, - ProgramNode: () => ProgramNode, - RangeNode: () => RangeNode, - RationalNode: () => RationalNode, - RedoNode: () => RedoNode, - RegularExpressionNode: () => RegularExpressionNode, - RequiredKeywordParameterNode: () => RequiredKeywordParameterNode, - RequiredParameterNode: () => RequiredParameterNode, - RescueModifierNode: () => RescueModifierNode, - RescueNode: () => RescueNode, - RestParameterNode: () => RestParameterNode, - RetryNode: () => RetryNode, - ReturnNode: () => ReturnNode, - SelfNode: () => SelfNode, - ShareableConstantNode: () => ShareableConstantNode, - SingletonClassNode: () => SingletonClassNode, - SourceEncodingNode: () => SourceEncodingNode, - SourceFileNode: () => SourceFileNode, - SourceLineNode: () => SourceLineNode, - SplatNode: () => SplatNode, - StatementsNode: () => StatementsNode, - StringNode: () => StringNode, - SuperNode: () => SuperNode, - SymbolNode: () => SymbolNode, - TrueNode: () => TrueNode, - UndefNode: () => UndefNode, - UnlessNode: () => UnlessNode, - UntilNode: () => UntilNode, - WhenNode: () => WhenNode, - WhileNode: () => WhileNode, - XStringNode: () => XStringNode, - YieldNode: () => YieldNode + var identity, isColorSupported, createColors, reset, bold, dim, italic, underline, inverse, hidden, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, grey, blackBright, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgBlackBright, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright, colorSet, picocolors_default; + var init_picocolors = __esm({ + "stubs/picocolors.mjs"() { + identity = (value) => value; + isColorSupported = false; + createColors = () => colorSet; + reset = identity; + bold = identity; + dim = identity; + italic = identity; + underline = identity; + inverse = identity; + hidden = identity; + strikethrough = identity; + black = identity; + red = identity; + green = identity; + yellow = identity; + blue = identity; + magenta = identity; + cyan = identity; + white = identity; + gray = identity; + grey = identity; + blackBright = identity; + redBright = identity; + greenBright = identity; + yellowBright = identity; + blueBright = identity; + magentaBright = identity; + cyanBright = identity; + whiteBright = identity; + bgBlack = identity; + bgRed = identity; + bgGreen = identity; + bgYellow = identity; + bgBlue = identity; + bgMagenta = identity; + bgCyan = identity; + bgWhite = identity; + bgBlackBright = identity; + bgRedBright = identity; + bgGreenBright = identity; + bgYellowBright = identity; + bgBlueBright = identity; + bgMagentaBright = identity; + bgCyanBright = identity; + bgWhiteBright = identity; + colorSet = { + isColorSupported, + createColors, + reset, + bold, + dim, + italic, + underline, + inverse, + hidden, + strikethrough, + black, + red, + green, + yellow, + blue, + magenta, + cyan, + white, + gray, + grey, + blackBright, + redBright, + greenBright, + yellowBright, + blueBright, + magentaBright, + cyanBright, + whiteBright, + bgBlack, + bgRed, + bgGreen, + bgYellow, + bgBlue, + bgMagenta, + bgCyan, + bgWhite, + bgBlackBright, + bgRedBright, + bgGreenBright, + bgYellowBright, + bgBlueBright, + bgMagentaBright, + bgCyanBright, + bgWhiteBright + }; + picocolors_default = colorSet; + } }); - // node_modules/@ruby/prism/src/visitor.js - var BasicVisitor = class { - /** - * Calls `accept` on the given node if it is not `null`, which in turn should - * call back into this visitor by calling the appropriate `visit*` method. - * - * @param {nodes.Node} node - */ - visit(node) { - node?.accept(this); - } - /** - * Visits each node in `nodes` by calling `accept` on each one. - * - * @param {nodes.Node[]} nodes - */ - visitAll(nodes) { - nodes.forEach((node) => { - node?.accept(this); - }); - } - /** - * Visits the child nodes of `node` by calling `accept` on each one. - * - * @param {nodes.Node} node - */ - visitChildNodes(node) { - node.compactChildNodes().forEach((childNode) => { - childNode.accept(this); - }); - } - }; - var Visitor = class extends BasicVisitor { - /** - * Visit a AliasGlobalVariableNode node. - * - * @param {nodes.AliasGlobalVariableNode} node - */ - visitAliasGlobalVariableNode(node) { - this.visitChildNodes(node); + // node_modules/postcss/lib/tokenize.js + var require_tokenize = __commonJS({ + "node_modules/postcss/lib/tokenize.js"(exports, module) { + "use strict"; + var SINGLE_QUOTE = "'".charCodeAt(0); + var DOUBLE_QUOTE = '"'.charCodeAt(0); + var BACKSLASH = "\\".charCodeAt(0); + var SLASH = "/".charCodeAt(0); + var NEWLINE = "\n".charCodeAt(0); + var SPACE = " ".charCodeAt(0); + var FEED = "\f".charCodeAt(0); + var TAB = " ".charCodeAt(0); + var CR = "\r".charCodeAt(0); + var OPEN_SQUARE = "[".charCodeAt(0); + var CLOSE_SQUARE = "]".charCodeAt(0); + var OPEN_PARENTHESES = "(".charCodeAt(0); + var CLOSE_PARENTHESES = ")".charCodeAt(0); + var OPEN_CURLY = "{".charCodeAt(0); + var CLOSE_CURLY = "}".charCodeAt(0); + var SEMICOLON = ";".charCodeAt(0); + var ASTERISK = "*".charCodeAt(0); + var COLON = ":".charCodeAt(0); + var AT = "@".charCodeAt(0); + var RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g; + var RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g; + var RE_BAD_BRACKET = /.[\r\n"'(/\\]/; + var RE_HEX_ESCAPE = /[\da-f]/i; + module.exports = function tokenizer(input, options = {}) { + let css = input.css.valueOf(); + let ignore = options.ignoreErrors; + let code, content, escape, next, quote; + let currentToken, escaped, escapePos, n, prev; + let length = css.length; + let pos = 0; + let buffer = []; + let returned = []; + let lastBadParen = -1; + function position() { + return pos; + } + function unclosed(what) { + throw input.error("Unclosed " + what, pos); + } + function endOfFile() { + return returned.length === 0 && pos >= length; + } + function nextToken(opts) { + if (returned.length) return returned.pop(); + if (pos >= length) return; + let ignoreUnclosed = opts ? opts.ignoreUnclosed : false; + code = css.charCodeAt(pos); + switch (code) { + case NEWLINE: + case SPACE: + case TAB: + case CR: + case FEED: { + next = pos; + do { + next += 1; + code = css.charCodeAt(next); + } while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED); + currentToken = ["space", css.slice(pos, next)]; + pos = next - 1; + break; + } + case OPEN_SQUARE: + case CLOSE_SQUARE: + case OPEN_CURLY: + case CLOSE_CURLY: + case COLON: + case SEMICOLON: + case CLOSE_PARENTHESES: { + let controlChar = String.fromCharCode(code); + currentToken = [controlChar, controlChar, pos]; + break; + } + case OPEN_PARENTHESES: { + prev = buffer.length ? buffer.pop()[1] : ""; + n = css.charCodeAt(pos + 1); + if (prev === "url" && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE && n !== SPACE && n !== NEWLINE && n !== TAB && n !== FEED && n !== CR) { + next = pos; + do { + escaped = false; + next = css.indexOf(")", next + 1); + if (next === -1) { + if (ignore || ignoreUnclosed) { + next = pos; + break; + } else { + unclosed("bracket"); + } + } + escapePos = next; + while (css.charCodeAt(escapePos - 1) === BACKSLASH) { + escapePos -= 1; + escaped = !escaped; + } + } while (escaped); + currentToken = ["brackets", css.slice(pos, next + 1), pos, next]; + pos = next; + } else if (pos <= lastBadParen) { + currentToken = ["(", "(", pos]; + } else { + next = css.indexOf(")", pos + 1); + content = css.slice(pos, next + 1); + if (next === -1 || RE_BAD_BRACKET.test(content)) { + lastBadParen = next === -1 ? length : next; + currentToken = ["(", "(", pos]; + } else { + currentToken = ["brackets", content, pos, next]; + pos = next; + } + } + break; + } + case SINGLE_QUOTE: + case DOUBLE_QUOTE: { + quote = code === SINGLE_QUOTE ? "'" : '"'; + next = pos; + do { + escaped = false; + next = css.indexOf(quote, next + 1); + if (next === -1) { + if (ignore || ignoreUnclosed) { + next = pos + 1; + break; + } else { + unclosed("string"); + } + } + escapePos = next; + while (css.charCodeAt(escapePos - 1) === BACKSLASH) { + escapePos -= 1; + escaped = !escaped; + } + } while (escaped); + currentToken = ["string", css.slice(pos, next + 1), pos, next]; + pos = next; + break; + } + case AT: { + RE_AT_END.lastIndex = pos + 1; + RE_AT_END.test(css); + if (RE_AT_END.lastIndex === 0) { + next = css.length - 1; + } else { + next = RE_AT_END.lastIndex - 2; + } + currentToken = ["at-word", css.slice(pos, next + 1), pos, next]; + pos = next; + break; + } + case BACKSLASH: { + next = pos; + escape = true; + while (css.charCodeAt(next + 1) === BACKSLASH) { + next += 1; + escape = !escape; + } + code = css.charCodeAt(next + 1); + if (escape && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) { + next += 1; + if (RE_HEX_ESCAPE.test(css.charAt(next))) { + while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) { + next += 1; + } + if (css.charCodeAt(next + 1) === SPACE) { + next += 1; + } + } + } + currentToken = ["word", css.slice(pos, next + 1), pos, next]; + pos = next; + break; + } + default: { + if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) { + next = css.indexOf("*/", pos + 2) + 1; + if (next === 0) { + if (ignore || ignoreUnclosed) { + next = css.length; + } else { + unclosed("comment"); + } + } + currentToken = ["comment", css.slice(pos, next + 1), pos, next]; + pos = next; + } else { + RE_WORD_END.lastIndex = pos + 1; + RE_WORD_END.test(css); + if (RE_WORD_END.lastIndex === 0) { + next = css.length - 1; + } else { + next = RE_WORD_END.lastIndex - 2; + } + currentToken = ["word", css.slice(pos, next + 1), pos, next]; + buffer.push(currentToken); + pos = next; + } + break; + } + } + pos++; + return currentToken; + } + function back(token2) { + returned.push(token2); + } + return { + back, + endOfFile, + nextToken, + position + }; + }; } - /** - * Visit a AliasMethodNode node. - * - * @param {nodes.AliasMethodNode} node - */ - visitAliasMethodNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/terminal-highlight.js + var require_terminal_highlight = __commonJS({ + "node_modules/postcss/lib/terminal-highlight.js"(exports, module) { + "use strict"; + var pico = (init_picocolors(), __toCommonJS(picocolors_exports)); + var tokenizer = require_tokenize(); + var Input2; + function registerInput(dependant) { + Input2 = dependant; + } + var HIGHLIGHT_THEME = { + ";": pico.yellow, + ":": pico.yellow, + "(": pico.cyan, + ")": pico.cyan, + "[": pico.yellow, + "]": pico.yellow, + "{": pico.yellow, + "}": pico.yellow, + "at-word": pico.cyan, + "brackets": pico.cyan, + "call": pico.cyan, + "class": pico.yellow, + "comment": pico.gray, + "hash": pico.magenta, + "string": pico.green + }; + function getTokenType([type, value], processor) { + if (type === "word") { + if (value[0] === ".") { + return "class"; + } + if (value[0] === "#") { + return "hash"; + } + } + if (!processor.endOfFile()) { + let next = processor.nextToken(); + processor.back(next); + if (next[0] === "brackets" || next[0] === "(") return "call"; + } + return type; + } + function terminalHighlight(css) { + let processor = tokenizer(new Input2(css), { ignoreErrors: true }); + let result = ""; + while (!processor.endOfFile()) { + let token2 = processor.nextToken(); + let color = HIGHLIGHT_THEME[getTokenType(token2, processor)]; + if (color) { + result += token2[1].split(/\r?\n/).map((i) => color(i)).join("\n"); + } else { + result += token2[1]; + } + } + return result; + } + terminalHighlight.registerInput = registerInput; + module.exports = terminalHighlight; } - /** - * Visit a AlternationPatternNode node. - * - * @param {nodes.AlternationPatternNode} node - */ - visitAlternationPatternNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/css-syntax-error.js + var require_css_syntax_error = __commonJS({ + "node_modules/postcss/lib/css-syntax-error.js"(exports, module) { + "use strict"; + var pico = (init_picocolors(), __toCommonJS(picocolors_exports)); + var terminalHighlight = require_terminal_highlight(); + var CssSyntaxError2 = class _CssSyntaxError extends Error { + constructor(message, line, column, source, file, plugin2) { + super(message); + this.name = "CssSyntaxError"; + this.reason = message; + if (file) { + this.file = file; + } + if (source) { + this.source = source; + } + if (plugin2) { + this.plugin = plugin2; + } + if (typeof line !== "undefined" && typeof column !== "undefined") { + if (typeof line === "number") { + this.line = line; + this.column = column; + } else { + this.line = line.line; + this.column = line.column; + this.endLine = column.line; + this.endColumn = column.column; + } + } + this.setMessage(); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, _CssSyntaxError); + } + } + setMessage() { + this.message = this.plugin ? this.plugin + ": " : ""; + this.message += this.file ? this.file : ""; + if (typeof this.line !== "undefined") { + this.message += ":" + this.line + ":" + this.column; + } + this.message += ": " + this.reason; + } + showSourceCode(color) { + if (!this.source) return ""; + let css = this.source; + if (color == null) color = pico.isColorSupported; + let aside = (text) => text; + let mark = (text) => text; + let highlight = (text) => text; + if (color) { + let { bold: bold2, gray: gray2, red: red2 } = pico.createColors(true); + mark = (text) => bold2(red2(text)); + aside = (text) => gray2(text); + if (terminalHighlight) { + highlight = (text) => terminalHighlight(text); + } + } + let lines = css.split(/\r?\n/); + let start = Math.max(this.line - 3, 0); + let end = Math.min(this.line + 2, lines.length); + let maxWidth = String(end).length; + return lines.slice(start, end).map((line, index) => { + let number2 = start + 1 + index; + let gutter = " " + (" " + number2).slice(-maxWidth) + " | "; + if (number2 === this.line) { + if (line.length > 160) { + let padding = 20; + let subLineStart = Math.max(0, this.column - padding); + let subLineEnd = Math.max( + this.column + padding, + this.endColumn + padding + ); + let subLine = line.slice(subLineStart, subLineEnd); + let spacing2 = aside(gutter.replace(/\d/g, " ")) + line.slice(0, Math.min(this.column - 1, padding - 1)).replace(/[^\t]/g, " "); + return mark(">") + aside(gutter) + highlight(subLine) + "\n " + spacing2 + mark("^"); + } + let spacing = aside(gutter.replace(/\d/g, " ")) + line.slice(0, this.column - 1).replace(/[^\t]/g, " "); + return mark(">") + aside(gutter) + highlight(line) + "\n " + spacing + mark("^"); + } + return " " + aside(gutter) + highlight(line); + }).join("\n"); + } + toString() { + let code = this.showSourceCode(); + if (code) { + code = "\n\n" + code + "\n"; + } + return this.name + ": " + this.message + code; + } + }; + module.exports = CssSyntaxError2; + CssSyntaxError2.default = CssSyntaxError2; } - /** - * Visit a AndNode node. - * - * @param {nodes.AndNode} node - */ - visitAndNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/stringifier.js + var require_stringifier = __commonJS({ + "node_modules/postcss/lib/stringifier.js"(exports, module) { + "use strict"; + var AT_NAME_END = /[\t\n\f\r "#'()/;[\\\]{}]/; + var DEFAULT_RAW = { + after: "\n", + beforeClose: "\n", + beforeComment: "\n", + beforeDecl: "\n", + beforeOpen: " ", + beforeRule: "\n", + colon: ": ", + commentLeft: " ", + commentRight: " ", + emptyBody: "", + indent: " ", + semicolon: false + }; + function capitalize2(str) { + return str[0].toUpperCase() + str.slice(1); + } + function atruleStart(str, node2) { + let name2 = "@" + node2.name; + let params = node2.params ? str.rawValue(node2, "params") : ""; + let afterName = node2.raws.afterName; + if (typeof afterName === "undefined") { + afterName = params ? " " : ""; + } else if (afterName === "" && params && !AT_NAME_END.test(params[0])) { + afterName = " "; + } + return name2 + afterName + params; + } + function isCustomProperty(node2) { + if (!node2.prop.startsWith("--")) return false; + let before = node2.raws.before; + return typeof before === "undefined" || !/[^\s;]$/.test(before); + } + function pushBody(str, stack, node2) { + let nodes = node2.nodes; + let last = nodes.length - 1; + while (last > 0) { + if (nodes[last].type !== "comment") break; + last -= 1; + } + let semicolon = str.raw(node2, "semicolon"); + let isDocument = node2.type === "document"; + for (let i = nodes.length - 1; i >= 0; i--) { + let child = nodes[i]; + let childSemicolon = last !== i || semicolon; + if (!childSemicolon && i < nodes.length - 1 && (child.type === "atrule" && !child.nodes || child.type === "decl" && isCustomProperty(child))) { + childSemicolon = true; + } + stack.push({ + document: isDocument, + node: child, + semicolon: childSemicolon + }); + } + } + function pushBlock(str, stack, node2, start) { + let between = str.raw(node2, "between", "beforeOpen"); + str.builder(start + between + "{", node2, "start"); + let hasNodes = node2.nodes && node2.nodes.length; + let close = () => { + let after = hasNodes ? str.raw(node2, "after") : str.raw(node2, "after", "emptyBody"); + if (after) str.builder(after); + str.builder("}", node2, "end"); + if (node2.type === "rule" && node2.raws.ownSemicolon) { + str.builder(node2.raws.ownSemicolon, node2, "end"); + } + }; + if (hasNodes) { + stack.push(close); + pushBody(str, stack, node2); + } else { + close(); + } + } + var Stringifier = class _Stringifier { + constructor(builder) { + this.builder = builder; + } + atrule(node2, semicolon) { + let start = atruleStart(this, node2); + if (node2.nodes) { + this.block(node2, start); + } else { + let end = (node2.raws.between || "") + (semicolon ? ";" : ""); + this.builder(start + end, node2); + } + } + beforeAfter(node2, detect) { + let value; + if (node2.type === "decl") { + value = this.raw(node2, null, "beforeDecl"); + } else if (node2.type === "comment") { + value = this.raw(node2, null, "beforeComment"); + } else if (detect === "before") { + value = this.raw(node2, null, "beforeRule"); + } else { + value = this.raw(node2, null, "beforeClose"); + } + let buf = node2.parent; + let depth = 0; + while (buf && buf.type !== "root") { + depth += 1; + buf = buf.parent; + } + if (value.includes("\n")) { + let indent = this.raw(node2, null, "indent"); + if (indent.length) { + for (let step = 0; step < depth; step++) value += indent; + } + } + return value; + } + block(node2, start) { + let between = this.raw(node2, "between", "beforeOpen"); + this.builder(start + between + "{", node2, "start"); + let after; + if (node2.nodes && node2.nodes.length) { + this.body(node2); + after = this.raw(node2, "after"); + } else { + after = this.raw(node2, "after", "emptyBody"); + } + if (after) this.builder(after); + this.builder("}", node2, "end"); + } + body(node2) { + let proto = _Stringifier.prototype; + let expandable = ["atrule", "block", "body", "rule", "stringify"].every( + (method) => this[method] === proto[method] + ); + let stack = []; + pushBody(this, stack, node2); + while (stack.length > 0) { + let entry = stack.pop(); + if (typeof entry === "function") { + entry(); + continue; + } + let child = entry.node; + let before = this.raw(child, "before"); + if (before) { + this.builder(before); + } + if (expandable && child.type === "rule") { + pushBlock(this, stack, child, this.rawValue(child, "selector")); + } else if (expandable && child.type === "atrule" && child.nodes) { + pushBlock(this, stack, child, atruleStart(this, child)); + } else { + this.stringify(child, entry.semicolon); + } + } + } + comment(node2) { + let left = this.raw(node2, "left", "commentLeft"); + let right = this.raw(node2, "right", "commentRight"); + this.builder("/*" + left + node2.text + right + "*/", node2); + } + decl(node2, semicolon) { + let raws = node2.raws; + let between = this.raw(node2, "between", "colon"); + let string2 = node2.prop + between + this.rawValue(node2, "value"); + if (node2.important) { + string2 += raws.important || " !important"; + } + if (semicolon) string2 += ";"; + this.builder(string2, node2); + } + document(node2) { + this.body(node2); + } + raw(node2, own2, detect) { + let value; + if (!detect) detect = own2; + if (own2) { + value = node2.raws[own2]; + if (typeof value !== "undefined") return value; + } + let parent = node2.parent; + if (detect === "before") { + if (!parent || parent.type === "root" && parent.first === node2) { + return ""; + } + if (parent && parent.type === "document") { + return ""; + } + } + if (!parent) return DEFAULT_RAW[detect]; + let root3 = node2.root(); + let cache = root3.rawCache || (root3.rawCache = {}); + if (typeof cache[detect] !== "undefined") { + return cache[detect]; + } + if (detect === "before" || detect === "after") { + return this.beforeAfter(node2, detect); + } else { + let method = "raw" + capitalize2(detect); + if (this[method]) { + value = this[method](root3, node2); + } else { + root3.walk((i) => { + value = i.raws[own2]; + if (typeof value !== "undefined") return false; + }); + } + } + if (typeof value === "undefined") value = DEFAULT_RAW[detect]; + cache[detect] = value; + return value; + } + rawBeforeClose(root3) { + let value; + root3.walk((i) => { + if (i.nodes && i.nodes.length > 0) { + if (typeof i.raws.after !== "undefined") { + value = i.raws.after; + if (value.includes("\n")) { + value = value.replace(/[^\n]+$/, ""); + } + return false; + } + } + }); + if (value) value = value.replace(/\S/g, ""); + return value; + } + rawBeforeComment(root3, node2) { + let value; + root3.walkComments((i) => { + if (typeof i.raws.before !== "undefined") { + value = i.raws.before; + if (value.includes("\n")) { + value = value.replace(/[^\n]+$/, ""); + } + return false; + } + }); + if (typeof value === "undefined") { + value = this.raw(node2, null, "beforeDecl"); + } else if (value) { + value = value.replace(/\S/g, ""); + } + return value; + } + rawBeforeDecl(root3, node2) { + let value; + root3.walkDecls((i) => { + if (typeof i.raws.before !== "undefined") { + value = i.raws.before; + if (value.includes("\n")) { + value = value.replace(/[^\n]+$/, ""); + } + return false; + } + }); + if (typeof value === "undefined") { + value = this.raw(node2, null, "beforeRule"); + } else if (value) { + value = value.replace(/\S/g, ""); + } + return value; + } + rawBeforeOpen(root3) { + let value; + root3.walk((i) => { + if (i.type !== "decl") { + value = i.raws.between; + if (typeof value !== "undefined") return false; + } + }); + return value; + } + rawBeforeRule(root3) { + let value; + root3.walk((i) => { + if (i.nodes && (i.parent !== root3 || root3.first !== i)) { + if (typeof i.raws.before !== "undefined") { + value = i.raws.before; + if (value.includes("\n")) { + value = value.replace(/[^\n]+$/, ""); + } + return false; + } + } + }); + if (value) value = value.replace(/\S/g, ""); + return value; + } + rawColon(root3) { + let value; + root3.walkDecls((i) => { + if (typeof i.raws.between !== "undefined") { + value = i.raws.between.replace(/[^\s:]/g, ""); + return false; + } + }); + return value; + } + rawEmptyBody(root3) { + let value; + root3.walk((i) => { + if (i.nodes && i.nodes.length === 0) { + value = i.raws.after; + if (typeof value !== "undefined") return false; + } + }); + return value; + } + rawIndent(root3) { + if (root3.raws.indent) return root3.raws.indent; + let value; + root3.walk((i) => { + let p2 = i.parent; + if (p2 && p2 !== root3 && p2.parent && p2.parent === root3) { + if (typeof i.raws.before !== "undefined") { + let parts = i.raws.before.split("\n"); + value = parts[parts.length - 1]; + value = value.replace(/\S/g, ""); + return false; + } + } + }); + return value; + } + rawSemicolon(root3) { + let value; + root3.walk((i) => { + if (i.nodes && i.nodes.length && i.last.type === "decl") { + value = i.raws.semicolon; + if (typeof value !== "undefined") return false; + } + }); + return value; + } + rawValue(node2, prop) { + let value = node2[prop]; + let raw = node2.raws[prop]; + if (raw && raw.value === value) { + return raw.raw; + } + return value; + } + root(node2) { + let inDocument = node2.parent && node2.parent.type === "document"; + if (!inDocument && node2.source && node2.source.input.hasBOM) { + this.builder("\uFEFF", node2, "start"); + } + this.body(node2); + if (node2.raws.after) { + this.builder(node2.raws.after); + } + } + rule(node2) { + this.block(node2, this.rawValue(node2, "selector")); + if (node2.raws.ownSemicolon) { + this.builder(node2.raws.ownSemicolon, node2, "end"); + } + } + stringify(node2, semicolon) { + if (!this[node2.type]) { + throw new Error( + "Unknown AST node type " + node2.type + ". Maybe you need to change PostCSS stringifier." + ); + } + this[node2.type](node2, semicolon); + } + }; + module.exports = Stringifier; + Stringifier.default = Stringifier; } - /** - * Visit a ArgumentsNode node. - * - * @param {nodes.ArgumentsNode} node - */ - visitArgumentsNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/stringify.js + var require_stringify = __commonJS({ + "node_modules/postcss/lib/stringify.js"(exports, module) { + "use strict"; + var Stringifier = require_stringifier(); + var STYLE_TAG = /(<)(\/?style\b)/gi; + var COMMENT_OPEN = /(<)(!--)/g; + function escapeHTMLInCSS(str) { + if (!str.includes("<")) return str; + return str.replace(STYLE_TAG, "\\3c $2").replace(COMMENT_OPEN, "\\3c $2"); + } + function cutEscaped(chunks, css, escaped) { + let parts = []; + let at = 0; + let into = 0; + for (let i = 0; i < chunks.length; i += 3) { + let from = into; + let end = at + chunks[i].length; + while (at < end) { + if (css[at] === escaped[into]) { + at += 1; + into += 1; + } else { + at += 1; + into += 4; + } + } + parts.push(escaped.slice(from, into)); + } + return parts; + } + var SafeStringifier = class extends Stringifier { + escapeHTML(print) { + let builder = this.builder; + let chunks, css; + this.builder = (str, child, type) => { + if (chunks) { + css += str; + chunks.push(str, child, type); + } else if (str.includes("<")) { + css = str; + chunks = [str, child, type]; + } else { + builder(str, child, type); + } + }; + print(); + this.builder = builder; + if (!chunks) return; + let escaped = escapeHTMLInCSS(css); + if (escaped === css) { + for (let i = 0; i < chunks.length; i += 3) { + builder(chunks[i], chunks[i + 1], chunks[i + 2]); + } + } else { + let parts = cutEscaped(chunks, css, escaped); + for (let i = 0; i < chunks.length; i += 3) { + builder(parts[i / 3], chunks[i + 1], chunks[i + 2]); + } + } + } + root(node2) { + if (node2.parent && node2.parent.type === "document") { + this.escapeHTML(() => this.body(node2)); + if (node2.raws.after) this.builder(node2.raws.after); + } else { + this.escapeHTML(() => super.root(node2)); + } + } + }; + function stringify2(node2, builder) { + let str = new SafeStringifier(builder); + if (node2.type === "root" || node2.type === "document") { + str.stringify(node2); + } else { + str.escapeHTML(() => str.stringify(node2)); + } + } + module.exports = stringify2; + stringify2.default = stringify2; } - /** - * Visit a ArrayNode node. - * - * @param {nodes.ArrayNode} node - */ - visitArrayNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/symbols.js + var require_symbols = __commonJS({ + "node_modules/postcss/lib/symbols.js"(exports, module) { + "use strict"; + module.exports.isClean = /* @__PURE__ */ Symbol("isClean"); + module.exports.my = /* @__PURE__ */ Symbol("my"); } - /** - * Visit a ArrayPatternNode node. - * - * @param {nodes.ArrayPatternNode} node - */ - visitArrayPatternNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/node.js + var require_node = __commonJS({ + "node_modules/postcss/lib/node.js"(exports, module) { + "use strict"; + var CssSyntaxError2 = require_css_syntax_error(); + var Stringifier = require_stringifier(); + var stringify2 = require_stringify(); + var { isClean, my } = require_symbols(); + function cloneNode(obj, parent) { + let cloned = new obj.constructor(); + let stack = [[obj, cloned, parent]]; + while (stack.length > 0) { + let [source, target, targetParent] = stack.pop(); + for (let i in source) { + if (!Object.prototype.hasOwnProperty.call(source, i)) { + continue; + } + if (i === "proxyCache") continue; + let value = source[i]; + let type = typeof value; + if (i === "parent" && type === "object") { + if (targetParent) target[i] = targetParent; + } else if (i === "source") { + target[i] = value; + } else if (Array.isArray(value)) { + let children2 = []; + target[i] = children2; + for (let j2 of value) { + let childClone = new j2.constructor(); + children2.push(childClone); + stack.push([j2, childClone, target]); + } + } else { + if (type === "object" && value !== null) { + let valueClone = new value.constructor(); + stack.push([value, valueClone, void 0]); + value = valueClone; + } + target[i] = value; + } + } + } + return cloned; + } + function sourceOffset(inputCSS, position) { + if (position && typeof position.offset !== "undefined") { + return position.offset; + } + let column = 1; + let line = 1; + let offset = 0; + for (let i = 0; i < inputCSS.length; i++) { + if (line === position.line && column === position.column) { + offset = i; + break; + } + if (inputCSS[i] === "\n") { + column = 1; + line += 1; + } else { + column += 1; + } + } + return offset; + } + var Node4 = class _Node { + get proxyOf() { + return this; + } + constructor(defaults = {}) { + this.raws = {}; + this[isClean] = false; + this[my] = true; + for (let name2 of Object.keys(defaults)) { + if (name2 === "__proto__") continue; + if (name2 === "nodes") { + this.nodes = []; + for (let node2 of defaults[name2]) { + if (typeof node2.clone === "function" && node2.parent) { + this.append(node2.clone()); + } else { + this.append(node2); + } + } + } else { + this[name2] = defaults[name2]; + } + } + } + addToError(error2) { + error2.postcssNode = this; + if (error2.stack && this.source && /\n\s{4}at /.test(error2.stack)) { + let s = this.source; + error2.stack = error2.stack.replace( + /\n\s{4}at /, + `$&${s.input.from}:${s.start.line}:${s.start.column}$&` + ); + } + return error2; + } + after(add) { + this.parent.insertAfter(this, add); + return this; + } + assign(overrides = {}) { + for (let name2 in overrides) { + this[name2] = overrides[name2]; + } + return this; + } + before(add) { + this.parent.insertBefore(this, add); + return this; + } + cleanRaws(keepBetween) { + delete this.raws.before; + delete this.raws.after; + if (!keepBetween) delete this.raws.between; + } + clone(overrides = {}) { + let cloned = cloneNode(this); + for (let name2 in overrides) { + cloned[name2] = overrides[name2]; + } + return cloned; + } + cloneAfter(overrides = {}) { + let cloned = this.clone(overrides); + this.parent.insertAfter(this, cloned); + return cloned; + } + cloneBefore(overrides = {}) { + let cloned = this.clone(overrides); + this.parent.insertBefore(this, cloned); + return cloned; + } + error(message, opts = {}) { + if (this.source) { + let { end, start } = this.rangeBy(opts); + return this.source.input.error( + message, + { column: start.column, line: start.line }, + { column: end.column, line: end.line }, + opts + ); + } + return new CssSyntaxError2(message); + } + getProxyProcessor() { + return { + get(node2, prop) { + if (prop === "proxyOf") { + return node2; + } else if (prop === "root") { + return () => node2.root().toProxy(); + } else { + return node2[prop]; + } + }, + set(node2, prop, value) { + if (node2[prop] === value) return true; + node2[prop] = value; + if (prop === "prop" || prop === "value" || prop === "name" || prop === "params" || prop === "important" || /* c8 ignore next */ + prop === "text") { + node2.markDirty(); + } + return true; + } + }; + } + /* c8 ignore next 3 */ + markClean() { + this[isClean] = true; + } + markDirty() { + if (this[isClean]) { + this[isClean] = false; + let next = this; + while (next = next.parent) { + next[isClean] = false; + } + } + } + next() { + if (!this.parent) return void 0; + let index = this.parent.index(this); + return this.parent.nodes[index + 1]; + } + positionBy(opts = {}) { + let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css; + let pos = { + column: this.source.start.column, + line: this.source.start.line, + offset: sourceOffset(inputString, this.source.start) + }; + if (opts.index) { + pos = this.positionInside(opts.index); + } else if (opts.word) { + let stringRepresentation = inputString.slice( + sourceOffset(inputString, this.source.start), + sourceOffset(inputString, this.source.end) + ); + let index = stringRepresentation.indexOf(opts.word); + if (index !== -1) pos = this.positionInside(index); + } + return pos; + } + positionInside(index) { + let column = this.source.start.column; + let line = this.source.start.line; + let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css; + let offset = sourceOffset(inputString, this.source.start); + let end = offset + index; + for (let i = offset; i < end; i++) { + if (inputString[i] === "\n") { + column = 1; + line += 1; + } else { + column += 1; + } + } + return { column, line, offset: end }; + } + prev() { + if (!this.parent) return void 0; + let index = this.parent.index(this); + return this.parent.nodes[index - 1]; + } + rangeBy(opts = {}) { + let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css; + let start = { + column: this.source.start.column, + line: this.source.start.line, + offset: sourceOffset(inputString, this.source.start) + }; + let end = this.source.end ? { + column: this.source.end.column + 1, + line: this.source.end.line, + offset: typeof this.source.end.offset === "number" ? ( + // `source.end.offset` is exclusive, so we don't need to add 1 + this.source.end.offset + ) : ( + // Since line/column in this.source.end is inclusive, + // the `sourceOffset(... , this.source.end)` returns an inclusive offset. + // So, we add 1 to convert it to exclusive. + sourceOffset(inputString, this.source.end) + 1 + ) + } : { + column: start.column + 1, + line: start.line, + offset: start.offset + 1 + }; + if (opts.word) { + let stringRepresentation = inputString.slice( + sourceOffset(inputString, this.source.start), + sourceOffset(inputString, this.source.end) + ); + let index = stringRepresentation.indexOf(opts.word); + if (index !== -1) { + start = this.positionInside(index); + end = this.positionInside(index + opts.word.length); + } + } else { + if (opts.start) { + start = { + column: opts.start.column, + line: opts.start.line, + offset: sourceOffset(inputString, opts.start) + }; + } else if (typeof opts.index === "number") { + start = this.positionInside(opts.index); + } + if (opts.end) { + end = { + column: opts.end.column, + line: opts.end.line, + offset: sourceOffset(inputString, opts.end) + }; + } else if (typeof opts.endIndex === "number") { + end = this.positionInside(opts.endIndex); + } else if (typeof opts.index === "number") { + end = this.positionInside(opts.index + 1); + } + } + if (end.line < start.line || end.line === start.line && end.column <= start.column) { + end = { + column: start.column + 1, + line: start.line, + offset: start.offset + 1 + }; + } + return { end, start }; + } + raw(prop, defaultType) { + let str = new Stringifier(); + return str.raw(this, prop, defaultType); + } + remove() { + if (this.parent) { + this.parent.removeChild(this); + } + this.parent = void 0; + return this; + } + replaceWith(...nodes) { + if (this.parent) { + let bookmark = this; + let foundSelf = false; + for (let node2 of nodes) { + if (node2 === this) { + foundSelf = true; + } else if (foundSelf) { + this.parent.insertAfter(bookmark, node2); + bookmark = node2; + } else { + this.parent.insertBefore(bookmark, node2); + } + } + if (!foundSelf) { + this.remove(); + } + } + return this; + } + root() { + let result = this; + while (result.parent && result.parent.type !== "document") { + result = result.parent; + } + return result; + } + toJSON(_3, inputs) { + let emitInputs = inputs == null; + inputs = inputs || /* @__PURE__ */ new Map(); + let holderOfRoot = []; + let queue = [[this, holderOfRoot, 0]]; + for (let step = 0; step < queue.length; step++) { + let [node2, holder, key] = queue[step]; + let fixed2 = {}; + holder[key] = fixed2; + for (let name2 in node2) { + if (!Object.prototype.hasOwnProperty.call(node2, name2)) { + continue; + } + if (name2 === "parent" || name2 === "proxyCache") continue; + let value = node2[name2]; + if (Array.isArray(value)) { + let fixedArray = []; + fixed2[name2] = fixedArray; + for (let i = 0; i < value.length; i++) { + let item = value[i]; + if (typeof item === "object" && item.toJSON) { + if (item.toJSON === _Node.prototype.toJSON) { + queue.push([item, fixedArray, i]); + } else { + fixedArray[i] = item.toJSON(null, inputs); + } + } else { + fixedArray[i] = item; + } + } + } else if (typeof value === "object" && value.toJSON) { + if (value.toJSON === _Node.prototype.toJSON) { + queue.push([value, fixed2, name2]); + } else { + fixed2[name2] = value.toJSON(null, inputs); + } + } else if (name2 === "source") { + if (value == null) continue; + let inputId = inputs.get(value.input); + if (inputId == null) { + inputId = inputs.size; + inputs.set(value.input, inputId); + } + fixed2[name2] = { + end: value.end, + inputId, + start: value.start + }; + } else { + fixed2[name2] = value; + } + } + } + let fixed = holderOfRoot[0]; + if (emitInputs) { + fixed.inputs = [...inputs.keys()].map((input) => input.toJSON()); + } + return fixed; + } + toProxy() { + if (!this.proxyCache) { + this.proxyCache = new Proxy(this, this.getProxyProcessor()); + } + return this.proxyCache; + } + toString(stringifier = stringify2) { + if (stringifier.stringify) stringifier = stringifier.stringify; + let result = ""; + stringifier(this, (i) => { + result += i; + }); + return result; + } + warn(result, text, opts = {}) { + let data = { node: this }; + for (let i in opts) data[i] = opts[i]; + return result.warn(text, data); + } + }; + module.exports = Node4; + Node4.default = Node4; } - /** - * Visit a AssocNode node. - * - * @param {nodes.AssocNode} node - */ - visitAssocNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/comment.js + var require_comment = __commonJS({ + "node_modules/postcss/lib/comment.js"(exports, module) { + "use strict"; + var Node4 = require_node(); + var Comment2 = class extends Node4 { + constructor(defaults) { + super(defaults); + this.type = "comment"; + } + }; + module.exports = Comment2; + Comment2.default = Comment2; } - /** - * Visit a AssocSplatNode node. - * - * @param {nodes.AssocSplatNode} node - */ - visitAssocSplatNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/declaration.js + var require_declaration = __commonJS({ + "node_modules/postcss/lib/declaration.js"(exports, module) { + "use strict"; + var Node4 = require_node(); + var Declaration2 = class extends Node4 { + get variable() { + return this.prop.startsWith("--") || this.prop[0] === "$"; + } + constructor(defaults) { + if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") { + defaults = { ...defaults, value: String(defaults.value) }; + } + super(defaults); + this.type = "decl"; + } + }; + module.exports = Declaration2; + Declaration2.default = Declaration2; } - /** - * Visit a BackReferenceReadNode node. - * - * @param {nodes.BackReferenceReadNode} node - */ - visitBackReferenceReadNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/container.js + var require_container = __commonJS({ + "node_modules/postcss/lib/container.js"(exports, module) { + "use strict"; + var Comment2 = require_comment(); + var Declaration2 = require_declaration(); + var Node4 = require_node(); + var { isClean, my } = require_symbols(); + var AtRule2; + var parse3; + var Root2; + var Rule2; + function cleanSource(nodes) { + let stack = nodes.slice(); + while (stack.length > 0) { + let node2 = stack.pop(); + delete node2.source; + if (node2.nodes) { + node2.nodes = node2.nodes.slice(); + for (let i of node2.nodes) stack.push(i); + } + } + return nodes.slice(); + } + function markTreeDirty(node2) { + let stack = [node2]; + while (stack.length > 0) { + let next = stack.pop(); + next[isClean] = false; + if (next.proxyOf.nodes) { + for (let i of next.proxyOf.nodes) stack.push(i); + } + } + } + var Container2 = class _Container extends Node4 { + get first() { + if (!this.proxyOf.nodes) return void 0; + return this.proxyOf.nodes[0]; + } + get last() { + if (!this.proxyOf.nodes) return void 0; + return this.proxyOf.nodes[this.proxyOf.nodes.length - 1]; + } + append(...children2) { + for (let child of children2) { + let nodes = this.normalize(child, this.last); + for (let node2 of nodes) this.proxyOf.nodes.push(node2); + } + this.markDirty(); + return this; + } + cleanRaws(keepBetween) { + let stack = [this]; + while (stack.length > 0) { + let node2 = stack.pop(); + if (node2 !== this && node2.cleanRaws !== _Container.prototype.cleanRaws) { + node2.cleanRaws(keepBetween); + continue; + } + Node4.prototype.cleanRaws.call(node2, keepBetween); + if (node2.nodes) { + for (let child of node2.nodes) stack.push(child); + } + } + } + each(callback) { + if (!this.proxyOf.nodes) return void 0; + let iterator = this.getIterator(); + let index, result; + while (this.indexes[iterator] < this.proxyOf.nodes.length) { + index = this.indexes[iterator]; + result = callback(this.proxyOf.nodes[index], index); + if (result === false) break; + this.indexes[iterator] += 1; + } + delete this.indexes[iterator]; + return result; + } + every(condition) { + return this.nodes.every(condition); + } + getIterator() { + if (!this.lastEach) this.lastEach = 0; + if (!this.indexes) this.indexes = {}; + this.lastEach += 1; + let iterator = this.lastEach; + this.indexes[iterator] = 0; + return iterator; + } + getProxyProcessor() { + return { + get(node2, prop) { + if (prop === "proxyOf") { + return node2; + } else if (!node2[prop]) { + return node2[prop]; + } else if (prop === "each" || typeof prop === "string" && prop.startsWith("walk")) { + return (...args) => { + return node2[prop]( + ...args.map((i) => { + if (typeof i === "function") { + return (child, index) => i(child.toProxy(), index); + } else { + return i; + } + }) + ); + }; + } else if (prop === "every" || prop === "some") { + return (cb) => { + return node2[prop]( + (child, ...other) => cb(child.toProxy(), ...other) + ); + }; + } else if (prop === "root") { + return () => node2.root().toProxy(); + } else if (prop === "nodes") { + return node2.nodes.map((i) => i.toProxy()); + } else if (prop === "first" || prop === "last") { + return node2[prop].toProxy(); + } else { + return node2[prop]; + } + }, + set(node2, prop, value) { + if (node2[prop] === value) return true; + node2[prop] = value; + if (prop === "name" || prop === "params" || prop === "selector") { + node2.markDirty(); + } + return true; + } + }; + } + index(child) { + if (typeof child === "number") return child; + if (child.proxyOf) child = child.proxyOf; + return this.proxyOf.nodes.indexOf(child); + } + insertAfter(exist, add) { + let existIndex = this.index(exist); + let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse(); + existIndex = this.index(exist); + for (let node2 of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node2); + let index; + for (let id in this.indexes) { + index = this.indexes[id]; + if (existIndex < index) { + this.indexes[id] = index + nodes.length; + } + } + this.markDirty(); + return this; + } + insertBefore(exist, add) { + let existIndex = this.index(exist); + let type = existIndex === 0 ? "prepend" : false; + let nodes = this.normalize( + add, + this.proxyOf.nodes[existIndex], + type + ).reverse(); + existIndex = this.index(exist); + for (let node2 of nodes) this.proxyOf.nodes.splice(existIndex, 0, node2); + let index; + for (let id in this.indexes) { + index = this.indexes[id]; + if (existIndex <= index) { + this.indexes[id] = index + nodes.length; + } + } + this.markDirty(); + return this; + } + normalize(nodes, sample) { + if (typeof nodes === "string") { + nodes = cleanSource(parse3(nodes).nodes); + } else if (typeof nodes === "undefined") { + nodes = []; + } else if (Array.isArray(nodes)) { + nodes = nodes.slice(0); + for (let i of nodes) { + if (i.parent) i.parent.removeChild(i, "ignore"); + } + } else if (nodes.type === "root" && this.type !== "document") { + nodes = nodes.nodes.slice(0); + for (let i of nodes) { + if (i.parent) i.parent.removeChild(i, "ignore"); + } + } else if (nodes.type) { + nodes = [nodes]; + } else if (nodes.prop) { + if (typeof nodes.value === "undefined") { + throw new Error("Value field is missed in node creation"); + } else if (typeof nodes.value !== "string") { + nodes.value = String(nodes.value); + } + nodes = [new Declaration2(nodes)]; + } else if (nodes.selector || nodes.selectors) { + nodes = [new Rule2(nodes)]; + } else if (nodes.name) { + nodes = [new AtRule2(nodes)]; + } else if (nodes.text) { + nodes = [new Comment2(nodes)]; + } else { + throw new Error("Unknown node type in node creation"); + } + let processed = nodes.map((i) => { + if (!i[my]) _Container.rebuild(i); + i = i.proxyOf; + if (i.parent) i.parent.removeChild(i); + if (i[isClean]) markTreeDirty(i); + if (!i.raws) i.raws = {}; + if (typeof i.raws.before === "undefined") { + if (sample && typeof sample.raws.before !== "undefined") { + i.raws.before = sample.raws.before.replace(/\S/g, ""); + } + } + i.parent = this.proxyOf; + return i; + }); + return processed; + } + prepend(...children2) { + children2 = children2.reverse(); + for (let child of children2) { + let nodes = this.normalize(child, this.first, "prepend").reverse(); + for (let node2 of nodes) this.proxyOf.nodes.unshift(node2); + for (let id in this.indexes) { + this.indexes[id] = this.indexes[id] + nodes.length; + } + } + this.markDirty(); + return this; + } + push(child) { + child.parent = this; + this.proxyOf.nodes.push(child); + return this; + } + removeAll() { + for (let node2 of this.proxyOf.nodes) node2.parent = void 0; + this.proxyOf.nodes = []; + this.markDirty(); + return this; + } + removeChild(child) { + child = this.index(child); + this.proxyOf.nodes[child].parent = void 0; + this.proxyOf.nodes.splice(child, 1); + let index; + for (let id in this.indexes) { + index = this.indexes[id]; + if (index >= child) { + this.indexes[id] = index - 1; + } + } + this.markDirty(); + return this; + } + replaceValues(pattern, opts, callback) { + if (!callback) { + callback = opts; + opts = {}; + } + this.walkDecls((decl2) => { + if (opts.props && !opts.props.includes(decl2.prop)) return; + if (opts.fast && !decl2.value.includes(opts.fast)) return; + decl2.value = decl2.value.replace(pattern, callback); + }); + this.markDirty(); + return this; + } + some(condition) { + return this.nodes.some(condition); + } + walk(callback) { + if (!this.proxyOf.nodes) return void 0; + let stack = [{ iterator: this.getIterator(), node: this.proxyOf }]; + while (stack.length > 0) { + let { iterator, node: node2 } = stack[stack.length - 1]; + let index = node2.indexes[iterator]; + if (index >= node2.proxyOf.nodes.length) { + delete node2.indexes[iterator]; + stack.pop(); + let parent = stack[stack.length - 1]; + if (parent) parent.node.indexes[parent.iterator] += 1; + continue; + } + let child = node2.proxyOf.nodes[index]; + let result; + try { + result = callback(child, index); + } catch (e) { + throw child.addToError(e); + } + if (result === false) { + for (let opened of stack) { + delete opened.node.indexes[opened.iterator]; + } + return false; + } + if (child.walk && child.proxyOf.nodes) { + stack.push({ iterator: child.getIterator(), node: child }); + } else { + node2.indexes[iterator] += 1; + } + } + return void 0; + } + walkAtRules(name2, callback) { + if (!callback) { + callback = name2; + return this.walk((child, i) => { + if (child.type === "atrule") { + return callback(child, i); + } + }); + } + if (name2 instanceof RegExp) { + return this.walk((child, i) => { + if (child.type === "atrule" && name2.test(child.name)) { + return callback(child, i); + } + }); + } + return this.walk((child, i) => { + if (child.type === "atrule" && child.name === name2) { + return callback(child, i); + } + }); + } + walkComments(callback) { + return this.walk((child, i) => { + if (child.type === "comment") { + return callback(child, i); + } + }); + } + walkDecls(prop, callback) { + if (!callback) { + callback = prop; + return this.walk((child, i) => { + if (child.type === "decl") { + return callback(child, i); + } + }); + } + if (prop instanceof RegExp) { + return this.walk((child, i) => { + if (child.type === "decl" && prop.test(child.prop)) { + return callback(child, i); + } + }); + } + return this.walk((child, i) => { + if (child.type === "decl" && child.prop === prop) { + return callback(child, i); + } + }); + } + walkRules(selector, callback) { + if (!callback) { + callback = selector; + return this.walk((child, i) => { + if (child.type === "rule") { + return callback(child, i); + } + }); + } + if (selector instanceof RegExp) { + return this.walk((child, i) => { + if (child.type === "rule" && selector.test(child.selector)) { + return callback(child, i); + } + }); + } + return this.walk((child, i) => { + if (child.type === "rule" && child.selector === selector) { + return callback(child, i); + } + }); + } + }; + Container2.registerParse = (dependant) => { + parse3 = dependant; + }; + Container2.registerRule = (dependant) => { + Rule2 = dependant; + }; + Container2.registerAtRule = (dependant) => { + AtRule2 = dependant; + }; + Container2.registerRoot = (dependant) => { + Root2 = dependant; + }; + module.exports = Container2; + Container2.default = Container2; + Container2.rebuild = (node2) => { + let stack = [node2]; + while (stack.length > 0) { + let next = stack.pop(); + if (next.type === "atrule") { + Object.setPrototypeOf(next, AtRule2.prototype); + } else if (next.type === "rule") { + Object.setPrototypeOf(next, Rule2.prototype); + } else if (next.type === "decl") { + Object.setPrototypeOf(next, Declaration2.prototype); + } else if (next.type === "comment") { + Object.setPrototypeOf(next, Comment2.prototype); + } else if (next.type === "root") { + Object.setPrototypeOf(next, Root2.prototype); + } + next[my] = true; + if (next.nodes) { + for (let child of next.nodes) stack.push(child); + } + } + }; } - /** - * Visit a BeginNode node. - * - * @param {nodes.BeginNode} node - */ - visitBeginNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/at-rule.js + var require_at_rule = __commonJS({ + "node_modules/postcss/lib/at-rule.js"(exports, module) { + "use strict"; + var Container2 = require_container(); + var AtRule2 = class extends Container2 { + constructor(defaults) { + super(defaults); + this.type = "atrule"; + } + append(...children2) { + if (!this.proxyOf.nodes) this.nodes = []; + return super.append(...children2); + } + prepend(...children2) { + if (!this.proxyOf.nodes) this.nodes = []; + return super.prepend(...children2); + } + }; + module.exports = AtRule2; + AtRule2.default = AtRule2; + Container2.registerAtRule(AtRule2); } - /** - * Visit a BlockArgumentNode node. - * - * @param {nodes.BlockArgumentNode} node - */ - visitBlockArgumentNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/document.js + var require_document = __commonJS({ + "node_modules/postcss/lib/document.js"(exports, module) { + "use strict"; + var Container2 = require_container(); + var LazyResult; + var Processor2; + var Document2 = class extends Container2 { + constructor(defaults) { + super({ type: "document", ...defaults }); + if (!this.nodes) { + this.nodes = []; + } + } + toResult(opts = {}) { + let lazy = new LazyResult(new Processor2(), this, opts); + return lazy.stringify(); + } + }; + Document2.registerLazyResult = (dependant) => { + LazyResult = dependant; + }; + Document2.registerProcessor = (dependant) => { + Processor2 = dependant; + }; + module.exports = Document2; + Document2.default = Document2; } - /** - * Visit a BlockLocalVariableNode node. - * - * @param {nodes.BlockLocalVariableNode} node - */ - visitBlockLocalVariableNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/nanoid/non-secure/index.cjs + var require_non_secure = __commonJS({ + "node_modules/nanoid/non-secure/index.cjs"(exports, module) { + var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"; + var customAlphabet = (alphabet, defaultSize = 21) => { + return (size = defaultSize) => { + let id = ""; + let i = size | 0; + while (i-- > 0) { + id += alphabet[Math.random() * alphabet.length | 0]; + } + return id; + }; + }; + var nanoid2 = (size = 21) => { + let id = ""; + let i = size | 0; + while (i-- > 0) { + id += urlAlphabet[Math.random() * 64 | 0]; + } + return id; + }; + module.exports = { nanoid: nanoid2, customAlphabet }; } - /** - * Visit a BlockNode node. - * - * @param {nodes.BlockNode} node - */ - visitBlockNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a BlockParameterNode node. - * - * @param {nodes.BlockParameterNode} node - */ - visitBlockParameterNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a BlockParametersNode node. - * - * @param {nodes.BlockParametersNode} node - */ - visitBlockParametersNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a BreakNode node. - * - * @param {nodes.BreakNode} node - */ - visitBreakNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a CallAndWriteNode node. - * - * @param {nodes.CallAndWriteNode} node - */ - visitCallAndWriteNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a CallNode node. - * - * @param {nodes.CallNode} node - */ - visitCallNode(node) { - this.visitChildNodes(node); + }); + + // stubs/path.mjs + var path_exports = {}; + __export(path_exports, { + dirname: () => dirname2, + isAbsolute: () => isAbsolute2, + join: () => join2, + relative: () => relative, + resolve: () => resolve, + sep: () => sep + }); + function isAbsolute2(path) { + return path.startsWith("/"); + } + function resolve(...parts) { + const joined = parts.filter(Boolean).join("/").replace(/\/+/g, "/"); + return joined.startsWith("/") ? joined : "/" + joined; + } + function dirname2(path) { + const index = path.lastIndexOf("/"); + return index <= 0 ? "/" : path.slice(0, index); + } + function join2(...parts) { + return parts.filter(Boolean).join("/").replace(/\/+/g, "/"); + } + function relative(from, to) { + if (to.startsWith(from + "/")) return to.slice(from.length + 1); + return to; + } + var sep; + var init_path = __esm({ + "stubs/path.mjs"() { + sep = "/"; } - /** - * Visit a CallOperatorWriteNode node. - * - * @param {nodes.CallOperatorWriteNode} node - */ - visitCallOperatorWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/source-map-js/lib/base64.js + var require_base64 = __commonJS({ + "node_modules/source-map-js/lib/base64.js"(exports) { + var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); + exports.encode = function(number2) { + if (0 <= number2 && number2 < intToCharMap.length) { + return intToCharMap[number2]; + } + throw new TypeError("Must be between 0 and 63: " + number2); + }; + exports.decode = function(charCode) { + var bigA = 65; + var bigZ = 90; + var littleA = 97; + var littleZ = 122; + var zero = 48; + var nine = 57; + var plus = 43; + var slash = 47; + var littleOffset = 26; + var numberOffset = 52; + if (bigA <= charCode && charCode <= bigZ) { + return charCode - bigA; + } + if (littleA <= charCode && charCode <= littleZ) { + return charCode - littleA + littleOffset; + } + if (zero <= charCode && charCode <= nine) { + return charCode - zero + numberOffset; + } + if (charCode == plus) { + return 62; + } + if (charCode == slash) { + return 63; + } + return -1; + }; } - /** - * Visit a CallOrWriteNode node. - * - * @param {nodes.CallOrWriteNode} node - */ - visitCallOrWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/source-map-js/lib/base64-vlq.js + var require_base64_vlq = __commonJS({ + "node_modules/source-map-js/lib/base64-vlq.js"(exports) { + var base642 = require_base64(); + var VLQ_BASE_SHIFT = 5; + var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + var VLQ_BASE_MASK = VLQ_BASE - 1; + var VLQ_CONTINUATION_BIT = VLQ_BASE; + function toVLQSigned(aValue) { + return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0; + } + function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative ? -shifted : shifted; + } + exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + var vlq = toVLQSigned(aValue); + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base642.encode(digit); + } while (vlq > 0); + return encoded; + }; + exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + digit = base642.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; + }; } - /** - * Visit a CallTargetNode node. - * - * @param {nodes.CallTargetNode} node - */ - visitCallTargetNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/source-map-js/lib/util.js + var require_util = __commonJS({ + "node_modules/source-map-js/lib/util.js"(exports) { + function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } + } + exports.getArg = getArg; + var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; + var dataUrlRegexp = /^data:.+\,.+$/; + function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; + } + exports.urlParse = urlParse; + function urlGenerate(aParsedUrl) { + var url = ""; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ":"; + } + url += "//"; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + "@"; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port; + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; + } + exports.urlGenerate = urlGenerate; + var MAX_CACHED_INPUTS = 32; + function lruMemoize(f2) { + var cache = []; + return function(input) { + for (var i = 0; i < cache.length; i++) { + if (cache[i].input === input) { + var temp = cache[0]; + cache[0] = cache[i]; + cache[i] = temp; + return cache[0].result; + } + } + var result = f2(input); + cache.unshift({ + input, + result + }); + if (cache.length > MAX_CACHED_INPUTS) { + cache.pop(); + } + return result; + }; + } + var normalize2 = lruMemoize(function normalize3(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute3 = exports.isAbsolute(path); + var parts = []; + var start = 0; + var i = 0; + while (true) { + start = i; + i = path.indexOf("/", start); + if (i === -1) { + parts.push(path.slice(start)); + break; + } else { + parts.push(path.slice(start, i)); + while (i < path.length && path[i] === "/") { + i++; + } + } + } + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === ".") { + parts.splice(i, 1); + } else if (part === "..") { + up++; + } else if (up > 0) { + if (part === "") { + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join("/"); + if (path === "") { + path = isAbsolute3 ? "/" : "."; + } + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; + }); + exports.normalize = normalize2; + function join3(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || "/"; + } + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + var joined = aPath.charAt(0) === "/" ? aPath : normalize2(aRoot.replace(/\/+$/, "") + "/" + aPath); + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; + } + exports.join = join3; + exports.isAbsolute = function(aPath) { + return aPath.charAt(0) === "/" || urlRegexp.test(aPath); + }; + function relative2(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + aRoot = aRoot.replace(/\/$/, ""); + var level = 0; + while (aPath.indexOf(aRoot + "/") !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + ++level; + } + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); + } + exports.relative = relative2; + var supportsNullProto = (function() { + var obj = /* @__PURE__ */ Object.create(null); + return !("__proto__" in obj); + })(); + function identity2(s) { + return s; + } + function toSetString(aStr) { + if (isProtoString(aStr)) { + return "$" + aStr; + } + return aStr; + } + exports.toSetString = supportsNullProto ? identity2 : toSetString; + function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + return aStr; + } + exports.fromSetString = supportsNullProto ? identity2 : fromSetString; + function isProtoString(s) { + if (!s) { + return false; + } + var length = s.length; + if (length < 9) { + return false; + } + if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) { + return false; + } + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36) { + return false; + } + } + return true; + } + function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByOriginalPositions = compareByOriginalPositions; + function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) { + var cmp; + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource; + function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine; + function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + if (aStr1 === null) { + return 1; + } + if (aStr2 === null) { + return -1; + } + if (aStr1 > aStr2) { + return 1; + } + return -1; + } + function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, "")); + } + exports.parseSourceMapInput = parseSourceMapInput; + function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ""; + if (sourceRoot) { + if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") { + sourceRoot += "/"; + } + sourceURL = sourceRoot + sourceURL; + } + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + var index = parsed.path.lastIndexOf("/"); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join3(urlGenerate(parsed), sourceURL); + } + return normalize2(sourceURL); + } + exports.computeSourceURL = computeSourceURL; } - /** - * Visit a CapturePatternNode node. - * - * @param {nodes.CapturePatternNode} node - */ - visitCapturePatternNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/source-map-js/lib/array-set.js + var require_array_set = __commonJS({ + "node_modules/source-map-js/lib/array-set.js"(exports) { + var util = require_util(); + var has = Object.prototype.hasOwnProperty; + var hasNativeMap = typeof Map !== "undefined"; + function ArraySet() { + this._array = []; + this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null); + } + ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; + }; + ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; + }; + ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } + }; + ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } + }; + ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + throw new Error('"' + aStr + '" is not in the set.'); + }; + ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error("No element indexed by " + aIdx); + }; + ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); + }; + exports.ArraySet = ArraySet; } - /** - * Visit a CaseMatchNode node. - * - * @param {nodes.CaseMatchNode} node - */ - visitCaseMatchNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/source-map-js/lib/mapping-list.js + var require_mapping_list = __commonJS({ + "node_modules/source-map-js/lib/mapping-list.js"(exports) { + var util = require_util(); + function generatedPositionAfter(mappingA, mappingB) { + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; + } + function MappingList() { + this._array = []; + this._sorted = true; + this._last = { generatedLine: -1, generatedColumn: 0 }; + } + MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; + }; + exports.MappingList = MappingList; } - /** - * Visit a CaseNode node. - * - * @param {nodes.CaseNode} node - */ - visitCaseNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/source-map-js/lib/source-map-generator.js + var require_source_map_generator = __commonJS({ + "node_modules/source-map-js/lib/source-map-generator.js"(exports) { + var base64VLQ = require_base64_vlq(); + var util = require_util(); + var ArraySet = require_array_set().ArraySet; + var MappingList = require_mapping_list().MappingList; + function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, "file", null); + this._sourceRoot = util.getArg(aArgs, "sourceRoot", null); + this._skipValidation = util.getArg(aArgs, "skipValidation", false); + this._ignoreInvalidMapping = util.getArg(aArgs, "ignoreInvalidMapping", false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; + } + SourceMapGenerator.prototype._version = 3; + SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, { + file: aSourceMapConsumer.file, + sourceRoot + })); + aSourceMapConsumer.eachMapping(function(mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function(sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, "generated"); + var original = util.getArg(aArgs, "original", null); + var source = util.getArg(aArgs, "source", null); + var name2 = util.getArg(aArgs, "name", null); + if (!this._skipValidation) { + if (this._validateMapping(generated, original, source, name2) === false) { + return; + } + } + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + if (name2 != null) { + name2 = String(name2); + if (!this._names.has(name2)) { + this._names.add(name2); + } + } + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source, + name: name2 + }); + }; + SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + if (aSourceContent != null) { + if (!this._sourcesContents) { + this._sourcesContents = /* @__PURE__ */ Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + `SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.` + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + var newSources = new ArraySet(); + var newNames = new ArraySet(); + this._mappings.unsortedForEach(function(mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source); + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + var name2 = mapping.name; + if (name2 != null && !newNames.has(name2)) { + newNames.add(name2); + } + }, this); + this._sources = newSources; + this._names = newNames; + aSourceMapConsumer.sources.forEach(function(sourceFile2) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile2); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile2 = util.join(aSourceMapPath, sourceFile2); + } + if (sourceRoot != null) { + sourceFile2 = util.relative(sourceRoot, sourceFile2); + } + this.setSourceContent(sourceFile2, content); + } + }, this); + }; + SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) { + if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") { + var message = "original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values."; + if (this._ignoreInvalidMapping) { + if (typeof console !== "undefined" && console.warn) { + console.warn(message); + } + return false; + } else { + throw new Error(message); + } + } + if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) { + return; + } else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) { + return; + } else { + var message = "Invalid mapping: " + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + }); + if (this._ignoreInvalidMapping) { + if (typeof console !== "undefined" && console.warn) { + console.warn(message); + } + return false; + } else { + throw new Error(message); + } + } + }; + SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ""; + var next; + var mapping; + var nameIdx; + var sourceIdx; + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = ""; + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + var lineDelta = mapping.generatedLine - previousGeneratedLine; + next += lineDelta === 1 ? ";" : ";".repeat(lineDelta); + previousGeneratedLine = mapping.generatedLine; + } else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ","; + } + } + next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + result += next; + } + return result; + }; + SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function(source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null; + }, this); + }; + SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + return map; + }; + SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + exports.SourceMapGenerator = SourceMapGenerator; } - /** - * Visit a ClassNode node. - * - * @param {nodes.ClassNode} node - */ - visitClassNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/source-map-js/lib/binary-search.js + var require_binary_search = __commonJS({ + "node_modules/source-map-js/lib/binary-search.js"(exports) { + exports.GREATEST_LOWER_BOUND = 1; + exports.LEAST_UPPER_BOUND = 2; + function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + return mid; + } else if (cmp > 0) { + if (aHigh - mid > 1) { + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } else { + if (mid - aLow > 1) { + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } + } + exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + var index = recursiveSearch( + -1, + aHaystack.length, + aNeedle, + aHaystack, + aCompare, + aBias || exports.GREATEST_LOWER_BOUND + ); + if (index < 0) { + return -1; + } + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + return index; + }; } - /** - * Visit a ClassVariableAndWriteNode node. - * - * @param {nodes.ClassVariableAndWriteNode} node - */ - visitClassVariableAndWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/source-map-js/lib/quick-sort.js + var require_quick_sort = __commonJS({ + "node_modules/source-map-js/lib/quick-sort.js"(exports) { + function SortTemplate(comparator) { + function swap(ary, x2, y2) { + var temp = ary[x2]; + ary[x2] = ary[y2]; + ary[y2] = temp; + } + function randomIntInRange(low, high) { + return Math.round(low + Math.random() * (high - low)); + } + function doQuickSort(ary, comparator2, p2, r2) { + if (p2 < r2) { + var pivotIndex = randomIntInRange(p2, r2); + var i = p2 - 1; + swap(ary, pivotIndex, r2); + var pivot = ary[r2]; + for (var j2 = p2; j2 < r2; j2++) { + if (comparator2(ary[j2], pivot, false) <= 0) { + i += 1; + swap(ary, i, j2); + } + } + swap(ary, i + 1, j2); + var q2 = i + 1; + doQuickSort(ary, comparator2, p2, q2 - 1); + doQuickSort(ary, comparator2, q2 + 1, r2); + } + } + return doQuickSort; + } + function cloneSort(comparator) { + let template = SortTemplate.toString(); + let templateFn = new Function(`return ${template}`)(); + return templateFn(comparator); + } + var isEvalAllowed = (function() { + try { + new Function("return 0")(); + return true; + } catch { + return false; + } + })(); + var sortCache = /* @__PURE__ */ new WeakMap(); + exports.quickSort = function(ary, comparator, start = 0) { + let doQuickSort = isEvalAllowed ? sortCache.get(comparator) : SortTemplate(comparator); + if (doQuickSort === void 0) { + doQuickSort = cloneSort(comparator); + sortCache.set(comparator, doQuickSort); + } + doQuickSort(ary, comparator, start, ary.length - 1); + }; } - /** - * Visit a ClassVariableOperatorWriteNode node. - * - * @param {nodes.ClassVariableOperatorWriteNode} node - */ - visitClassVariableOperatorWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/source-map-js/lib/source-map-consumer.js + var require_source_map_consumer = __commonJS({ + "node_modules/source-map-js/lib/source-map-consumer.js"(exports) { + var util = require_util(); + var binarySearch = require_binary_search(); + var ArraySet = require_array_set().ArraySet; + var base64VLQ = require_base64_vlq(); + var quickSort = require_quick_sort().quickSort; + var MAX_SECTION_OFFSET_LINE = 1e7; + function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === "string") { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); + } + SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); + }; + SourceMapConsumer.prototype._version = 3; + SourceMapConsumer.prototype.__generatedMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", { + configurable: true, + enumerable: true, + get: function() { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + return this.__generatedMappings; + } + }); + SourceMapConsumer.prototype.__originalMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", { + configurable: true, + enumerable: true, + get: function() { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + return this.__originalMappings; + } + }); + SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c2 = aStr.charAt(index); + return c2 === ";" || c2 === ","; + }; + SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + SourceMapConsumer.GENERATED_ORDER = 1; + SourceMapConsumer.ORIGINAL_ORDER = 2; + SourceMapConsumer.GREATEST_LOWER_BOUND = 1; + SourceMapConsumer.LEAST_UPPER_BOUND = 2; + SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + var sourceRoot = this.sourceRoot; + var boundCallback = aCallback.bind(context); + var names = this._names; + var sources = this._sources; + var sourceMapURL = this._sourceMapURL; + for (var i = 0, n = mappings.length; i < n; i++) { + var mapping = mappings[i]; + var source = mapping.source === null ? null : sources.at(mapping.source); + if (source !== null) { + source = util.computeSourceURL(sourceRoot, source, sourceMapURL); + } + boundCallback({ + source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : names.at(mapping.name) + }); + } + }; + SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, "line"); + var needle = { + source: util.getArg(aArgs, "source"), + originalLine: line, + originalColumn: util.getArg(aArgs, "column", 0) + }; + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + var mappings = []; + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND + ); + if (index >= 0) { + var mapping = this._originalMappings[index]; + if (aArgs.column === void 0) { + var originalLine = mapping.originalLine; + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, "generatedLine", null), + column: util.getArg(mapping, "generatedColumn", null), + lastColumn: util.getArg(mapping, "lastGeneratedColumn", null) + }); + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, "generatedLine", null), + column: util.getArg(mapping, "generatedColumn", null), + lastColumn: util.getArg(mapping, "lastGeneratedColumn", null) + }); + mapping = this._originalMappings[++index]; + } + } + } + return mappings; + }; + exports.SourceMapConsumer = SourceMapConsumer; + function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === "string") { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + var version3 = util.getArg(sourceMap, "version"); + var sources = util.getArg(sourceMap, "sources"); + var names = util.getArg(sourceMap, "names", []); + var sourceRoot = util.getArg(sourceMap, "sourceRoot", null); + var sourcesContent = util.getArg(sourceMap, "sourcesContent", null); + var mappings = util.getArg(sourceMap, "mappings"); + var file = util.getArg(sourceMap, "file", null); + if (version3 != this._version) { + throw new Error("Unsupported version: " + version3); + } + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + sources = sources.map(String).map(util.normalize).map(function(source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source; + }); + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + this._absoluteSources = this._sources.toArray().map(function(s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; + } + BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + return -1; + }; + BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent( + smc._sources.toArray(), + smc.sourceRoot + ); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function(s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping(); + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + destOriginalMappings.push(destMapping); + } + destGeneratedMappings.push(destMapping); + } + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + return smc; + }; + BasicSourceMapConsumer.prototype._version = 3; + Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", { + get: function() { + return this._absoluteSources.slice(); + } + }); + function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; + } + var compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine; + function sortGenerated(array2, start) { + let l = array2.length; + let n = array2.length - start; + if (n <= 1) { + return; + } else if (n == 2) { + let a = array2[start]; + let b3 = array2[start + 1]; + if (compareGenerated(a, b3) > 0) { + array2[start] = b3; + array2[start + 1] = a; + } + } else if (n < 20) { + for (let i = start; i < l; i++) { + for (let j2 = i; j2 > start; j2--) { + let a = array2[j2 - 1]; + let b3 = array2[j2]; + if (compareGenerated(a, b3) <= 0) { + break; + } + array2[j2 - 1] = b3; + array2[j2] = a; + } + } + } else { + quickSort(array2, compareGenerated, start); + } + } + BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + let subarrayStart = 0; + while (index < length) { + if (aStr.charAt(index) === ";") { + generatedLine++; + index++; + previousGeneratedColumn = 0; + sortGenerated(generatedMappings, subarrayStart); + subarrayStart = generatedMappings.length; + } else if (aStr.charAt(index) === ",") { + index++; + } else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + if (segment.length === 2) { + throw new Error("Found a source, but no line and column"); + } + if (segment.length === 3) { + throw new Error("Found a source and line, but no column"); + } + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + if (segment.length > 1) { + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + mapping.originalLine += 1; + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + if (segment.length > 4) { + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + generatedMappings.push(mapping); + if (typeof mapping.originalLine === "number") { + let currentSource = mapping.source; + while (originalMappings.length <= currentSource) { + originalMappings.push(null); + } + if (originalMappings[currentSource] === null) { + originalMappings[currentSource] = []; + } + originalMappings[currentSource].push(mapping); + } + } + } + sortGenerated(generatedMappings, subarrayStart); + this.__generatedMappings = generatedMappings; + for (var i = 0; i < originalMappings.length; i++) { + if (originalMappings[i] != null) { + quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource); + } + } + this.__originalMappings = [].concat(...originalMappings); + }; + BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) { + if (aNeedle[aLineName] <= 0) { + throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]); + } + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + mapping.lastGeneratedColumn = Infinity; + } + }; + BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, "line"), + generatedColumn: util.getArg(aArgs, "column") + }; + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + if (index >= 0) { + var mapping = this._generatedMappings[index]; + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, "source", null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name2 = util.getArg(mapping, "name", null); + if (name2 !== null) { + name2 = this._names.at(name2); + } + return { + source, + line: util.getArg(mapping, "originalLine", null), + column: util.getArg(mapping, "originalColumn", null), + name: name2 + }; + } + } + return { + source: null, + line: null, + column: null, + name: null + }; + }; + BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) { + return sc == null; + }); + }; + BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + var url; + if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) { + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]; + } + if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + if (nullOnMissing) { + return null; + } else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, "source"); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + var needle = { + source, + originalLine: util.getArg(aArgs, "line"), + originalColumn: util.getArg(aArgs, "column") + }; + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + if (index >= 0) { + var mapping = this._originalMappings[index]; + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, "generatedLine", null), + column: util.getArg(mapping, "generatedColumn", null), + lastColumn: util.getArg(mapping, "lastGeneratedColumn", null) + }; + } + } + return { + line: null, + column: null, + lastColumn: null + }; + }; + exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === "string") { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + var version3 = util.getArg(sourceMap, "version"); + var sections = util.getArg(sourceMap, "sections"); + if (version3 != this._version) { + throw new Error("Unsupported version: " + version3); + } + this._sources = new ArraySet(); + this._names = new ArraySet(); + var lastOffset = { + line: -1, + column: 0 + }; + var maxOffsetLine = 0; + this._sections = sections.map(function(s) { + if (s.url) { + throw new Error("Support for url field in sections not implemented."); + } + var offset = util.getArg(s, "offset"); + var offsetLine = util.getArg(offset, "line"); + var offsetColumn = util.getArg(offset, "column"); + if (!isValidOffset(offsetLine) || !isValidOffset(offsetColumn)) { + throw new Error("Section offset line and column must be non-negative integers."); + } + if (offsetLine > MAX_SECTION_OFFSET_LINE) { + throw new Error("Section offset line must not exceed " + MAX_SECTION_OFFSET_LINE + "."); + } + if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) { + throw new Error("Section offsets must be ordered and non-overlapping."); + } + lastOffset = offset; + var consumer = new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL); + var totalOffsetLine = offsetLine + (consumer._maxOffsetLine || 0); + if (totalOffsetLine > MAX_SECTION_OFFSET_LINE) { + throw new Error("Section offset line must not exceed " + MAX_SECTION_OFFSET_LINE + ", including offsets of nested sections."); + } + if (totalOffsetLine > maxOffsetLine) { + maxOffsetLine = totalOffsetLine; + } + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer + }; + }); + this._maxOffsetLine = maxOffsetLine; + } + function isValidOffset(aValue) { + return typeof aValue === "number" && aValue >= 0 && aValue <= 9007199254740991 && // Number.MAX_SAFE_INTEGER + Math.floor(aValue) === aValue; + } + IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + IndexedSourceMapConsumer.prototype._version = 3; + Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", { + get: function() { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + var sectionSources = this._sections[i].consumer.sources; + for (var j2 = 0; j2 < sectionSources.length; j2++) { + sources.push(sectionSources[j2]); + } + } + return sources; + } + }); + IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, "line"), + generatedColumn: util.getArg(aArgs, "column") + }; + var sectionIndex = binarySearch.search( + needle, + this._sections, + function(needle2, section2) { + var cmp = needle2.generatedLine - section2.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + return needle2.generatedColumn - section2.generatedOffset.generatedColumn; + } + ); + var section = this._sections[sectionIndex]; + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + return section.consumer.originalPositionFor({ + line: needle.generatedLine - (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), + bias: aArgs.bias + }); + }; + IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function(s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var content = section.consumer.sourceContentFor(aSource, true); + if (content || content === "") { + return content; + } + } + if (nullOnMissing) { + return null; + } else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0) + }; + return ret; + } + } + return { + line: null, + column: null + }; + }; + IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j2 = 0; j2 < sectionMappings.length; j2++) { + var mapping = sectionMappings[j2]; + var source = section.consumer._sources.at(mapping.source); + if (source !== null) { + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + } + this._sources.add(source); + source = this._sources.indexOf(source); + var name2 = null; + if (mapping.name) { + name2 = section.consumer._names.at(mapping.name); + this._names.add(name2); + name2 = this._names.indexOf(name2); + } + var adjustedMapping = { + source, + generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name2 + }; + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === "number") { + this.__originalMappings.push(adjustedMapping); + } + } + } + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; } - /** - * Visit a ClassVariableOrWriteNode node. - * - * @param {nodes.ClassVariableOrWriteNode} node - */ - visitClassVariableOrWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/source-map-js/lib/source-node.js + var require_source_node = __commonJS({ + "node_modules/source-map-js/lib/source-node.js"(exports) { + var SourceMapGenerator = require_source_map_generator().SourceMapGenerator; + var util = require_util(); + var REGEX_NEWLINE = /(\r?\n)/; + var NEWLINE_CODE = 10; + var isSourceNode = "$$$isSourceNode$$$"; + function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); + } + SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + var node2 = new SourceNode(); + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + var newLine = getNextLine() || ""; + return lineContents + newLine; + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0; + } + }; + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + var lastMapping = null; + aSourceMapConsumer.eachMapping(function(mapping) { + if (lastMapping !== null) { + if (lastGeneratedLine < mapping.generatedLine) { + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + } else { + var nextLine = remainingLines[remainingLinesIndex] || ""; + var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + lastMapping = mapping; + return; + } + } + while (lastGeneratedLine < mapping.generatedLine) { + if (remainingLinesIndex >= remainingLines.length) { + lastGeneratedLine = mapping.generatedLine; + break; + } + node2.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ""; + node2.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + addMappingWithCode(lastMapping, shiftNextLine()); + } + node2.add(remainingLines.splice(remainingLinesIndex).join("")); + } + aSourceMapConsumer.sources.forEach(function(sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node2.setSourceContent(sourceFile, content); + } + }); + return node2; + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === void 0) { + node2.add(code); + } else { + var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source; + node2.add(new SourceNode( + mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name + )); + } + } + }; + SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function(chunk) { + this.add(chunk); + }, this); + } else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length - 1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } else { + if (chunk !== "") { + aFn(chunk, { + source: this.source, + line: this.line, + column: this.column, + name: this.name + }); + } + } + } + }; + SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len - 1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; + }; + SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } else if (typeof lastChild === "string") { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } else { + this.children.push("".replace(aPattern, aReplacement)); + } + return this; + }; + SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function(chunk) { + str += chunk; + }); + return str; + }; + SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function(chunk, original) { + generated.code += chunk; + if (original.source !== null && original.line !== null && original.column !== null) { + if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function(sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + return { code: generated.code, map }; + }; + exports.SourceNode = SourceNode; } - /** - * Visit a ClassVariableReadNode node. - * - * @param {nodes.ClassVariableReadNode} node - */ - visitClassVariableReadNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/source-map-js/source-map.js + var require_source_map = __commonJS({ + "node_modules/source-map-js/source-map.js"(exports) { + exports.SourceMapGenerator = require_source_map_generator().SourceMapGenerator; + exports.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer; + exports.SourceNode = require_source_node().SourceNode; } - /** - * Visit a ClassVariableTargetNode node. - * - * @param {nodes.ClassVariableTargetNode} node - */ - visitClassVariableTargetNode(node) { - this.visitChildNodes(node); + }); + + // stubs/url.mjs + var url_exports = {}; + __export(url_exports, { + fileURLToPath: () => fileURLToPath, + pathToFileURL: () => pathToFileURL + }); + var fileURLToPath, pathToFileURL; + var init_url = __esm({ + "stubs/url.mjs"() { + fileURLToPath = void 0; + pathToFileURL = void 0; } - /** - * Visit a ClassVariableWriteNode node. - * - * @param {nodes.ClassVariableWriteNode} node - */ - visitClassVariableWriteNode(node) { - this.visitChildNodes(node); + }); + + // stubs/fs.mjs + var fs_exports = {}; + __export(fs_exports, { + existsSync: () => existsSync, + readFileSync: () => readFileSync, + realpathSync: () => realpathSync + }); + function existsSync() { + return false; + } + function readFileSync() { + throw new Error("herb-embedded: filesystem access is unavailable in the embedded engine"); + } + function realpathSync(path) { + return path; + } + var init_fs = __esm({ + "stubs/fs.mjs"() { } - /** - * Visit a ConstantAndWriteNode node. - * - * @param {nodes.ConstantAndWriteNode} node - */ - visitConstantAndWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/previous-map.js + var require_previous_map = __commonJS({ + "node_modules/postcss/lib/previous-map.js"(exports, module) { + "use strict"; + var { existsSync: existsSync2, readFileSync: readFileSync2, realpathSync: realpathSync2 } = (init_fs(), __toCommonJS(fs_exports)); + var { dirname: dirname3, isAbsolute: isAbsolute3, join: join3, relative: relative2, sep: sep2 } = (init_path(), __toCommonJS(path_exports)); + var { SourceMapConsumer, SourceMapGenerator } = require_source_map(); + function realPath(path) { + try { + return realpathSync2(path); + } catch { + return path; + } + } + function fromBase64(str) { + if (Buffer) { + return Buffer.from(str, "base64").toString(); + } else { + return window.atob(str); + } + } + var PreviousMap = class { + constructor(css, opts) { + if (opts.map === false) return; + if (opts.unsafeMap) this.unsafeMap = true; + this.loadAnnotation(css); + this.inline = this.startWith(this.annotation, "data:"); + let prev = opts.map ? opts.map.prev : void 0; + let text = this.loadMap(opts.from, prev); + if (!this.mapFile && opts.from) { + this.mapFile = opts.from; + } + if (this.mapFile) this.root = dirname3(this.mapFile); + if (text) this.text = text; + } + consumer() { + if (!this.consumerCache) { + this.consumerCache = new SourceMapConsumer(this.json || this.text); + } + return this.consumerCache; + } + decodeInline(text) { + let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/; + let baseUri = /^data:application\/json;base64,/; + let charsetUri = /^data:application\/json;charset=utf-?8,/; + let uri = /^data:application\/json,/; + let uriMatch = text.match(charsetUri) || text.match(uri); + if (uriMatch) { + return decodeURIComponent(text.substr(uriMatch[0].length)); + } + let baseUriMatch = text.match(baseCharsetUri) || text.match(baseUri); + if (baseUriMatch) { + return fromBase64(text.substr(baseUriMatch[0].length)); + } + let encoding = text.slice("data:application/json;".length); + encoding = encoding.slice(0, encoding.indexOf(",")); + throw new Error("Unsupported source map encoding " + encoding); + } + getAnnotationURL(sourceMapString) { + return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, "").trim(); + } + isMap(map) { + if (typeof map !== "object") return false; + return typeof map.mappings === "string" || typeof map._mappings === "string" || Array.isArray(map.sections); + } + loadAnnotation(css) { + let comments = css.match(/\/\*\s*# sourceMappingURL=/g); + if (!comments) return; + let start = css.lastIndexOf(comments.pop()); + let end = css.indexOf("*/", start); + if (start > -1 && end > -1) { + this.annotation = this.getAnnotationURL(css.substring(start, end)); + } + } + loadFile(path, cssFile, trusted) { + if (!trusted && !this.unsafeMap) { + if (!/\.map$/i.test(path)) return void 0; + if (!cssFile) return void 0; + let rel = relative2(realPath(dirname3(cssFile)), realPath(path)); + if (rel === ".." || rel.startsWith(".." + sep2) || isAbsolute3(rel)) { + return void 0; + } + } + this.root = dirname3(path); + if (existsSync2(path)) { + this.mapFile = path; + return readFileSync2(path, "utf-8").toString().trim(); + } + } + loadMap(file, prev) { + if (prev === false) return false; + if (prev) { + if (typeof prev === "string") { + return prev; + } else if (typeof prev === "function") { + let prevPath = prev(file); + if (prevPath) { + let map = this.loadFile(prevPath, file, true); + if (!map) { + throw new Error( + "Unable to load previous source map: " + prevPath.toString() + ); + } + return map; + } + } else if (prev instanceof SourceMapConsumer) { + return SourceMapGenerator.fromSourceMap(prev).toString(); + } else if (prev instanceof SourceMapGenerator) { + return prev.toString(); + } else if (this.isMap(prev)) { + return JSON.stringify(prev); + } else { + throw new Error( + "Unsupported previous source map format: " + prev.toString() + ); + } + } else if (this.inline) { + return this.decodeInline(this.annotation); + } else if (this.annotation) { + let map = this.annotation; + if (file) map = join3(dirname3(file), map); + let unknown2 = this.loadFile(map, file, false); + if (unknown2) { + try { + this.json = JSON.parse(unknown2.replace(/^\)]}'[^\n]*\n/, "")); + } catch { + return void 0; + } + } + return unknown2; + } + } + startWith(string2, start) { + if (!string2) return false; + return string2.substr(0, start.length) === start; + } + withContent() { + return !!(this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0); + } + }; + module.exports = PreviousMap; + PreviousMap.default = PreviousMap; } - /** - * Visit a ConstantOperatorWriteNode node. - * - * @param {nodes.ConstantOperatorWriteNode} node - */ - visitConstantOperatorWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/input.js + var require_input = __commonJS({ + "node_modules/postcss/lib/input.js"(exports, module) { + "use strict"; + var { nanoid: nanoid2 } = require_non_secure(); + var { isAbsolute: isAbsolute3, resolve: resolve2 } = (init_path(), __toCommonJS(path_exports)); + var { SourceMapConsumer, SourceMapGenerator } = require_source_map(); + var { fileURLToPath: fileURLToPath2, pathToFileURL: pathToFileURL2 } = (init_url(), __toCommonJS(url_exports)); + var CssSyntaxError2 = require_css_syntax_error(); + var PreviousMap = require_previous_map(); + var terminalHighlight = require_terminal_highlight(); + var lineToIndexCache = /* @__PURE__ */ Symbol("lineToIndexCache"); + var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator); + var pathAvailable = Boolean(resolve2 && isAbsolute3); + function getLineToIndex(input) { + if (input[lineToIndexCache]) return input[lineToIndexCache]; + let lines = input.css.split("\n"); + let lineToIndex = new Array(lines.length); + let prevIndex = 0; + for (let i = 0, l = lines.length; i < l; i++) { + lineToIndex[i] = prevIndex; + prevIndex += lines[i].length + 1; + } + input[lineToIndexCache] = lineToIndex; + return lineToIndex; + } + var Input2 = class { + get from() { + return this.file || this.id; + } + constructor(css, opts = {}) { + if (css === null || typeof css === "undefined" || typeof css === "object" && !css.toString) { + throw new Error(`PostCSS received ${css} instead of CSS string`); + } + this.css = css.toString(); + if (this.css[0] === "\uFEFF" || this.css[0] === "\uFFFE") { + this.hasBOM = true; + this.css = this.css.slice(1); + } else { + this.hasBOM = false; + } + this.document = this.css; + if (opts.document) this.document = opts.document.toString(); + if (opts.from) { + if (!pathAvailable || /^\w+:\/\//.test(opts.from) || isAbsolute3(opts.from)) { + this.file = opts.from; + } else { + this.file = resolve2(opts.from); + } + } + if (pathAvailable && sourceMapAvailable) { + let map = new PreviousMap(this.css, opts); + if (map.text) { + this.map = map; + let file = map.consumer().file; + if (!this.file && file) this.file = this.mapResolve(file); + } + } + if (!this.file) { + this.id = ""; + } + if (this.map) this.map.file = this.from; + } + error(message, line, column, opts = {}) { + let endColumn, endLine, endOffset, offset, result; + if (line && typeof line === "object") { + let start = line; + let end = column; + if (typeof start.offset === "number") { + offset = start.offset; + let pos = this.fromOffset(offset); + line = pos.line; + column = pos.col; + } else { + line = start.line; + column = start.column; + offset = this.fromLineAndColumn(line, column); + } + if (typeof end.offset === "number") { + endOffset = end.offset; + let pos = this.fromOffset(endOffset); + endLine = pos.line; + endColumn = pos.col; + } else { + endLine = end.line; + endColumn = end.column; + endOffset = this.fromLineAndColumn(end.line, end.column); + } + } else if (!column) { + offset = line; + let pos = this.fromOffset(offset); + line = pos.line; + column = pos.col; + } else { + offset = this.fromLineAndColumn(line, column); + } + let origin = this.origin(line, column, endLine, endColumn); + if (origin) { + result = new CssSyntaxError2( + message, + origin.endLine === void 0 ? origin.line : { column: origin.column, line: origin.line }, + origin.endLine === void 0 ? origin.column : { column: origin.endColumn, line: origin.endLine }, + origin.source, + origin.file, + opts.plugin + ); + } else { + result = new CssSyntaxError2( + message, + endLine === void 0 ? line : { column, line }, + endLine === void 0 ? column : { column: endColumn, line: endLine }, + this.css, + this.file, + opts.plugin + ); + } + result.input = { + column, + endColumn, + endLine, + endOffset, + line, + offset, + source: this.css + }; + if (this.file) { + if (pathToFileURL2) { + result.input.url = pathToFileURL2(this.file).toString(); + } + result.input.file = this.file; + } + return result; + } + fromLineAndColumn(line, column) { + let lineToIndex = getLineToIndex(this); + let index = lineToIndex[line - 1]; + return index + column - 1; + } + fromOffset(offset) { + let lineToIndex = getLineToIndex(this); + let lastLine = lineToIndex[lineToIndex.length - 1]; + let min = 0; + if (offset >= lastLine) { + min = lineToIndex.length - 1; + } else { + let max = lineToIndex.length - 2; + let mid; + while (min < max) { + mid = min + (max - min >> 1); + if (offset < lineToIndex[mid]) { + max = mid - 1; + } else if (offset >= lineToIndex[mid + 1]) { + min = mid + 1; + } else { + min = mid; + break; + } + } + } + return { + col: offset - lineToIndex[min] + 1, + line: min + 1 + }; + } + mapResolve(file) { + if (/^\w+:\/\//.test(file)) { + return file; + } + return resolve2(this.map.consumer().sourceRoot || this.map.root || ".", file); + } + origin(line, column, endLine, endColumn) { + if (!this.map) return false; + let consumer = this.map.consumer(); + let from = consumer.originalPositionFor({ column: column - 1, line }); + if (!from.source) return false; + let to; + if (typeof endLine === "number") { + let toPosition = consumer.originalPositionFor({ + column: endColumn - 1, + line: endLine + }); + if (toPosition.source) to = toPosition; + } + let fromUrl; + if (isAbsolute3(from.source)) { + fromUrl = pathToFileURL2(from.source); + } else { + fromUrl = new URL( + from.source, + this.map.consumer().sourceRoot || pathToFileURL2(this.map.mapFile) + ); + } + let result = { + column: from.column + 1, + endColumn: to && to.column + 1, + endLine: to && to.line, + line: from.line, + url: fromUrl.toString() + }; + if (fromUrl.protocol === "file:") { + if (fileURLToPath2) { + result.file = fileURLToPath2(fromUrl); + } else { + throw new Error(`file: protocol is not available in this PostCSS build`); + } + } + let source = consumer.sourceContentFor(from.source); + if (source) result.source = source; + return result; + } + toJSON() { + let json = {}; + for (let name2 of ["hasBOM", "css", "file", "id"]) { + if (this[name2] != null) { + json[name2] = this[name2]; + } + } + if (this.map) { + json.map = { ...this.map }; + if (json.map.consumerCache) { + json.map.consumerCache = void 0; + } + } + return json; + } + }; + module.exports = Input2; + Input2.default = Input2; + if (terminalHighlight && terminalHighlight.registerInput) { + terminalHighlight.registerInput(Input2); + } } - /** - * Visit a ConstantOrWriteNode node. - * - * @param {nodes.ConstantOrWriteNode} node - */ - visitConstantOrWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/root.js + var require_root = __commonJS({ + "node_modules/postcss/lib/root.js"(exports, module) { + "use strict"; + var Container2 = require_container(); + var LazyResult; + var Processor2; + var Root2 = class extends Container2 { + constructor(defaults) { + super(defaults); + this.type = "root"; + if (!this.nodes) this.nodes = []; + } + normalize(child, sample, type) { + let keepBefore = /* @__PURE__ */ new Set(); + for (let node2 of Array.isArray(child) ? child : [child]) { + if (node2 && typeof node2 === "object" && !node2.parent && node2.raws && typeof node2.raws.before !== "undefined") { + keepBefore.add(node2.raws); + } + } + let nodes = super.normalize(child); + if (sample) { + if (type === "prepend") { + if (this.nodes.length > 1) { + sample.raws.before = this.nodes[1].raws.before; + } else { + delete sample.raws.before; + } + } else if (this.first !== sample) { + for (let node2 of nodes) { + if (!keepBefore.has(node2.raws)) { + node2.raws.before = sample.raws.before; + } + } + } + } + return nodes; + } + removeChild(child, ignore) { + let index = this.index(child); + if (!ignore && index === 0 && this.nodes.length > 1) { + this.nodes[1].raws.before = this.nodes[index].raws.before; + } + return super.removeChild(child); + } + toResult(opts = {}) { + let lazy = new LazyResult(new Processor2(), this, opts); + return lazy.stringify(); + } + }; + Root2.registerLazyResult = (dependant) => { + LazyResult = dependant; + }; + Root2.registerProcessor = (dependant) => { + Processor2 = dependant; + }; + module.exports = Root2; + Root2.default = Root2; + Container2.registerRoot(Root2); } - /** - * Visit a ConstantPathAndWriteNode node. - * - * @param {nodes.ConstantPathAndWriteNode} node - */ - visitConstantPathAndWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/list.js + var require_list = __commonJS({ + "node_modules/postcss/lib/list.js"(exports, module) { + "use strict"; + var list2 = { + comma(string2) { + return list2.split(string2, [","], true); + }, + space(string2) { + let spaces = [" ", "\n", " "]; + return list2.split(string2, spaces); + }, + split(string2, separators, last) { + if (typeof string2 !== "string") return []; + let array2 = []; + let current = ""; + let split = false; + let func = 0; + let inQuote = false; + let prevQuote = ""; + let escape = false; + let inComment = false; + for (let i = 0; i < string2.length; i++) { + let letter = string2[i]; + if (inComment) { + current += letter; + if (letter === "*" && string2[i + 1] === "/") { + current += "/"; + i += 1; + inComment = false; + } + continue; + } + if (escape) { + escape = false; + } else if (letter === "\\") { + escape = true; + } else if (inQuote) { + if (letter === prevQuote) { + inQuote = false; + } + } else if (letter === '"' || letter === "'") { + inQuote = true; + prevQuote = letter; + } else if (letter === "/" && string2[i + 1] === "*") { + current += "/*"; + i += 1; + inComment = true; + continue; + } else if (letter === "(") { + func += 1; + } else if (letter === ")") { + if (func > 0) func -= 1; + } else if (func === 0) { + if (separators.includes(letter)) split = true; + } + if (split) { + let value2 = current.trim(); + if (last || value2 !== "") array2.push(value2); + current = ""; + split = false; + } else { + current += letter; + } + } + let value = current.trim(); + if (last || value !== "") array2.push(value); + return array2; + } + }; + module.exports = list2; + list2.default = list2; } - /** - * Visit a ConstantPathNode node. - * - * @param {nodes.ConstantPathNode} node - */ - visitConstantPathNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/rule.js + var require_rule = __commonJS({ + "node_modules/postcss/lib/rule.js"(exports, module) { + "use strict"; + var Container2 = require_container(); + var list2 = require_list(); + var Rule2 = class extends Container2 { + get selectors() { + return list2.comma(this.selector); + } + set selectors(values) { + let match = this.selector ? this.selector.match(/,\s*/) : null; + let sep2 = match ? match[0] : "," + this.raw("between", "beforeOpen"); + this.selector = values.join(sep2); + } + constructor(defaults) { + super(defaults); + this.type = "rule"; + if (!this.nodes) this.nodes = []; + } + }; + module.exports = Rule2; + Rule2.default = Rule2; + Container2.registerRule(Rule2); } - /** - * Visit a ConstantPathOperatorWriteNode node. - * - * @param {nodes.ConstantPathOperatorWriteNode} node - */ - visitConstantPathOperatorWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/fromJSON.js + var require_fromJSON = __commonJS({ + "node_modules/postcss/lib/fromJSON.js"(exports, module) { + "use strict"; + var AtRule2 = require_at_rule(); + var Comment2 = require_comment(); + var Declaration2 = require_declaration(); + var Input2 = require_input(); + var PreviousMap = require_previous_map(); + var Root2 = require_root(); + var Rule2 = require_rule(); + function hydrateInputs(json, inputs) { + if (!json.inputs) return inputs; + return json.inputs.map((input) => { + let inputHydrated = { ...input, __proto__: Input2.prototype }; + if (inputHydrated.map) { + inputHydrated.map = { + ...inputHydrated.map, + __proto__: PreviousMap.prototype + }; + } + return inputHydrated; + }); + } + function constructNode(json, inputs, children2) { + let defaults = { ...json }; + delete defaults.inputs; + delete defaults.nodes; + if (defaults.source) { + let { inputId, ...source } = defaults.source; + defaults.source = source; + if (inputId != null) { + defaults.source.input = inputs[inputId]; + } + } + let node2; + if (defaults.type === "root") { + node2 = new Root2(defaults); + } else if (defaults.type === "decl") { + node2 = new Declaration2(defaults); + } else if (defaults.type === "rule") { + node2 = new Rule2(defaults); + } else if (defaults.type === "comment") { + node2 = new Comment2(defaults); + } else if (defaults.type === "atrule") { + node2 = new AtRule2(defaults); + } else { + throw new Error("Unknown node type: " + json.type); + } + if (children2) { + node2.nodes = children2; + for (let child of children2) child.parent = node2; + } + return node2; + } + function fromJSON2(json, inputs) { + if (Array.isArray(json)) return json.map((n) => fromJSON2(n)); + let result; + let stack = [ + { childIndex: 0, children: [], inputs: hydrateInputs(json, inputs), json } + ]; + while (stack.length > 0) { + let frame = stack[stack.length - 1]; + let jsonNodes = frame.json.nodes; + if (jsonNodes && frame.childIndex < jsonNodes.length) { + let childJson = jsonNodes[frame.childIndex]; + frame.childIndex += 1; + stack.push({ + childIndex: 0, + children: [], + inputs: hydrateInputs(childJson, frame.inputs), + json: childJson + }); + continue; + } + stack.pop(); + let node2 = constructNode( + frame.json, + frame.inputs, + jsonNodes ? frame.children : void 0 + ); + if (stack.length > 0) { + stack[stack.length - 1].children.push(node2); + } else { + result = node2; + } + } + return result; + } + module.exports = fromJSON2; + fromJSON2.default = fromJSON2; } - /** - * Visit a ConstantPathOrWriteNode node. - * - * @param {nodes.ConstantPathOrWriteNode} node - */ - visitConstantPathOrWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/map-generator.js + var require_map_generator = __commonJS({ + "node_modules/postcss/lib/map-generator.js"(exports, module) { + "use strict"; + var { dirname: dirname3, relative: relative2, resolve: resolve2, sep: sep2 } = (init_path(), __toCommonJS(path_exports)); + var { SourceMapConsumer, SourceMapGenerator } = require_source_map(); + var { pathToFileURL: pathToFileURL2 } = (init_url(), __toCommonJS(url_exports)); + var Input2 = require_input(); + var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator); + var pathAvailable = Boolean(dirname3 && resolve2 && relative2 && sep2); + var MapGenerator = class { + constructor(stringify2, root3, opts, cssString) { + this.stringify = stringify2; + this.mapOpts = opts.map || {}; + this.root = root3; + this.opts = opts; + this.css = cssString; + this.originalCSS = cssString; + this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute; + this.memoizedFileURLs = /* @__PURE__ */ new Map(); + this.memoizedPaths = /* @__PURE__ */ new Map(); + this.memoizedURLs = /* @__PURE__ */ new Map(); + } + addAnnotation() { + let content; + if (this.isInline()) { + content = "data:application/json;base64," + this.toBase64(this.map.toString()); + } else if (typeof this.mapOpts.annotation === "string") { + content = this.mapOpts.annotation; + } else if (typeof this.mapOpts.annotation === "function") { + content = this.mapOpts.annotation(this.opts.to, this.root); + } else { + content = this.outputFile() + ".map"; + } + let eol = "\n"; + if (this.css.includes("\r\n")) eol = "\r\n"; + this.css += eol + "/*# sourceMappingURL=" + content + " */"; + } + applyPrevMaps() { + for (let prev of this.previous()) { + let from = this.toUrl(this.path(prev.file)); + let root3 = prev.root || dirname3(prev.file); + let map; + if (this.mapOpts.sourcesContent === false) { + map = new SourceMapConsumer(prev.text); + if (map.sourcesContent) { + map.sourcesContent = null; + } + } else { + map = prev.consumer(); + } + this.map.applySourceMap(map, from, this.toUrl(this.path(root3))); + } + } + clearAnnotation() { + if (this.mapOpts.annotation === false) return; + if (this.root) { + let node2; + for (let i = this.root.nodes.length - 1; i >= 0; i--) { + node2 = this.root.nodes[i]; + if (node2.type !== "comment") continue; + if (node2.text.startsWith("# sourceMappingURL=")) { + this.root.removeChild(i); + } + } + } else if (this.css) { + let annotation = "/*# sourceMappingURL="; + let css = ""; + let cursor = 0; + let startIndex; + while ((startIndex = this.css.indexOf(annotation, cursor)) !== -1) { + let endIndex = this.css.indexOf("*/", startIndex + annotation.length); + if (endIndex === -1) break; + while (startIndex > cursor && this.css[startIndex - 1] === "\n") { + startIndex--; + } + css += this.css.slice(cursor, startIndex); + cursor = endIndex + 2; + } + if (cursor > 0) this.css = css + this.css.slice(cursor); + } + } + generate() { + this.clearAnnotation(); + if (pathAvailable && sourceMapAvailable && this.isMap()) { + return this.generateMap(); + } else { + let result = ""; + this.stringify(this.root, (i) => { + result += i; + }); + return [result]; + } + } + generateMap() { + if (this.root) { + this.generateString(); + } else if (this.previous().length === 1) { + let prev = this.previous()[0].consumer(); + prev.file = this.outputFile(); + this.map = SourceMapGenerator.fromSourceMap(prev, { + ignoreInvalidMapping: true + }); + } else { + this.map = new SourceMapGenerator({ + file: this.outputFile(), + ignoreInvalidMapping: true + }); + this.map.addMapping({ + generated: { column: 0, line: 1 }, + original: { column: 0, line: 1 }, + source: this.opts.from ? this.toUrl(this.path(this.opts.from)) : "" + }); + } + if (this.isSourcesContent()) this.setSourcesContent(); + if (this.root && this.previous().length > 0) this.applyPrevMaps(); + if (this.isAnnotation()) this.addAnnotation(); + if (this.isInline()) { + return [this.css]; + } else { + return [this.css, this.map]; + } + } + generateString() { + this.css = ""; + this.map = new SourceMapGenerator({ + file: this.outputFile(), + ignoreInvalidMapping: true + }); + let line = 1; + let column = 1; + let noSource = ""; + let mapping = { + generated: { column: 0, line: 0 }, + original: { column: 0, line: 0 }, + source: "" + }; + let last, lines; + this.stringify(this.root, (str, node2, type) => { + this.css += str; + if (node2 && type !== "end") { + mapping.generated.line = line; + mapping.generated.column = column - 1; + if (node2.source && node2.source.start) { + mapping.source = this.sourcePath(node2); + mapping.original.line = node2.source.start.line; + mapping.original.column = node2.source.start.column - 1; + this.map.addMapping(mapping); + } else { + mapping.source = noSource; + mapping.original.line = 1; + mapping.original.column = 0; + this.map.addMapping(mapping); + } + } + lines = str.match(/\n/g); + if (lines) { + line += lines.length; + last = str.lastIndexOf("\n"); + column = str.length - last; + } else { + column += str.length; + } + if (node2 && type !== "start") { + let p2 = node2.parent || { raws: {} }; + let childless = node2.type === "decl" || node2.type === "atrule" && !node2.nodes; + if (!childless || node2 !== p2.last || p2.raws.semicolon) { + if (node2.source && node2.source.end) { + mapping.source = this.sourcePath(node2); + mapping.original.line = node2.source.end.line; + mapping.original.column = node2.source.end.column - 1; + mapping.generated.line = line; + mapping.generated.column = column - 2; + this.map.addMapping(mapping); + } else { + mapping.source = noSource; + mapping.original.line = 1; + mapping.original.column = 0; + mapping.generated.line = line; + mapping.generated.column = column - 1; + this.map.addMapping(mapping); + } + } + } + }); + } + isAnnotation() { + if (this.isInline()) { + return true; + } + if (typeof this.mapOpts.annotation !== "undefined") { + return this.mapOpts.annotation; + } + if (this.previous().length) { + return this.previous().some((i) => i.annotation); + } + return true; + } + isInline() { + if (typeof this.mapOpts.inline !== "undefined") { + return this.mapOpts.inline; + } + let annotation = this.mapOpts.annotation; + if (typeof annotation !== "undefined" && annotation !== true) { + return false; + } + if (this.previous().length) { + return this.previous().some((i) => i.inline); + } + return true; + } + isMap() { + if (typeof this.opts.map !== "undefined") { + return !!this.opts.map; + } + return this.previous().length > 0; + } + isSourcesContent() { + if (typeof this.mapOpts.sourcesContent !== "undefined") { + return this.mapOpts.sourcesContent; + } + if (this.previous().length) { + return this.previous().some((i) => i.withContent()); + } + return true; + } + outputFile() { + if (this.opts.to) { + return this.path(this.opts.to); + } else if (this.opts.from) { + return this.path(this.opts.from); + } else { + return "to.css"; + } + } + path(file) { + if (this.mapOpts.absolute) return file; + if (file.charCodeAt(0) === 60) return file; + if (/^\w+:\/\//.test(file)) return file; + let cached2 = this.memoizedPaths.get(file); + if (cached2) return cached2; + let from = this.opts.to ? dirname3(this.opts.to) : "."; + if (typeof this.mapOpts.annotation === "string") { + from = dirname3(resolve2(from, this.mapOpts.annotation)); + } + let path = relative2(from, file); + this.memoizedPaths.set(file, path); + return path; + } + previous() { + if (!this.previousMaps) { + this.previousMaps = []; + if (this.root) { + this.root.walk((node2) => { + if (node2.source && node2.source.input.map) { + let map = node2.source.input.map; + if (!this.previousMaps.includes(map)) { + this.previousMaps.push(map); + } + } + }); + } else { + let input = new Input2(this.originalCSS, this.opts); + if (input.map) this.previousMaps.push(input.map); + } + } + return this.previousMaps; + } + setSourcesContent() { + let already = {}; + if (this.root) { + this.root.walk((node2) => { + if (node2.source) { + let from = node2.source.input.from; + if (from && !already[from]) { + already[from] = true; + let fromUrl = this.usesFileUrls ? this.toFileUrl(from) : this.toUrl(this.path(from)); + this.map.setSourceContent(fromUrl, node2.source.input.css); + } + } + }); + } else if (this.css) { + let from = this.opts.from ? this.toUrl(this.path(this.opts.from)) : ""; + this.map.setSourceContent(from, this.css); + } + } + sourcePath(node2) { + if (this.mapOpts.from) { + return this.toUrl(this.mapOpts.from); + } else if (this.usesFileUrls) { + return this.toFileUrl(node2.source.input.from); + } else { + return this.toUrl(this.path(node2.source.input.from)); + } + } + toBase64(str) { + if (Buffer) { + return Buffer.from(str).toString("base64"); + } else { + return window.btoa(unescape(encodeURIComponent(str))); + } + } + toFileUrl(path) { + let cached2 = this.memoizedFileURLs.get(path); + if (cached2) return cached2; + if (pathToFileURL2) { + let fileURL = pathToFileURL2(path).toString(); + this.memoizedFileURLs.set(path, fileURL); + return fileURL; + } else { + throw new Error( + "`map.absolute` option is not available in this PostCSS build" + ); + } + } + toUrl(path) { + let cached2 = this.memoizedURLs.get(path); + if (cached2) return cached2; + if (sep2 === "\\") { + path = path.replace(/\\/g, "/"); + } + let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent); + this.memoizedURLs.set(path, url); + return url; + } + }; + module.exports = MapGenerator; } - /** - * Visit a ConstantPathTargetNode node. - * - * @param {nodes.ConstantPathTargetNode} node - */ - visitConstantPathTargetNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/parser.js + var require_parser = __commonJS({ + "node_modules/postcss/lib/parser.js"(exports, module) { + "use strict"; + var AtRule2 = require_at_rule(); + var Comment2 = require_comment(); + var Declaration2 = require_declaration(); + var Root2 = require_root(); + var Rule2 = require_rule(); + var tokenizer = require_tokenize(); + var SAFE_COMMENT_NEIGHBOR = { + empty: true, + space: true + }; + function findLastWithPosition(tokens) { + for (let i = tokens.length - 1; i >= 0; i--) { + let token2 = tokens[i]; + let pos = token2[3] || token2[2]; + if (pos) return pos; + } + } + function tokensToString(tokens, from, to) { + let result = ""; + for (let i = from; i < to; i++) result += tokens[i][1]; + return result; + } + var Parser = class { + constructor(input) { + this.input = input; + this.root = new Root2(); + this.current = this.root; + this.spaces = ""; + this.semicolon = false; + this.createTokenizer(); + this.root.source = { input, start: { column: 1, line: 1, offset: 0 } }; + } + atrule(token2) { + let node2 = new AtRule2(); + node2.name = token2[1].slice(1); + if (node2.name === "") { + this.unnamedAtrule(node2, token2); + } + this.init(node2, token2[2]); + let type; + let prev; + let shift; + let last = false; + let open2 = false; + let params = []; + let brackets = []; + while (!this.tokenizer.endOfFile()) { + token2 = this.tokenizer.nextToken(); + type = token2[0]; + if (type === "(" || type === "[") { + brackets.push(type === "(" ? ")" : "]"); + } else if (type === "{" && brackets.length > 0) { + brackets.push("}"); + } else if (type === brackets[brackets.length - 1]) { + brackets.pop(); + } + if (brackets.length === 0) { + if (type === ";") { + node2.source.end = this.getPosition(token2[2]); + node2.source.end.offset++; + this.semicolon = true; + break; + } else if (type === "{") { + open2 = true; + break; + } else if (type === "}") { + if (params.length > 0) { + shift = params.length - 1; + prev = params[shift]; + while (prev && prev[0] === "space") { + prev = params[--shift]; + } + if (prev) { + node2.source.end = this.getPosition(prev[3] || prev[2]); + node2.source.end.offset++; + } + } + this.end(token2); + break; + } else { + params.push(token2); + } + } else { + params.push(token2); + } + if (this.tokenizer.endOfFile()) { + last = true; + break; + } + } + node2.raws.between = this.spacesAndCommentsFromEnd(params); + if (params.length) { + node2.raws.afterName = this.spacesAndCommentsFromStart(params); + this.raw(node2, "params", params); + if (last) { + token2 = params[params.length - 1]; + node2.source.end = this.getPosition(token2[3] || token2[2]); + node2.source.end.offset++; + this.spaces = node2.raws.between; + node2.raws.between = ""; + } + } else { + node2.raws.afterName = ""; + node2.params = ""; + } + if (open2) { + node2.nodes = []; + this.current = node2; + } + } + checkMissedSemicolon(tokens) { + let colon = this.colon(tokens); + if (colon === false) return; + let founded = 0; + let token2; + for (let j2 = colon - 1; j2 >= 0; j2--) { + token2 = tokens[j2]; + if (token2[0] !== "space") { + founded += 1; + if (founded === 2) break; + } + } + throw this.input.error( + "Missed semicolon", + token2[0] === "word" ? token2[3] + 1 : token2[2] + ); + } + colon(tokens) { + let brackets = 0; + let prev, token2, type; + for (let [i, element] of tokens.entries()) { + token2 = element; + type = token2[0]; + if (type === "(") { + brackets += 1; + } + if (type === ")") { + brackets -= 1; + } + if (brackets === 0 && type === ":") { + if (!prev) { + this.doubleColon(token2); + } else if (prev[0] === "word" && prev[1] === "progid") { + continue; + } else { + return i; + } + } + prev = token2; + } + return false; + } + comment(token2) { + let node2 = new Comment2(); + this.init(node2, token2[2]); + node2.source.end = this.getPosition(token2[3] || token2[2]); + node2.source.end.offset++; + let text = token2[1].slice(2, -2); + if (!text.trim()) { + node2.text = ""; + node2.raws.left = text; + node2.raws.right = ""; + } else { + let match = text.match(/^(\s*)([^]*\S)(\s*)$/); + node2.text = match[2]; + node2.raws.left = match[1]; + node2.raws.right = match[3]; + } + } + createTokenizer() { + this.tokenizer = tokenizer(this.input); + } + decl(tokens, customProperty) { + let node2 = new Declaration2(); + this.init(node2, tokens[0][2]); + let last = tokens[tokens.length - 1]; + if (last[0] === ";") { + this.semicolon = true; + tokens.pop(); + } + node2.source.end = this.getPosition( + last[3] || last[2] || findLastWithPosition(tokens) + ); + node2.source.end.offset++; + let start = 0; + while (tokens[start][0] !== "word") { + if (start === tokens.length - 1) this.unknownWord([tokens[start]]); + start++; + } + node2.raws.before += tokensToString(tokens, 0, start); + node2.source.start = this.getPosition(tokens[start][2]); + let propStart = start; + while (start < tokens.length) { + let type = tokens[start][0]; + if (type === ":" || type === "space" || type === "comment") { + break; + } + start++; + } + node2.prop = tokensToString(tokens, propStart, start); + let betweenStart = start; + let token2; + while (start < tokens.length) { + token2 = tokens[start]; + start++; + if (token2[0] === ":") break; + if (token2[0] === "word" && /\w/.test(token2[1])) { + this.unknownWord([token2]); + } + } + node2.raws.between = tokensToString(tokens, betweenStart, start); + if (node2.prop[0] === "_" || node2.prop[0] === "*") { + node2.raws.before += node2.prop[0]; + node2.prop = node2.prop.slice(1); + } + let firstSpacesStart = start; + while (start < tokens.length) { + let next = tokens[start][0]; + if (next !== "space" && next !== "comment") break; + start++; + } + let firstSpaces = tokens.slice(firstSpacesStart, start); + tokens = tokens.slice(start); + this.precheckMissedSemicolon(tokens); + for (let i = tokens.length - 1; i >= 0; i--) { + token2 = tokens[i]; + if (token2[1].toLowerCase() === "!important") { + node2.important = true; + let string2 = this.stringFrom(tokens, i); + string2 = this.spacesFromEnd(tokens) + string2; + if (string2 !== " !important") node2.raws.important = string2; + break; + } else if (token2[1].toLowerCase() === "important") { + let cache = tokens.slice(0); + let str = ""; + for (let j2 = i; j2 > 0; j2--) { + let type = cache[j2][0]; + if (str.trim().startsWith("!") && type !== "space") { + break; + } + str = cache.pop()[1] + str; + } + if (str.trim().startsWith("!")) { + node2.important = true; + node2.raws.important = str; + tokens = cache; + } + } + if (token2[0] !== "space" && token2[0] !== "comment") { + break; + } + } + let hasWord = tokens.some((i) => i[0] !== "space" && i[0] !== "comment"); + if (hasWord) { + node2.raws.between += firstSpaces.map((i) => i[1]).join(""); + firstSpaces = []; + } + this.raw(node2, "value", firstSpaces.concat(tokens), customProperty); + if (node2.value.includes(":") && !customProperty) { + this.checkMissedSemicolon(tokens); + } + } + doubleColon(token2) { + throw this.input.error( + "Double colon", + { offset: token2[2] }, + { offset: token2[2] + token2[1].length } + ); + } + emptyRule(token2) { + let node2 = new Rule2(); + this.init(node2, token2[2]); + node2.selector = ""; + node2.raws.between = ""; + this.current = node2; + } + end(token2) { + if (this.current.nodes && this.current.nodes.length) { + this.current.raws.semicolon = this.semicolon; + } + this.semicolon = false; + this.current.raws.after = (this.current.raws.after || "") + this.spaces; + this.spaces = ""; + if (this.current.parent) { + this.current.source.end = this.getPosition(token2[2]); + this.current.source.end.offset++; + this.current = this.current.parent; + } else { + this.unexpectedClose(token2); + } + } + endFile() { + if (this.current.parent) this.unclosedBlock(); + if (this.current.nodes && this.current.nodes.length) { + this.current.raws.semicolon = this.semicolon; + } + this.current.raws.after = (this.current.raws.after || "") + this.spaces; + this.root.source.end = this.getPosition(this.tokenizer.position()); + } + freeSemicolon(token2) { + this.spaces += token2[1]; + if (this.current.nodes) { + let prev = this.current.nodes[this.current.nodes.length - 1]; + if (prev && prev.type === "rule" && !prev.raws.ownSemicolon) { + prev.raws.ownSemicolon = this.spaces; + this.spaces = ""; + prev.source.end = this.getPosition(token2[2]); + prev.source.end.offset++; + } + } + } + // Helpers + getPosition(offset) { + let pos = this.input.fromOffset(offset); + return { + column: pos.col, + line: pos.line, + offset + }; + } + init(node2, offset) { + this.current.push(node2); + node2.source = { + input: this.input, + start: this.getPosition(offset) + }; + node2.raws.before = this.spaces; + this.spaces = ""; + if (node2.type !== "comment") this.semicolon = false; + } + other(start) { + let end = false; + let type = null; + let colon = false; + let bracket = null; + let brackets = []; + let customProperty = start[1].startsWith("--"); + let tokens = []; + let token2 = start; + while (token2) { + type = token2[0]; + tokens.push(token2); + if (type === "(" || type === "[") { + if (!bracket) bracket = token2; + brackets.push(type === "(" ? ")" : "]"); + } else if (customProperty && colon && type === "{") { + if (!bracket) bracket = token2; + brackets.push("}"); + } else if (brackets.length === 0) { + if (type === ";") { + if (colon) { + this.decl(tokens, customProperty); + return; + } else { + break; + } + } else if (type === "{") { + this.rule(tokens); + return; + } else if (type === "}") { + this.tokenizer.back(tokens.pop()); + end = true; + break; + } else if (type === ":") { + colon = true; + } + } else if (type === brackets[brackets.length - 1]) { + brackets.pop(); + if (brackets.length === 0) bracket = null; + } + token2 = this.tokenizer.nextToken(); + } + if (this.tokenizer.endOfFile()) end = true; + if (brackets.length > 0) this.unclosedBracket(bracket); + if (end && colon) { + if (!customProperty) { + while (tokens.length) { + token2 = tokens[tokens.length - 1][0]; + if (token2 !== "space" && token2 !== "comment") break; + this.tokenizer.back(tokens.pop()); + } + } + this.decl(tokens, customProperty); + } else { + this.unknownWord(tokens); + } + } + parse() { + let token2; + while (!this.tokenizer.endOfFile()) { + token2 = this.tokenizer.nextToken(); + switch (token2[0]) { + case "space": + this.spaces += token2[1]; + break; + case ";": + this.freeSemicolon(token2); + break; + case "}": + this.end(token2); + break; + case "comment": + this.comment(token2); + break; + case "at-word": + this.atrule(token2); + break; + case "{": + this.emptyRule(token2); + break; + default: + this.other(token2); + break; + } + } + this.endFile(); + } + precheckMissedSemicolon() { + } + raw(node2, prop, tokens, customProperty) { + let token2, type; + let length = tokens.length; + let value = ""; + let last = ""; + let clean = true; + let next, prev; + for (let i = 0; i < length; i += 1) { + token2 = tokens[i]; + type = token2[0]; + if (type === "space" && i === length - 1 && !customProperty) { + clean = false; + } else if (type === "comment") { + prev = tokens[i - 1] ? tokens[i - 1][0] : "empty"; + next = tokens[i + 1] ? tokens[i + 1][0] : "empty"; + if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) { + if (last === ",") { + clean = false; + } else { + value += token2[1]; + last = token2[1].slice(-1); + } + } else { + clean = false; + } + } else { + value += token2[1]; + last = token2[1].slice(-1); + } + } + if (!clean) { + let raw = tokens.reduce((all, i) => all + i[1], ""); + node2.raws[prop] = { raw, value }; + } + node2[prop] = value; + } + rule(tokens) { + tokens.pop(); + let node2 = new Rule2(); + this.init(node2, tokens[0][2]); + node2.raws.between = this.spacesAndCommentsFromEnd(tokens); + this.raw(node2, "selector", tokens); + this.current = node2; + } + spacesAndCommentsFromEnd(tokens) { + let lastTokenType; + let spaces = ""; + while (tokens.length) { + lastTokenType = tokens[tokens.length - 1][0]; + if (lastTokenType !== "space" && lastTokenType !== "comment") break; + spaces = tokens.pop()[1] + spaces; + } + return spaces; + } + // Errors + spacesAndCommentsFromStart(tokens) { + let next; + let spaces = ""; + while (tokens.length) { + next = tokens[0][0]; + if (next !== "space" && next !== "comment") break; + spaces += tokens.shift()[1]; + } + return spaces; + } + spacesFromEnd(tokens) { + let lastTokenType; + let spaces = ""; + while (tokens.length) { + lastTokenType = tokens[tokens.length - 1][0]; + if (lastTokenType !== "space") break; + spaces = tokens.pop()[1] + spaces; + } + return spaces; + } + stringFrom(tokens, from) { + let result = ""; + for (let i = from; i < tokens.length; i++) { + result += tokens[i][1]; + } + tokens.splice(from, tokens.length - from); + return result; + } + unclosedBlock() { + let pos = this.current.source.start; + throw this.input.error("Unclosed block", pos.line, pos.column); + } + unclosedBracket(bracket) { + throw this.input.error( + "Unclosed bracket", + { offset: bracket[2] }, + { offset: bracket[2] + 1 } + ); + } + unexpectedClose(token2) { + throw this.input.error( + "Unexpected }", + { offset: token2[2] }, + { offset: token2[2] + 1 } + ); + } + unknownWord(tokens) { + throw this.input.error( + "Unknown word " + tokens[0][1], + { offset: tokens[0][2] }, + { offset: tokens[0][2] + tokens[0][1].length } + ); + } + unnamedAtrule(node2, token2) { + throw this.input.error( + "At-rule without name", + { offset: token2[2] }, + { offset: token2[2] + token2[1].length } + ); + } + }; + module.exports = Parser; } - /** - * Visit a ConstantPathWriteNode node. - * - * @param {nodes.ConstantPathWriteNode} node - */ - visitConstantPathWriteNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a ConstantReadNode node. - * - * @param {nodes.ConstantReadNode} node - */ - visitConstantReadNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a ConstantTargetNode node. - * - * @param {nodes.ConstantTargetNode} node - */ - visitConstantTargetNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a ConstantWriteNode node. - * - * @param {nodes.ConstantWriteNode} node - */ - visitConstantWriteNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a DefNode node. - * - * @param {nodes.DefNode} node - */ - visitDefNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a DefinedNode node. - * - * @param {nodes.DefinedNode} node - */ - visitDefinedNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a ElseNode node. - * - * @param {nodes.ElseNode} node - */ - visitElseNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a EmbeddedStatementsNode node. - * - * @param {nodes.EmbeddedStatementsNode} node - */ - visitEmbeddedStatementsNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a EmbeddedVariableNode node. - * - * @param {nodes.EmbeddedVariableNode} node - */ - visitEmbeddedVariableNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a EnsureNode node. - * - * @param {nodes.EnsureNode} node - */ - visitEnsureNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a FalseNode node. - * - * @param {nodes.FalseNode} node - */ - visitFalseNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a FindPatternNode node. - * - * @param {nodes.FindPatternNode} node - */ - visitFindPatternNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a FlipFlopNode node. - * - * @param {nodes.FlipFlopNode} node - */ - visitFlipFlopNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a FloatNode node. - * - * @param {nodes.FloatNode} node - */ - visitFloatNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a ForNode node. - * - * @param {nodes.ForNode} node - */ - visitForNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a ForwardingArgumentsNode node. - * - * @param {nodes.ForwardingArgumentsNode} node - */ - visitForwardingArgumentsNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a ForwardingParameterNode node. - * - * @param {nodes.ForwardingParameterNode} node - */ - visitForwardingParameterNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a ForwardingSuperNode node. - * - * @param {nodes.ForwardingSuperNode} node - */ - visitForwardingSuperNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a GlobalVariableAndWriteNode node. - * - * @param {nodes.GlobalVariableAndWriteNode} node - */ - visitGlobalVariableAndWriteNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a GlobalVariableOperatorWriteNode node. - * - * @param {nodes.GlobalVariableOperatorWriteNode} node - */ - visitGlobalVariableOperatorWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/parse.js + var require_parse2 = __commonJS({ + "node_modules/postcss/lib/parse.js"(exports, module) { + "use strict"; + var Container2 = require_container(); + var Input2 = require_input(); + var Parser = require_parser(); + function parse3(css, opts) { + let input = new Input2(css, opts); + let parser = new Parser(input); + try { + parser.parse(); + } catch (e) { + if (process.env.NODE_ENV !== "production") { + if (e.name === "CssSyntaxError" && opts && opts.from) { + if (/\.scss$/i.test(opts.from)) { + e.message += "\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser"; + } else if (/\.sass/i.test(opts.from)) { + e.message += "\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser"; + } else if (/\.less$/i.test(opts.from)) { + e.message += "\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser"; + } + } + } + throw e; + } + return parser.root; + } + module.exports = parse3; + parse3.default = parse3; + Container2.registerParse(parse3); } - /** - * Visit a GlobalVariableOrWriteNode node. - * - * @param {nodes.GlobalVariableOrWriteNode} node - */ - visitGlobalVariableOrWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/warning.js + var require_warning = __commonJS({ + "node_modules/postcss/lib/warning.js"(exports, module) { + "use strict"; + var Container2 = require_container(); + var { my } = require_symbols(); + var Warning2 = class { + constructor(text, opts = {}) { + this.type = "warning"; + this.text = text; + if (opts.node && opts.node.source) { + if (!opts.node[my]) { + Container2.rebuild(opts.node); + } + let range = opts.node.rangeBy(opts); + this.line = range.start.line; + this.column = range.start.column; + this.endLine = range.end.line; + this.endColumn = range.end.column; + } + for (let opt in opts) this[opt] = opts[opt]; + } + toString() { + if (this.node) { + return this.node.error(this.text, { + index: this.index, + plugin: this.plugin, + word: this.word + }).message; + } + if (this.plugin) { + return this.plugin + ": " + this.text; + } + return this.text; + } + }; + module.exports = Warning2; + Warning2.default = Warning2; } - /** - * Visit a GlobalVariableReadNode node. - * - * @param {nodes.GlobalVariableReadNode} node - */ - visitGlobalVariableReadNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/result.js + var require_result = __commonJS({ + "node_modules/postcss/lib/result.js"(exports, module) { + "use strict"; + var Warning2 = require_warning(); + var Result3 = class { + get content() { + return this.css; + } + constructor(processor, root3, opts) { + this.processor = processor; + this.messages = []; + this.root = root3; + this.opts = opts; + this.css = ""; + this.map = void 0; + } + toString() { + return this.css; + } + warn(text, opts = {}) { + if (!opts.plugin) { + if (this.lastPlugin && this.lastPlugin.postcssPlugin) { + opts.plugin = this.lastPlugin.postcssPlugin; + } + } + let warning = new Warning2(text, opts); + this.messages.push(warning); + return warning; + } + warnings() { + return this.messages.filter((i) => i.type === "warning"); + } + }; + module.exports = Result3; + Result3.default = Result3; } - /** - * Visit a GlobalVariableTargetNode node. - * - * @param {nodes.GlobalVariableTargetNode} node - */ - visitGlobalVariableTargetNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/warn-once.js + var require_warn_once = __commonJS({ + "node_modules/postcss/lib/warn-once.js"(exports, module) { + "use strict"; + var printed = {}; + module.exports = function warnOnce(message) { + if (printed[message]) return; + printed[message] = true; + if (typeof console !== "undefined" && console.warn) { + console.warn(message); + } + }; } - /** - * Visit a GlobalVariableWriteNode node. - * - * @param {nodes.GlobalVariableWriteNode} node - */ - visitGlobalVariableWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/lazy-result.js + var require_lazy_result = __commonJS({ + "node_modules/postcss/lib/lazy-result.js"(exports, module) { + "use strict"; + var Container2 = require_container(); + var Document2 = require_document(); + var MapGenerator = require_map_generator(); + var parse3 = require_parse2(); + var Result3 = require_result(); + var Root2 = require_root(); + var stringify2 = require_stringify(); + var { isClean, my } = require_symbols(); + var warnOnce = require_warn_once(); + var TYPE_TO_CLASS_NAME = { + atrule: "AtRule", + comment: "Comment", + decl: "Declaration", + document: "Document", + root: "Root", + rule: "Rule" + }; + var PLUGIN_PROPS = { + AtRule: true, + AtRuleExit: true, + Comment: true, + CommentExit: true, + Declaration: true, + DeclarationExit: true, + Document: true, + DocumentExit: true, + Once: true, + OnceExit: true, + postcssPlugin: true, + prepare: true, + Root: true, + RootExit: true, + Rule: true, + RuleExit: true + }; + var NOT_VISITORS = { + Once: true, + postcssPlugin: true, + prepare: true + }; + var CHILDREN = 0; + function isPromise(obj) { + return typeof obj === "object" && typeof obj.then === "function"; + } + function getEvents(node2) { + let key = false; + let type = TYPE_TO_CLASS_NAME[node2.type]; + if (node2.type === "decl") { + key = node2.prop.toLowerCase(); + } else if (node2.type === "atrule") { + key = node2.name.toLowerCase(); + } + if (key && node2.append) { + return [ + type, + type + "-" + key, + CHILDREN, + type + "Exit", + type + "Exit-" + key + ]; + } else if (key) { + return [type, type + "-" + key, type + "Exit", type + "Exit-" + key]; + } else if (node2.append) { + return [type, CHILDREN, type + "Exit"]; + } else { + return [type, type + "Exit"]; + } + } + function toStack(node2) { + let events; + if (node2.type === "document") { + events = ["Document", CHILDREN, "DocumentExit"]; + } else if (node2.type === "root") { + events = ["Root", CHILDREN, "RootExit"]; + } else { + events = getEvents(node2); + } + return { + eventIndex: 0, + events, + iterator: 0, + node: node2, + visitorIndex: 0, + visitors: [] + }; + } + function cleanMarks(node2) { + let stack = [node2]; + while (stack.length > 0) { + let next = stack.pop(); + next[isClean] = false; + if (next.nodes) { + for (let i of next.nodes) stack.push(i); + } + } + return node2; + } + var postcss2 = {}; + var LazyResult = class _LazyResult { + get content() { + return this.stringify().content; + } + get css() { + return this.stringify().css; + } + get map() { + return this.stringify().map; + } + get messages() { + return this.sync().messages; + } + get opts() { + return this.result.opts; + } + get processor() { + return this.result.processor; + } + get root() { + return this.sync().root; + } + get [Symbol.toStringTag]() { + return "LazyResult"; + } + constructor(processor, css, opts) { + this.stringified = false; + this.processed = false; + let root3; + if (typeof css === "object" && css !== null && (css.type === "root" || css.type === "document")) { + root3 = cleanMarks(css); + } else if (css instanceof _LazyResult || css instanceof Result3) { + root3 = cleanMarks(css.root); + if (css.map) { + if (typeof opts.map === "undefined") opts.map = {}; + if (!opts.map.inline) opts.map.inline = false; + opts.map.prev = css.map; + } + } else { + let parser = parse3; + if (opts.syntax) parser = opts.syntax.parse; + if (opts.parser) parser = opts.parser; + if (parser.parse) parser = parser.parse; + try { + root3 = parser(css, opts); + } catch (error2) { + this.processed = true; + this.error = error2; + } + if (root3 && !root3[my]) { + Container2.rebuild(root3); + } + } + this.result = new Result3(processor, root3, opts); + this.helpers = { ...postcss2, postcss: postcss2, result: this.result }; + this.plugins = this.processor.plugins.map((plugin2) => { + if (typeof plugin2 === "object" && plugin2.prepare) { + return { ...plugin2, ...plugin2.prepare(this.result) }; + } else { + return plugin2; + } + }); + } + async() { + if (this.error) return Promise.reject(this.error); + if (this.processed) return Promise.resolve(this.result); + if (!this.processing) { + this.processing = this.runAsync(); + } + return this.processing; + } + catch(onRejected) { + return this.async().catch(onRejected); + } + finally(onFinally) { + return this.async().then(onFinally, onFinally); + } + getAsyncError() { + throw new Error("Use process(css).then(cb) to work with async plugins"); + } + handleError(error2, node2) { + let plugin2 = this.result.lastPlugin; + try { + if (node2) node2.addToError(error2); + this.error = error2; + if (error2.name === "CssSyntaxError" && !error2.plugin) { + error2.plugin = plugin2.postcssPlugin; + error2.setMessage(); + } else if (plugin2.postcssVersion) { + if (process.env.NODE_ENV !== "production") { + let pluginName = plugin2.postcssPlugin; + let pluginVer = plugin2.postcssVersion; + let runtimeVer = this.result.processor.version; + let a = pluginVer.split("."); + let b3 = runtimeVer.split("."); + if (a[0] !== b3[0] || parseInt(a[1]) > parseInt(b3[1])) { + console.error( + "Unknown error from PostCSS plugin. Your current PostCSS version is " + runtimeVer + ", but " + pluginName + " uses " + pluginVer + ". Perhaps this is the source of the error below." + ); + } + } + } + } catch (err) { + if (console && console.error) console.error(err); + } + return error2; + } + prepareVisitors() { + this.listeners = {}; + let add = (plugin2, type, cb) => { + if (!this.listeners[type]) this.listeners[type] = []; + this.listeners[type].push([plugin2, cb]); + }; + for (let plugin2 of this.plugins) { + if (typeof plugin2 === "object") { + for (let event in plugin2) { + if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) { + throw new Error( + `Unknown event ${event} in ${plugin2.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).` + ); + } + if (!NOT_VISITORS[event]) { + if (typeof plugin2[event] === "object") { + for (let filter in plugin2[event]) { + if (filter === "*") { + add(plugin2, event, plugin2[event][filter]); + } else { + add( + plugin2, + event + "-" + filter.toLowerCase(), + plugin2[event][filter] + ); + } + } + } else if (typeof plugin2[event] === "function") { + add(plugin2, event, plugin2[event]); + } + } + } + } + } + this.hasListener = Object.keys(this.listeners).length > 0; + } + async runAsync() { + this.plugin = 0; + for (let i = 0; i < this.plugins.length; i++) { + let plugin2 = this.plugins[i]; + let promise = this.runOnRoot(plugin2); + if (isPromise(promise)) { + try { + await promise; + } catch (error2) { + throw this.handleError(error2); + } + } + } + this.prepareVisitors(); + if (this.hasListener) { + let root3 = this.result.root; + while (!root3[isClean]) { + root3[isClean] = true; + let stack = [toStack(root3)]; + while (stack.length > 0) { + let promise = this.visitTick(stack); + if (isPromise(promise)) { + try { + await promise; + } catch (e) { + let node2 = stack[stack.length - 1].node; + throw this.handleError(e, node2); + } + } + } + } + if (this.listeners.OnceExit) { + for (let [plugin2, visitor] of this.listeners.OnceExit) { + this.result.lastPlugin = plugin2; + try { + if (root3.type === "document") { + let roots = root3.nodes.map( + (subRoot) => visitor(subRoot, this.helpers) + ); + await Promise.all(roots); + } else { + await visitor(root3, this.helpers); + } + } catch (e) { + throw this.handleError(e); + } + } + } + } + this.processed = true; + return this.stringify(); + } + runOnRoot(plugin2) { + this.result.lastPlugin = plugin2; + try { + if (typeof plugin2 === "object" && plugin2.Once) { + if (this.result.root.type === "document") { + let roots = this.result.root.nodes.map( + (root3) => plugin2.Once(root3, this.helpers) + ); + if (isPromise(roots[0])) { + return Promise.all(roots); + } + return roots; + } + return plugin2.Once(this.result.root, this.helpers); + } else if (typeof plugin2 === "function") { + return plugin2(this.result.root, this.result); + } + } catch (error2) { + throw this.handleError(error2); + } + } + stringify() { + if (this.error) throw this.error; + if (this.stringified) return this.result; + this.stringified = true; + this.sync(); + let opts = this.result.opts; + let str = stringify2; + if (opts.syntax) str = opts.syntax.stringify; + if (opts.stringifier) str = opts.stringifier; + if (str.stringify) str = str.stringify; + let rootSource = this.result.root.source; + if (opts.map === void 0 && !(rootSource && rootSource.input && rootSource.input.map)) { + let result = ""; + str(this.result.root, (i) => { + result += i; + }); + this.result.css = result; + return this.result; + } + let map = new MapGenerator(str, this.result.root, this.result.opts); + let data = map.generate(); + this.result.css = data[0]; + this.result.map = data[1]; + return this.result; + } + sync() { + if (this.error) throw this.error; + if (this.processed) return this.result; + this.processed = true; + if (this.processing) { + throw this.getAsyncError(); + } + for (let plugin2 of this.plugins) { + let promise = this.runOnRoot(plugin2); + if (isPromise(promise)) { + throw this.getAsyncError(); + } + } + this.prepareVisitors(); + if (this.hasListener) { + let root3 = this.result.root; + while (!root3[isClean]) { + root3[isClean] = true; + this.walkSync(root3); + } + if (this.listeners.OnceExit) { + if (root3.type === "document") { + for (let subRoot of root3.nodes) { + this.visitSync(this.listeners.OnceExit, subRoot); + } + } else { + this.visitSync(this.listeners.OnceExit, root3); + } + } + } + return this.result; + } + then(onFulfilled, onRejected) { + if (process.env.NODE_ENV !== "production") { + if (!("from" in this.opts)) { + warnOnce( + "Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning." + ); + } + } + return this.async().then(onFulfilled, onRejected); + } + toString() { + return this.css; + } + visitSync(visitors, node2) { + for (let [plugin2, visitor] of visitors) { + this.result.lastPlugin = plugin2; + let promise; + try { + promise = visitor(node2, this.helpers); + } catch (e) { + throw this.handleError(e, node2.proxyOf); + } + if (node2.type !== "root" && node2.type !== "document" && !node2.parent) { + return true; + } + if (isPromise(promise)) { + throw this.getAsyncError(); + } + } + } + visitTick(stack) { + let visit = stack[stack.length - 1]; + let { node: node2, visitors } = visit; + if (node2.type !== "root" && node2.type !== "document" && !node2.parent) { + stack.pop(); + return; + } + if (visitors.length > 0 && visit.visitorIndex < visitors.length) { + let [plugin2, visitor] = visitors[visit.visitorIndex]; + visit.visitorIndex += 1; + if (visit.visitorIndex === visitors.length) { + visit.visitors = []; + visit.visitorIndex = 0; + } + this.result.lastPlugin = plugin2; + try { + return visitor(node2.toProxy(), this.helpers); + } catch (e) { + throw this.handleError(e, node2); + } + } + if (visit.iterator !== 0) { + let iterator = visit.iterator; + if (visit.descending) { + visit.descending = false; + node2.indexes[iterator] += 1; + } + let child; + while (child = node2.nodes[node2.indexes[iterator]]) { + if (!child[isClean]) { + child[isClean] = true; + visit.descending = true; + stack.push(toStack(child)); + return; + } + node2.indexes[iterator] += 1; + } + visit.iterator = 0; + delete node2.indexes[iterator]; + } + let events = visit.events; + while (visit.eventIndex < events.length) { + let event = events[visit.eventIndex]; + visit.eventIndex += 1; + if (event === CHILDREN) { + if (node2.nodes && node2.nodes.length) { + node2[isClean] = true; + visit.iterator = node2.getIterator(); + } + return; + } else if (this.listeners[event]) { + visit.visitors = this.listeners[event]; + return; + } + } + stack.pop(); + } + walkSync(node2) { + node2[isClean] = true; + let stack = [{ eventIndex: 0, events: getEvents(node2), iterator: 0, node: node2 }]; + while (stack.length > 0) { + let visit = stack[stack.length - 1]; + let visitNode = visit.node; + if (visit.iterator !== 0) { + let iterator = visit.iterator; + if (visit.descending) { + visit.descending = false; + visitNode.indexes[iterator] += 1; + } + let child; + let descended = false; + while (child = visitNode.nodes[visitNode.indexes[iterator]]) { + if (!child[isClean]) { + child[isClean] = true; + visit.descending = true; + stack.push({ + eventIndex: 0, + events: getEvents(child), + iterator: 0, + node: child + }); + descended = true; + break; + } + visitNode.indexes[iterator] += 1; + } + if (descended) continue; + visit.iterator = 0; + delete visitNode.indexes[iterator]; + } + if (visit.eventIndex < visit.events.length) { + let event = visit.events[visit.eventIndex]; + visit.eventIndex += 1; + if (event === CHILDREN) { + if (visitNode.nodes && visitNode.nodes.length) { + visit.iterator = visitNode.getIterator(); + } + } else { + let visitors = this.listeners[event]; + if (visitors) { + if (this.visitSync(visitors, visitNode.toProxy())) stack.pop(); + } + } + continue; + } + stack.pop(); + } + } + warnings() { + return this.sync().warnings(); + } + }; + LazyResult.registerPostcss = (dependant) => { + postcss2 = dependant; + }; + module.exports = LazyResult; + LazyResult.default = LazyResult; + Root2.registerLazyResult(LazyResult); + Document2.registerLazyResult(LazyResult); } - /** - * Visit a HashNode node. - * - * @param {nodes.HashNode} node - */ - visitHashNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/no-work-result.js + var require_no_work_result = __commonJS({ + "node_modules/postcss/lib/no-work-result.js"(exports, module) { + "use strict"; + var MapGenerator = require_map_generator(); + var parse3 = require_parse2(); + var Result3 = require_result(); + var stringify2 = require_stringify(); + var warnOnce = require_warn_once(); + var NoWorkResult = class { + get content() { + return this.result.css; + } + get css() { + return this.result.css; + } + get map() { + return this.result.map; + } + get messages() { + return []; + } + get opts() { + return this.result.opts; + } + get processor() { + return this.result.processor; + } + get root() { + if (this._root) { + return this._root; + } + let root3; + let parser = parse3; + try { + root3 = parser(this._css, this._opts); + } catch (error2) { + this.error = error2; + } + if (this.error) { + throw this.error; + } else { + this._root = root3; + return root3; + } + } + get [Symbol.toStringTag]() { + return "NoWorkResult"; + } + constructor(processor, css, opts) { + css = css.toString(); + this.stringified = false; + this._processor = processor; + this._css = css; + this._opts = opts; + this._map = void 0; + let str = stringify2; + this.result = new Result3(this._processor, void 0, this._opts); + this.result.css = css; + let self = this; + Object.defineProperty(this.result, "root", { + get() { + return self.root; + } + }); + let map = new MapGenerator(str, void 0, this._opts, css); + if (map.isMap()) { + let [generatedCSS, generatedMap] = map.generate(); + if (generatedCSS) { + this.result.css = generatedCSS; + } + if (generatedMap) { + this.result.map = generatedMap; + } + } else { + map.clearAnnotation(); + this.result.css = map.css; + } + } + async() { + if (this.error) return Promise.reject(this.error); + return Promise.resolve(this.result); + } + catch(onRejected) { + return this.async().catch(onRejected); + } + finally(onFinally) { + return this.async().then(onFinally, onFinally); + } + sync() { + if (this.error) throw this.error; + return this.result; + } + then(onFulfilled, onRejected) { + if (process.env.NODE_ENV !== "production") { + if (!("from" in this._opts)) { + warnOnce( + "Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning." + ); + } + } + return this.async().then(onFulfilled, onRejected); + } + toString() { + return this._css; + } + warnings() { + return []; + } + }; + module.exports = NoWorkResult; + NoWorkResult.default = NoWorkResult; } - /** - * Visit a HashPatternNode node. - * - * @param {nodes.HashPatternNode} node - */ - visitHashPatternNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/processor.js + var require_processor = __commonJS({ + "node_modules/postcss/lib/processor.js"(exports, module) { + "use strict"; + var Document2 = require_document(); + var LazyResult = require_lazy_result(); + var NoWorkResult = require_no_work_result(); + var Root2 = require_root(); + var Processor2 = class { + constructor(plugins = []) { + this.version = "8.5.31"; + this.plugins = this.normalize(plugins); + } + normalize(plugins) { + let normalized = []; + for (let i of plugins) { + if (i.postcss === true) { + i = i(); + } else if (i.postcss) { + i = i.postcss; + } + if (typeof i === "object" && Array.isArray(i.plugins)) { + normalized = normalized.concat(i.plugins); + } else if (typeof i === "object" && i.postcssPlugin) { + normalized.push(i); + } else if (typeof i === "function") { + normalized.push(i); + } else if (typeof i === "object" && (i.parse || i.stringify)) { + if (process.env.NODE_ENV !== "production") { + throw new Error( + "PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation." + ); + } + } else { + throw new Error(i + " is not a PostCSS plugin"); + } + } + return normalized; + } + process(css, opts = {}) { + if (!this.plugins.length && !opts.parser && !opts.stringifier && !opts.syntax) { + return new NoWorkResult(this, css, opts); + } else { + return new LazyResult(this, css, opts); + } + } + use(plugin2) { + this.plugins = this.plugins.concat(this.normalize([plugin2])); + return this; + } + }; + module.exports = Processor2; + Processor2.default = Processor2; + Root2.registerProcessor(Processor2); + Document2.registerProcessor(Processor2); } - /** - * Visit a IfNode node. - * - * @param {nodes.IfNode} node - */ - visitIfNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss/lib/postcss.js + var require_postcss = __commonJS({ + "node_modules/postcss/lib/postcss.js"(exports, module) { + "use strict"; + var AtRule2 = require_at_rule(); + var Comment2 = require_comment(); + var Container2 = require_container(); + var CssSyntaxError2 = require_css_syntax_error(); + var Declaration2 = require_declaration(); + var Document2 = require_document(); + var fromJSON2 = require_fromJSON(); + var Input2 = require_input(); + var LazyResult = require_lazy_result(); + var list2 = require_list(); + var Node4 = require_node(); + var parse3 = require_parse2(); + var Processor2 = require_processor(); + var Result3 = require_result(); + var Root2 = require_root(); + var Rule2 = require_rule(); + var stringify2 = require_stringify(); + var Warning2 = require_warning(); + function postcss2(...plugins) { + if (plugins.length === 1 && Array.isArray(plugins[0])) { + plugins = plugins[0]; + } + return new Processor2(plugins); + } + postcss2.plugin = function plugin2(name2, initializer2) { + let warningPrinted = false; + function creator(...args) { + if (console && console.warn && !warningPrinted) { + warningPrinted = true; + console.warn( + name2 + ": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration" + ); + if (process.env.LANG && process.env.LANG.startsWith("zh")) { + console.warn( + name2 + ": \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:\nhttps://www.w3ctech.com/topic/2226" + ); + } + } + let transformer = initializer2(...args); + transformer.postcssPlugin = name2; + transformer.postcssVersion = new Processor2().version; + return transformer; + } + let cache; + Object.defineProperty(creator, "postcss", { + get() { + if (!cache) cache = creator(); + return cache; + } + }); + creator.process = function(css, processOpts, pluginOpts) { + return postcss2([creator(pluginOpts)]).process(css, processOpts); + }; + return creator; + }; + postcss2.stringify = stringify2; + postcss2.parse = parse3; + postcss2.fromJSON = fromJSON2; + postcss2.list = list2; + postcss2.comment = (defaults) => new Comment2(defaults); + postcss2.atRule = (defaults) => new AtRule2(defaults); + postcss2.decl = (defaults) => new Declaration2(defaults); + postcss2.rule = (defaults) => new Rule2(defaults); + postcss2.root = (defaults) => new Root2(defaults); + postcss2.document = (defaults) => new Document2(defaults); + postcss2.CssSyntaxError = CssSyntaxError2; + postcss2.Declaration = Declaration2; + postcss2.Container = Container2; + postcss2.Processor = Processor2; + postcss2.Document = Document2; + postcss2.Comment = Comment2; + postcss2.Warning = Warning2; + postcss2.AtRule = AtRule2; + postcss2.Result = Result3; + postcss2.Input = Input2; + postcss2.Rule = Rule2; + postcss2.Root = Root2; + postcss2.Node = Node4; + LazyResult.registerPostcss(postcss2); + module.exports = postcss2; + postcss2.default = postcss2; } - /** - * Visit a ImaginaryNode node. - * - * @param {nodes.ImaginaryNode} node - */ - visitImaginaryNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/util/unesc.js + var require_unesc = __commonJS({ + "node_modules/postcss-selector-parser/dist/util/unesc.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = unesc; + function gobbleHex(str) { + var lower = str.toLowerCase(); + var hex = ""; + for (var i = 0; i < 6 && lower[i] !== void 0; i++) { + var code = lower.charCodeAt(i); + var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57; + if (!valid) { + break; + } + hex += lower[i]; + } + if (hex.length === 0) { + return void 0; + } + var consumed = hex.length; + var next = str[consumed]; + if (next === " " || next === " " || next === "\n" || next === "\r" || next === "\f") { + consumed += next === "\r" && str[consumed + 1] === "\n" ? 2 : 1; + } + var codePoint = parseInt(hex, 16); + var isSurrogate = codePoint >= 55296 && codePoint <= 57343; + if (isSurrogate || codePoint === 0 || codePoint > 1114111) { + return ["\uFFFD", consumed]; + } + return [String.fromCodePoint(codePoint), consumed]; + } + var CONTAINS_ESCAPE = /\\/; + function unesc(str) { + var needToProcess = CONTAINS_ESCAPE.test(str); + if (!needToProcess) { + return str; + } + var ret = ""; + for (var i = 0; i < str.length; i++) { + if (str[i] === "\\") { + var gobbled = gobbleHex(str.slice(i + 1, i + 9)); + if (gobbled !== void 0) { + ret += gobbled[0]; + i += gobbled[1]; + continue; + } + if (str[i + 1] === "\\") { + ret += "\\"; + i++; + continue; + } + if (str.length === i + 1) { + ret += str[i]; + } + continue; + } + ret += str[i]; + } + return ret; + } } - /** - * Visit a ImplicitNode node. - * - * @param {nodes.ImplicitNode} node - */ - visitImplicitNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/util/getProp.js + var require_getProp = __commonJS({ + "node_modules/postcss-selector-parser/dist/util/getProp.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = getProp; + function getProp(obj) { + var props = []; + for (var _i = 1; _i < arguments.length; _i++) { + props[_i - 1] = arguments[_i]; + } + while (props.length > 0) { + var prop = props.shift(); + if (!obj[prop]) { + return void 0; + } + obj = obj[prop]; + } + return obj; + } } - /** - * Visit a ImplicitRestNode node. - * - * @param {nodes.ImplicitRestNode} node - */ - visitImplicitRestNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/util/ensureObject.js + var require_ensureObject = __commonJS({ + "node_modules/postcss-selector-parser/dist/util/ensureObject.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = ensureObject; + function ensureObject(obj) { + var props = []; + for (var _i = 1; _i < arguments.length; _i++) { + props[_i - 1] = arguments[_i]; + } + while (props.length > 0) { + var prop = props.shift(); + if (!obj[prop]) { + obj[prop] = {}; + } + obj = obj[prop]; + } + } } - /** - * Visit a InNode node. - * - * @param {nodes.InNode} node - */ - visitInNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/util/stripComments.js + var require_stripComments = __commonJS({ + "node_modules/postcss-selector-parser/dist/util/stripComments.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = stripComments; + function stripComments(str) { + var s = ""; + var commentStart = str.indexOf("/*"); + var lastEnd = 0; + while (commentStart >= 0) { + s = s + str.slice(lastEnd, commentStart); + var commentEnd = str.indexOf("*/", commentStart + 2); + if (commentEnd < 0) { + return s; + } + lastEnd = commentEnd + 2; + commentStart = str.indexOf("/*", lastEnd); + } + s = s + str.slice(lastEnd); + return s; + } } - /** - * Visit a IndexAndWriteNode node. - * - * @param {nodes.IndexAndWriteNode} node - */ - visitIndexAndWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/util/maxNestingDepth.js + var require_maxNestingDepth = __commonJS({ + "node_modules/postcss-selector-parser/dist/util/maxNestingDepth.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MAX_NESTING_DEPTH = void 0; + exports.default = resolveMaxNestingDepth; + exports.MAX_NESTING_DEPTH = 256; + function resolveMaxNestingDepth(value) { + return Number.isSafeInteger(value) && value >= 0 ? value : exports.MAX_NESTING_DEPTH; + } } - /** - * Visit a IndexOperatorWriteNode node. - * - * @param {nodes.IndexOperatorWriteNode} node - */ - visitIndexOperatorWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/util/index.js + var require_util2 = __commonJS({ + "node_modules/postcss-selector-parser/dist/util/index.js"(exports) { + "use strict"; + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MAX_NESTING_DEPTH = exports.resolveMaxNestingDepth = exports.stripComments = exports.ensureObject = exports.getProp = exports.unesc = void 0; + var unesc_1 = require_unesc(); + Object.defineProperty(exports, "unesc", { enumerable: true, get: function() { + return __importDefault(unesc_1).default; + } }); + var getProp_1 = require_getProp(); + Object.defineProperty(exports, "getProp", { enumerable: true, get: function() { + return __importDefault(getProp_1).default; + } }); + var ensureObject_1 = require_ensureObject(); + Object.defineProperty(exports, "ensureObject", { enumerable: true, get: function() { + return __importDefault(ensureObject_1).default; + } }); + var stripComments_1 = require_stripComments(); + Object.defineProperty(exports, "stripComments", { enumerable: true, get: function() { + return __importDefault(stripComments_1).default; + } }); + var maxNestingDepth_1 = require_maxNestingDepth(); + Object.defineProperty(exports, "resolveMaxNestingDepth", { enumerable: true, get: function() { + return __importDefault(maxNestingDepth_1).default; + } }); + Object.defineProperty(exports, "MAX_NESTING_DEPTH", { enumerable: true, get: function() { + return maxNestingDepth_1.MAX_NESTING_DEPTH; + } }); } - /** - * Visit a IndexOrWriteNode node. - * - * @param {nodes.IndexOrWriteNode} node - */ - visitIndexOrWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/node.js + var require_node2 = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/node.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var util_1 = require_util2(); + var cloneNode = function(obj, parent, depth) { + if (depth === void 0) { + depth = 0; + } + if (depth > util_1.MAX_NESTING_DEPTH) { + throw new Error("Cannot clone selector: nesting depth exceeds the maximum of ".concat(util_1.MAX_NESTING_DEPTH, ".")); + } + if (typeof obj !== "object" || obj === null) { + return obj; + } + var cloned = new obj.constructor(); + for (var i in obj) { + if (!obj.hasOwnProperty(i)) { + continue; + } + var value = obj[i]; + var type = typeof value; + if (i === "parent" && type === "object") { + if (parent) { + cloned[i] = parent; + } + } else if (value instanceof Array) { + cloned[i] = value.map(function(j2) { + return cloneNode(j2, cloned, depth + 1); + }); + } else { + cloned[i] = cloneNode(value, cloned, depth + 1); + } + } + return cloned; + }; + var Node4 = ( + /** @class */ + (function() { + function Node5(opts) { + if (opts === void 0) { + opts = {}; + } + Object.assign(this, opts); + this.spaces = this.spaces || {}; + this.spaces.before = this.spaces.before || ""; + this.spaces.after = this.spaces.after || ""; + } + Node5.prototype.remove = function() { + if (this.parent) { + this.parent.removeChild(this); + } + this.parent = void 0; + return this; + }; + Node5.prototype.replaceWith = function() { + if (this.parent) { + for (var index in arguments) { + this.parent.insertBefore(this, arguments[index]); + } + this.remove(); + } + return this; + }; + Node5.prototype.next = function() { + return this.parent.at(this.parent.index(this) + 1); + }; + Node5.prototype.prev = function() { + return this.parent.at(this.parent.index(this) - 1); + }; + Node5.prototype.clone = function(overrides) { + if (overrides === void 0) { + overrides = {}; + } + var cloned = cloneNode(this); + for (var name2 in overrides) { + cloned[name2] = overrides[name2]; + } + return cloned; + }; + Node5.prototype.appendToPropertyAndEscape = function(name2, value, valueEscaped) { + if (!this.raws) { + this.raws = {}; + } + var originalValue = this[name2]; + var originalEscaped = this.raws[name2]; + this[name2] = originalValue + value; + if (originalEscaped || valueEscaped !== value) { + this.raws[name2] = (originalEscaped || originalValue) + valueEscaped; + } else { + delete this.raws[name2]; + } + }; + Node5.prototype.setPropertyAndEscape = function(name2, value, valueEscaped) { + if (!this.raws) { + this.raws = {}; + } + this[name2] = value; + this.raws[name2] = valueEscaped; + }; + Node5.prototype.setPropertyWithoutEscape = function(name2, value) { + this[name2] = value; + if (this.raws) { + delete this.raws[name2]; + } + }; + Node5.prototype.isAtPosition = function(line, column) { + if (this.source && this.source.start && this.source.end) { + if (this.source.start.line > line) { + return false; + } + if (this.source.end.line < line) { + return false; + } + if (this.source.start.line === line && this.source.start.column > column) { + return false; + } + if (this.source.end.line === line && this.source.end.column < column) { + return false; + } + return true; + } + return void 0; + }; + Node5.prototype.stringifyProperty = function(name2) { + return this.raws && this.raws[name2] || this[name2]; + }; + Object.defineProperty(Node5.prototype, "rawSpaceBefore", { + get: function() { + var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before; + if (rawSpace === void 0) { + rawSpace = this.spaces && this.spaces.before; + } + return rawSpace || ""; + }, + set: function(raw) { + (0, util_1.ensureObject)(this, "raws", "spaces"); + this.raws.spaces.before = raw; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Node5.prototype, "rawSpaceAfter", { + get: function() { + var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after; + if (rawSpace === void 0) { + rawSpace = this.spaces.after; + } + return rawSpace || ""; + }, + set: function(raw) { + (0, util_1.ensureObject)(this, "raws", "spaces"); + this.raws.spaces.after = raw; + }, + enumerable: false, + configurable: true + }); + Node5.prototype.valueToString = function() { + return String(this.stringifyProperty("value")); + }; + Node5.prototype.toString = function() { + return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join(""); + }; + Node5.prototype._stringify = function() { + return this.toString(); + }; + return Node5; + })() + ); + exports.default = Node4; } - /** - * Visit a IndexTargetNode node. - * - * @param {nodes.IndexTargetNode} node - */ - visitIndexTargetNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/types.js + var require_types = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/types.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.UNIVERSAL = exports.ATTRIBUTE = exports.CLASS = exports.COMBINATOR = exports.COMMENT = exports.ID = exports.NESTING = exports.PSEUDO = exports.ROOT = exports.SELECTOR = exports.STRING = exports.TAG = void 0; + exports.TAG = "tag"; + exports.STRING = "string"; + exports.SELECTOR = "selector"; + exports.ROOT = "root"; + exports.PSEUDO = "pseudo"; + exports.NESTING = "nesting"; + exports.ID = "id"; + exports.COMMENT = "comment"; + exports.COMBINATOR = "combinator"; + exports.CLASS = "class"; + exports.ATTRIBUTE = "attribute"; + exports.UNIVERSAL = "universal"; } - /** - * Visit a InstanceVariableAndWriteNode node. - * - * @param {nodes.InstanceVariableAndWriteNode} node - */ - visitInstanceVariableAndWriteNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a InstanceVariableOperatorWriteNode node. - * - * @param {nodes.InstanceVariableOperatorWriteNode} node - */ - visitInstanceVariableOperatorWriteNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a InstanceVariableOrWriteNode node. - * - * @param {nodes.InstanceVariableOrWriteNode} node - */ - visitInstanceVariableOrWriteNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a InstanceVariableReadNode node. - * - * @param {nodes.InstanceVariableReadNode} node - */ - visitInstanceVariableReadNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a InstanceVariableTargetNode node. - * - * @param {nodes.InstanceVariableTargetNode} node - */ - visitInstanceVariableTargetNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/container.js + var require_container2 = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/container.js"(exports) { + "use strict"; + var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { + var extendStatics = function(d2, b3) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b4) { + d3.__proto__ = b4; + } || function(d3, b4) { + for (var p2 in b4) if (Object.prototype.hasOwnProperty.call(b4, p2)) d3[p2] = b4[p2]; + }; + return extendStatics(d2, b3); + }; + return function(d2, b3) { + if (typeof b3 !== "function" && b3 !== null) + throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null"); + extendStatics(d2, b3); + function __() { + this.constructor = d2; + } + d2.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __()); + }; + })(); + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m2, k2, k22) { + if (k22 === void 0) k22 = k2; + var desc = Object.getOwnPropertyDescriptor(m2, k2); + if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m2[k2]; + } }; + } + Object.defineProperty(o, k22, desc); + }) : (function(o, m2, k2, k22) { + if (k22 === void 0) k22 = k2; + o[k22] = m2[k2]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v3) { + Object.defineProperty(o, "default", { enumerable: true, value: v3 }); + }) : function(o, v3) { + o["default"] = v3; + }); + var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() { + var ownKeys2 = function(o) { + ownKeys2 = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k2 in o2) if (Object.prototype.hasOwnProperty.call(o2, k2)) ar[ar.length] = k2; + return ar; + }; + return ownKeys2(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k2 = ownKeys2(mod), i = 0; i < k2.length; i++) if (k2[i] !== "default") __createBinding(result, mod, k2[i]); + } + __setModuleDefault(result, mod); + return result; + }; + })(); + var __values = exports && exports.__values || function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m2 = s && o[s], i = 0; + if (m2) return m2.call(o); + if (o && typeof o.length === "number") return { + next: function() { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + var __read = exports && exports.__read || function(o, n) { + var m2 = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m2) return o; + var i = m2.call(o), r2, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r2 = i.next()).done) ar.push(r2.value); + } catch (error2) { + e = { error: error2 }; + } finally { + try { + if (r2 && !r2.done && (m2 = i["return"])) m2.call(i); + } finally { + if (e) throw e.error; + } + } + return ar; + }; + var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + }; + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var util_1 = require_util2(); + var node_1 = __importDefault(require_node2()); + var types = __importStar(require_types()); + var Container2 = ( + /** @class */ + (function(_super) { + __extends(Container3, _super); + function Container3(opts) { + var _this = _super.call(this, opts) || this; + if (!_this.nodes) { + _this.nodes = []; + } + return _this; + } + Container3.prototype.append = function(selector) { + selector.parent = this; + this.nodes.push(selector); + return this; + }; + Container3.prototype.prepend = function(selector) { + selector.parent = this; + this.nodes.unshift(selector); + for (var id in this.indexes) { + this.indexes[id]++; + } + return this; + }; + Container3.prototype.at = function(index) { + return this.nodes[index]; + }; + Container3.prototype.index = function(child) { + if (typeof child === "number") { + return child; + } + return this.nodes.indexOf(child); + }; + Object.defineProperty(Container3.prototype, "first", { + get: function() { + return this.at(0); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Container3.prototype, "last", { + get: function() { + return this.at(this.length - 1); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Container3.prototype, "length", { + get: function() { + return this.nodes.length; + }, + enumerable: false, + configurable: true + }); + Container3.prototype.removeChild = function(child) { + child = this.index(child); + this.at(child).parent = void 0; + this.nodes.splice(child, 1); + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (index >= child) { + this.indexes[id] = index - 1; + } + } + return this; + }; + Container3.prototype.removeAll = function() { + var e_1, _a2; + try { + for (var _b = __values(this.nodes), _c = _b.next(); !_c.done; _c = _b.next()) { + var node2 = _c.value; + node2.parent = void 0; + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (_c && !_c.done && (_a2 = _b.return)) _a2.call(_b); + } finally { + if (e_1) throw e_1.error; + } + } + this.nodes = []; + return this; + }; + Container3.prototype.empty = function() { + return this.removeAll(); + }; + Container3.prototype.insertAfter = function(oldNode, newNode) { + var _a2; + newNode.parent = this; + var oldIndex = this.index(oldNode); + var resetNode = []; + for (var i = 2; i < arguments.length; i++) { + arguments[i].parent = this; + resetNode.push(arguments[i]); + } + (_a2 = this.nodes).splice.apply(_a2, __spreadArray([oldIndex + 1, 0, newNode], __read(resetNode), false)); + newNode.parent = this; + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (oldIndex < index) { + this.indexes[id] = index + arguments.length - 1; + } + } + return this; + }; + Container3.prototype.insertBefore = function(oldNode, newNode) { + var _a2; + newNode.parent = this; + var oldIndex = this.index(oldNode); + var resetNode = []; + for (var i = 2; i < arguments.length; i++) { + arguments[i].parent = this; + resetNode.push(arguments[i]); + } + (_a2 = this.nodes).splice.apply(_a2, __spreadArray([oldIndex, 0, newNode], __read(resetNode), false)); + newNode.parent = this; + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (index >= oldIndex) { + this.indexes[id] = index + arguments.length - 1; + } + } + return this; + }; + Container3.prototype._findChildAtPosition = function(line, col) { + var found = void 0; + this.each(function(node2) { + if (node2.atPosition) { + var foundChild = node2.atPosition(line, col); + if (foundChild) { + found = foundChild; + return false; + } + } else if (node2.isAtPosition(line, col)) { + found = node2; + return false; + } + }); + return found; + }; + Container3.prototype.atPosition = function(line, col) { + if (this.isAtPosition(line, col)) { + return this._findChildAtPosition(line, col) || this; + } else { + return void 0; + } + }; + Container3.prototype._inferEndPosition = function() { + if (this.last && this.last.source && this.last.source.end) { + this.source = this.source || {}; + this.source.end = this.source.end || {}; + Object.assign(this.source.end, this.last.source.end); + } + }; + Container3.prototype.each = function(callback) { + if (!this.lastEach) { + this.lastEach = 0; + } + if (!this.indexes) { + this.indexes = {}; + } + this.lastEach++; + var id = this.lastEach; + this.indexes[id] = 0; + if (!this.length) { + return void 0; + } + var index, result; + while (this.indexes[id] < this.length) { + index = this.indexes[id]; + result = callback(this.at(index), index); + if (result === false) { + break; + } + this.indexes[id] += 1; + } + delete this.indexes[id]; + if (result === false) { + return false; + } + }; + Container3.prototype.walk = function(callback, depth) { + if (depth === void 0) { + depth = 0; + } + if (depth > util_1.MAX_NESTING_DEPTH) { + throw new Error("Cannot walk selector: nesting depth exceeds the maximum of ".concat(util_1.MAX_NESTING_DEPTH, ".")); + } + return this.each(function(node2, i) { + var result = callback(node2, i); + if (result !== false && node2.length) { + result = node2.walk(callback, depth + 1); + } + if (result === false) { + return false; + } + }); + }; + Container3.prototype.walkAttributes = function(callback) { + var _this = this; + return this.walk(function(selector) { + if (selector.type === types.ATTRIBUTE) { + return callback.call(_this, selector); + } + }); + }; + Container3.prototype.walkClasses = function(callback) { + var _this = this; + return this.walk(function(selector) { + if (selector.type === types.CLASS) { + return callback.call(_this, selector); + } + }); + }; + Container3.prototype.walkCombinators = function(callback) { + var _this = this; + return this.walk(function(selector) { + if (selector.type === types.COMBINATOR) { + return callback.call(_this, selector); + } + }); + }; + Container3.prototype.walkComments = function(callback) { + var _this = this; + return this.walk(function(selector) { + if (selector.type === types.COMMENT) { + return callback.call(_this, selector); + } + }); + }; + Container3.prototype.walkIds = function(callback) { + var _this = this; + return this.walk(function(selector) { + if (selector.type === types.ID) { + return callback.call(_this, selector); + } + }); + }; + Container3.prototype.walkNesting = function(callback) { + var _this = this; + return this.walk(function(selector) { + if (selector.type === types.NESTING) { + return callback.call(_this, selector); + } + }); + }; + Container3.prototype.walkPseudos = function(callback) { + var _this = this; + return this.walk(function(selector) { + if (selector.type === types.PSEUDO) { + return callback.call(_this, selector); + } + }); + }; + Container3.prototype.walkTags = function(callback) { + var _this = this; + return this.walk(function(selector) { + if (selector.type === types.TAG) { + return callback.call(_this, selector); + } + }); + }; + Container3.prototype.walkUniversals = function(callback) { + var _this = this; + return this.walk(function(selector) { + if (selector.type === types.UNIVERSAL) { + return callback.call(_this, selector); + } + }); + }; + Container3.prototype.split = function(callback) { + var _this = this; + var current = []; + return this.reduce(function(memo2, node2, index) { + var split = callback.call(_this, node2); + current.push(node2); + if (split) { + memo2.push(current); + current = []; + } else if (index === _this.length - 1) { + memo2.push(current); + } + return memo2; + }, []); + }; + Container3.prototype.map = function(callback) { + return this.nodes.map(callback); + }; + Container3.prototype.reduce = function(callback, memo2) { + return this.nodes.reduce(callback, memo2); + }; + Container3.prototype.every = function(callback) { + return this.nodes.every(callback); + }; + Container3.prototype.some = function(callback) { + return this.nodes.some(callback); + }; + Container3.prototype.filter = function(callback) { + return this.nodes.filter(callback); + }; + Container3.prototype.sort = function(callback) { + return this.nodes.sort(callback); + }; + Container3.prototype.toString = function(options) { + if (options === void 0) { + options = {}; + } + return this._stringify(options, 0, (0, util_1.resolveMaxNestingDepth)(options.maxNestingDepth)); + }; + Container3.prototype._stringify = function(options, depth, max) { + var _this = this; + return this.map(function(child) { + return _this._stringifyChild(child, options, depth, max); + }).join(""); + }; + Container3.prototype._stringifyChild = function(child, options, depth, max) { + return typeof child._stringify === "function" ? child._stringify(options, depth, max) : String(child); + }; + return Container3; + })(node_1.default) + ); + exports.default = Container2; } - /** - * Visit a InstanceVariableWriteNode node. - * - * @param {nodes.InstanceVariableWriteNode} node - */ - visitInstanceVariableWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/root.js + var require_root2 = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/root.js"(exports) { + "use strict"; + var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { + var extendStatics = function(d2, b3) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b4) { + d3.__proto__ = b4; + } || function(d3, b4) { + for (var p2 in b4) if (Object.prototype.hasOwnProperty.call(b4, p2)) d3[p2] = b4[p2]; + }; + return extendStatics(d2, b3); + }; + return function(d2, b3) { + if (typeof b3 !== "function" && b3 !== null) + throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null"); + extendStatics(d2, b3); + function __() { + this.constructor = d2; + } + d2.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __()); + }; + })(); + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var container_1 = __importDefault(require_container2()); + var types_1 = require_types(); + var Root2 = ( + /** @class */ + (function(_super) { + __extends(Root3, _super); + function Root3(opts) { + var _this = _super.call(this, opts) || this; + _this.type = types_1.ROOT; + return _this; + } + Root3.prototype._stringify = function(options, depth, max) { + var _this = this; + var str = this.reduce(function(memo2, selector) { + memo2.push(_this._stringifyChild(selector, options, depth, max)); + return memo2; + }, []).join(","); + return this.trailingComma ? str + "," : str; + }; + Root3.prototype.error = function(message, options) { + if (this._error) { + return this._error(message, options); + } else { + return new Error(message); + } + }; + Object.defineProperty(Root3.prototype, "errorGenerator", { + set: function(handler) { + this._error = handler; + }, + enumerable: false, + configurable: true + }); + return Root3; + })(container_1.default) + ); + exports.default = Root2; } - /** - * Visit a IntegerNode node. - * - * @param {nodes.IntegerNode} node - */ - visitIntegerNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/selector.js + var require_selector = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/selector.js"(exports) { + "use strict"; + var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { + var extendStatics = function(d2, b3) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b4) { + d3.__proto__ = b4; + } || function(d3, b4) { + for (var p2 in b4) if (Object.prototype.hasOwnProperty.call(b4, p2)) d3[p2] = b4[p2]; + }; + return extendStatics(d2, b3); + }; + return function(d2, b3) { + if (typeof b3 !== "function" && b3 !== null) + throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null"); + extendStatics(d2, b3); + function __() { + this.constructor = d2; + } + d2.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __()); + }; + })(); + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var container_1 = __importDefault(require_container2()); + var types_1 = require_types(); + var Selector = ( + /** @class */ + (function(_super) { + __extends(Selector2, _super); + function Selector2(opts) { + var _this = _super.call(this, opts) || this; + _this.type = types_1.SELECTOR; + return _this; + } + return Selector2; + })(container_1.default) + ); + exports.default = Selector; } - /** - * Visit a InterpolatedMatchLastLineNode node. - * - * @param {nodes.InterpolatedMatchLastLineNode} node - */ - visitInterpolatedMatchLastLineNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/cssesc/cssesc.js + var require_cssesc = __commonJS({ + "node_modules/cssesc/cssesc.js"(exports, module) { + "use strict"; + var object2 = {}; + var hasOwnProperty = object2.hasOwnProperty; + var merge2 = function merge3(options, defaults) { + if (!options) { + return defaults; + } + var result = {}; + for (var key in defaults) { + result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key]; + } + return result; + }; + var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/; + var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/; + var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g; + var cssesc = function cssesc2(string2, options) { + options = merge2(options, cssesc2.options); + if (options.quotes != "single" && options.quotes != "double") { + options.quotes = "single"; + } + var quote = options.quotes == "double" ? '"' : "'"; + var isIdentifier = options.isIdentifier; + var firstChar = string2.charAt(0); + var output = ""; + var counter = 0; + var length = string2.length; + while (counter < length) { + var character = string2.charAt(counter++); + var codePoint = character.charCodeAt(); + var value = void 0; + if (codePoint < 32 || codePoint > 126) { + if (codePoint >= 55296 && codePoint <= 56319 && counter < length) { + var extra = string2.charCodeAt(counter++); + if ((extra & 64512) == 56320) { + codePoint = ((codePoint & 1023) << 10) + (extra & 1023) + 65536; + } else { + counter--; + } + } + value = "\\" + codePoint.toString(16).toUpperCase() + " "; + } else { + if (options.escapeEverything) { + if (regexAnySingleEscape.test(character)) { + value = "\\" + character; + } else { + value = "\\" + codePoint.toString(16).toUpperCase() + " "; + } + } else if (/[\t\n\f\r\x0B]/.test(character)) { + value = "\\" + codePoint.toString(16).toUpperCase() + " "; + } else if (character == "\\" || !isIdentifier && (character == '"' && quote == character || character == "'" && quote == character) || isIdentifier && regexSingleEscape.test(character)) { + value = "\\" + character; + } else { + value = character; + } + } + output += value; + } + if (isIdentifier) { + if (/^-[-\d]/.test(output)) { + output = "\\-" + output.slice(1); + } else if (/\d/.test(firstChar)) { + output = "\\3" + firstChar + " " + output.slice(1); + } + } + output = output.replace(regexExcessiveSpaces, function($0, $1, $22) { + if ($1 && $1.length % 2) { + return $0; + } + return ($1 || "") + $22; + }); + if (!isIdentifier && options.wrap) { + return quote + output + quote; + } + return output; + }; + cssesc.options = { + "escapeEverything": false, + "isIdentifier": false, + "quotes": "single", + "wrap": false + }; + cssesc.version = "3.0.0"; + module.exports = cssesc; } - /** - * Visit a InterpolatedRegularExpressionNode node. - * - * @param {nodes.InterpolatedRegularExpressionNode} node - */ - visitInterpolatedRegularExpressionNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/className.js + var require_className = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/className.js"(exports) { + "use strict"; + var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { + var extendStatics = function(d2, b3) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b4) { + d3.__proto__ = b4; + } || function(d3, b4) { + for (var p2 in b4) if (Object.prototype.hasOwnProperty.call(b4, p2)) d3[p2] = b4[p2]; + }; + return extendStatics(d2, b3); + }; + return function(d2, b3) { + if (typeof b3 !== "function" && b3 !== null) + throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null"); + extendStatics(d2, b3); + function __() { + this.constructor = d2; + } + d2.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __()); + }; + })(); + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var cssesc_1 = __importDefault(require_cssesc()); + var util_1 = require_util2(); + var node_1 = __importDefault(require_node2()); + var types_1 = require_types(); + var ClassName = ( + /** @class */ + (function(_super) { + __extends(ClassName2, _super); + function ClassName2(opts) { + var _this = _super.call(this, opts) || this; + _this.type = types_1.CLASS; + _this._constructed = true; + return _this; + } + Object.defineProperty(ClassName2.prototype, "value", { + get: function() { + return this._value; + }, + set: function(v3) { + if (this._constructed) { + var escaped = (0, cssesc_1.default)(v3, { isIdentifier: true }); + if (escaped !== v3) { + (0, util_1.ensureObject)(this, "raws"); + this.raws.value = escaped; + } else if (this.raws) { + delete this.raws.value; + } + } + this._value = v3; + }, + enumerable: false, + configurable: true + }); + ClassName2.prototype.valueToString = function() { + return "." + _super.prototype.valueToString.call(this); + }; + return ClassName2; + })(node_1.default) + ); + exports.default = ClassName; } - /** - * Visit a InterpolatedStringNode node. - * - * @param {nodes.InterpolatedStringNode} node - */ - visitInterpolatedStringNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/comment.js + var require_comment2 = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/comment.js"(exports) { + "use strict"; + var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { + var extendStatics = function(d2, b3) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b4) { + d3.__proto__ = b4; + } || function(d3, b4) { + for (var p2 in b4) if (Object.prototype.hasOwnProperty.call(b4, p2)) d3[p2] = b4[p2]; + }; + return extendStatics(d2, b3); + }; + return function(d2, b3) { + if (typeof b3 !== "function" && b3 !== null) + throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null"); + extendStatics(d2, b3); + function __() { + this.constructor = d2; + } + d2.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __()); + }; + })(); + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var node_1 = __importDefault(require_node2()); + var types_1 = require_types(); + var Comment2 = ( + /** @class */ + (function(_super) { + __extends(Comment3, _super); + function Comment3(opts) { + var _this = _super.call(this, opts) || this; + _this.type = types_1.COMMENT; + return _this; + } + return Comment3; + })(node_1.default) + ); + exports.default = Comment2; } - /** - * Visit a InterpolatedSymbolNode node. - * - * @param {nodes.InterpolatedSymbolNode} node - */ - visitInterpolatedSymbolNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/id.js + var require_id = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/id.js"(exports) { + "use strict"; + var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { + var extendStatics = function(d2, b3) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b4) { + d3.__proto__ = b4; + } || function(d3, b4) { + for (var p2 in b4) if (Object.prototype.hasOwnProperty.call(b4, p2)) d3[p2] = b4[p2]; + }; + return extendStatics(d2, b3); + }; + return function(d2, b3) { + if (typeof b3 !== "function" && b3 !== null) + throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null"); + extendStatics(d2, b3); + function __() { + this.constructor = d2; + } + d2.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __()); + }; + })(); + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var node_1 = __importDefault(require_node2()); + var types_1 = require_types(); + var ID = ( + /** @class */ + (function(_super) { + __extends(ID2, _super); + function ID2(opts) { + var _this = _super.call(this, opts) || this; + _this.type = types_1.ID; + return _this; + } + ID2.prototype.valueToString = function() { + return "#" + _super.prototype.valueToString.call(this); + }; + return ID2; + })(node_1.default) + ); + exports.default = ID; } - /** - * Visit a InterpolatedXStringNode node. - * - * @param {nodes.InterpolatedXStringNode} node - */ - visitInterpolatedXStringNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/namespace.js + var require_namespace = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/namespace.js"(exports) { + "use strict"; + var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { + var extendStatics = function(d2, b3) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b4) { + d3.__proto__ = b4; + } || function(d3, b4) { + for (var p2 in b4) if (Object.prototype.hasOwnProperty.call(b4, p2)) d3[p2] = b4[p2]; + }; + return extendStatics(d2, b3); + }; + return function(d2, b3) { + if (typeof b3 !== "function" && b3 !== null) + throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null"); + extendStatics(d2, b3); + function __() { + this.constructor = d2; + } + d2.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __()); + }; + })(); + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var cssesc_1 = __importDefault(require_cssesc()); + var util_1 = require_util2(); + var node_1 = __importDefault(require_node2()); + var Namespace = ( + /** @class */ + (function(_super) { + __extends(Namespace2, _super); + function Namespace2() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(Namespace2.prototype, "namespace", { + get: function() { + return this._namespace; + }, + set: function(namespace) { + if (namespace === true || namespace === "*" || namespace === "&") { + this._namespace = namespace; + if (this.raws) { + delete this.raws.namespace; + } + return; + } + var escaped = (0, cssesc_1.default)(namespace, { isIdentifier: true }); + this._namespace = namespace; + if (escaped !== namespace) { + (0, util_1.ensureObject)(this, "raws"); + this.raws.namespace = escaped; + } else if (this.raws) { + delete this.raws.namespace; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Namespace2.prototype, "ns", { + get: function() { + return this._namespace; + }, + set: function(namespace) { + this.namespace = namespace; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Namespace2.prototype, "namespaceString", { + get: function() { + if (this.namespace) { + var ns = this.stringifyProperty("namespace"); + if (ns === true) { + return ""; + } else { + return ns; + } + } else { + return ""; + } + }, + enumerable: false, + configurable: true + }); + Namespace2.prototype.qualifiedName = function(value) { + if (this.namespace) { + return "".concat(this.namespaceString, "|").concat(value); + } else { + return value; + } + }; + Namespace2.prototype.valueToString = function() { + return this.qualifiedName(_super.prototype.valueToString.call(this)); + }; + return Namespace2; + })(node_1.default) + ); + exports.default = Namespace; } - /** - * Visit a ItLocalVariableReadNode node. - * - * @param {nodes.ItLocalVariableReadNode} node - */ - visitItLocalVariableReadNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/tag.js + var require_tag = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/tag.js"(exports) { + "use strict"; + var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { + var extendStatics = function(d2, b3) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b4) { + d3.__proto__ = b4; + } || function(d3, b4) { + for (var p2 in b4) if (Object.prototype.hasOwnProperty.call(b4, p2)) d3[p2] = b4[p2]; + }; + return extendStatics(d2, b3); + }; + return function(d2, b3) { + if (typeof b3 !== "function" && b3 !== null) + throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null"); + extendStatics(d2, b3); + function __() { + this.constructor = d2; + } + d2.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __()); + }; + })(); + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var namespace_1 = __importDefault(require_namespace()); + var types_1 = require_types(); + var Tag = ( + /** @class */ + (function(_super) { + __extends(Tag2, _super); + function Tag2(opts) { + var _this = _super.call(this, opts) || this; + _this.type = types_1.TAG; + return _this; + } + return Tag2; + })(namespace_1.default) + ); + exports.default = Tag; } - /** - * Visit a ItParametersNode node. - * - * @param {nodes.ItParametersNode} node - */ - visitItParametersNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/string.js + var require_string = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/string.js"(exports) { + "use strict"; + var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { + var extendStatics = function(d2, b3) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b4) { + d3.__proto__ = b4; + } || function(d3, b4) { + for (var p2 in b4) if (Object.prototype.hasOwnProperty.call(b4, p2)) d3[p2] = b4[p2]; + }; + return extendStatics(d2, b3); + }; + return function(d2, b3) { + if (typeof b3 !== "function" && b3 !== null) + throw new TypeError("Class extends value " + String2(b3) + " is not a constructor or null"); + extendStatics(d2, b3); + function __() { + this.constructor = d2; + } + d2.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __()); + }; + })(); + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var node_1 = __importDefault(require_node2()); + var types_1 = require_types(); + var String2 = ( + /** @class */ + (function(_super) { + __extends(String3, _super); + function String3(opts) { + var _this = _super.call(this, opts) || this; + _this.type = types_1.STRING; + return _this; + } + return String3; + })(node_1.default) + ); + exports.default = String2; } - /** - * Visit a KeywordHashNode node. - * - * @param {nodes.KeywordHashNode} node - */ - visitKeywordHashNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/pseudo.js + var require_pseudo = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/pseudo.js"(exports) { + "use strict"; + var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { + var extendStatics = function(d2, b3) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b4) { + d3.__proto__ = b4; + } || function(d3, b4) { + for (var p2 in b4) if (Object.prototype.hasOwnProperty.call(b4, p2)) d3[p2] = b4[p2]; + }; + return extendStatics(d2, b3); + }; + return function(d2, b3) { + if (typeof b3 !== "function" && b3 !== null) + throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null"); + extendStatics(d2, b3); + function __() { + this.constructor = d2; + } + d2.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __()); + }; + })(); + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var container_1 = __importDefault(require_container2()); + var types_1 = require_types(); + var Pseudo = ( + /** @class */ + (function(_super) { + __extends(Pseudo2, _super); + function Pseudo2(opts) { + var _this = _super.call(this, opts) || this; + _this.type = types_1.PSEUDO; + return _this; + } + Pseudo2.prototype._stringify = function(options, depth, max) { + var _this = this; + if (depth >= max) { + throw new Error("Cannot serialize selector: nesting depth exceeds the maximum of ".concat(max, ".")); + } + var params = this.length ? "(" + this.map(function(child) { + return _this._stringifyChild(child, options, depth + 1, max); + }).join(",") + ")" : ""; + return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join(""); + }; + return Pseudo2; + })(container_1.default) + ); + exports.default = Pseudo; } - /** - * Visit a KeywordRestParameterNode node. - * - * @param {nodes.KeywordRestParameterNode} node - */ - visitKeywordRestParameterNode(node) { - this.visitChildNodes(node); + }); + + // stubs/util.mjs + var util_exports = {}; + __export(util_exports, { + deprecate: () => deprecate + }); + function deprecate(fn) { + return fn; + } + var init_util = __esm({ + "stubs/util.mjs"() { } - /** - * Visit a LambdaNode node. - * - * @param {nodes.LambdaNode} node - */ - visitLambdaNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/util-deprecate/node.js + var require_node3 = __commonJS({ + "node_modules/util-deprecate/node.js"(exports, module) { + module.exports = (init_util(), __toCommonJS(util_exports)).deprecate; } - /** - * Visit a LocalVariableAndWriteNode node. - * - * @param {nodes.LocalVariableAndWriteNode} node - */ - visitLocalVariableAndWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/attribute.js + var require_attribute = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/attribute.js"(exports) { + "use strict"; + var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { + var extendStatics = function(d2, b3) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b4) { + d3.__proto__ = b4; + } || function(d3, b4) { + for (var p2 in b4) if (Object.prototype.hasOwnProperty.call(b4, p2)) d3[p2] = b4[p2]; + }; + return extendStatics(d2, b3); + }; + return function(d2, b3) { + if (typeof b3 !== "function" && b3 !== null) + throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null"); + extendStatics(d2, b3); + function __() { + this.constructor = d2; + } + d2.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __()); + }; + })(); + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + var _a2; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unescapeValue = unescapeValue; + var cssesc_1 = __importDefault(require_cssesc()); + var unesc_1 = __importDefault(require_unesc()); + var namespace_1 = __importDefault(require_namespace()); + var types_1 = require_types(); + var deprecate2 = require_node3(); + var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/; + var warnOfDeprecatedValueAssignment = deprecate2(function() { + }, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. Call attribute.setValue() instead."); + var warnOfDeprecatedQuotedAssignment = deprecate2(function() { + }, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead."); + var warnOfDeprecatedConstructor = deprecate2(function() { + }, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now."); + function unescapeValue(value) { + var deprecatedUsage = false; + var quoteMark = null; + var unescaped = value; + var m2 = unescaped.match(WRAPPED_IN_QUOTES); + if (m2) { + quoteMark = m2[1]; + unescaped = m2[2]; + } + unescaped = (0, unesc_1.default)(unescaped); + if (unescaped !== value) { + deprecatedUsage = true; + } + return { + deprecatedUsage, + unescaped, + quoteMark + }; + } + function handleDeprecatedContructorOpts(opts) { + if (opts.quoteMark !== void 0) { + return opts; + } + if (opts.value === void 0) { + return opts; + } + warnOfDeprecatedConstructor(); + var _a3 = unescapeValue(opts.value), quoteMark = _a3.quoteMark, unescaped = _a3.unescaped; + if (!opts.raws) { + opts.raws = {}; + } + if (opts.raws.value === void 0) { + opts.raws.value = opts.value; + } + opts.value = unescaped; + opts.quoteMark = quoteMark; + return opts; + } + var Attribute = ( + /** @class */ + (function(_super) { + __extends(Attribute2, _super); + function Attribute2(opts) { + if (opts === void 0) { + opts = {}; + } + var _this = _super.call(this, handleDeprecatedContructorOpts(opts)) || this; + _this.type = types_1.ATTRIBUTE; + _this.raws = _this.raws || {}; + Object.defineProperty(_this.raws, "unquoted", { + get: deprecate2(function() { + return _this.value; + }, "attr.raws.unquoted is deprecated. Call attr.value instead."), + set: deprecate2(function() { + return _this.value; + }, "Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.") + }); + _this._constructed = true; + return _this; + } + Attribute2.prototype.getQuotedValue = function(options) { + if (options === void 0) { + options = {}; + } + var quoteMark = this._determineQuoteMark(options); + var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark]; + var escaped = (0, cssesc_1.default)(this._value, cssescopts); + return escaped; + }; + Attribute2.prototype._determineQuoteMark = function(options) { + return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options); + }; + Attribute2.prototype.setValue = function(value, options) { + if (options === void 0) { + options = {}; + } + this._value = value; + this._quoteMark = this._determineQuoteMark(options); + this._syncRawValue(); + }; + Attribute2.prototype.smartQuoteMark = function(options) { + var v3 = this.value; + var numSingleQuotes = v3.replace(/[^']/g, "").length; + var numDoubleQuotes = v3.replace(/[^"]/g, "").length; + if (numSingleQuotes + numDoubleQuotes === 0) { + var escaped = (0, cssesc_1.default)(v3, { isIdentifier: true }); + if (escaped === v3) { + return Attribute2.NO_QUOTE; + } else { + var pref = this.preferredQuoteMark(options); + if (pref === Attribute2.NO_QUOTE) { + var quote = this.quoteMark || options.quoteMark || Attribute2.DOUBLE_QUOTE; + var opts = CSSESC_QUOTE_OPTIONS[quote]; + var quoteValue = (0, cssesc_1.default)(v3, opts); + if (quoteValue.length < escaped.length) { + return quote; + } + } + return pref; + } + } else if (numDoubleQuotes === numSingleQuotes) { + return this.preferredQuoteMark(options); + } else if (numDoubleQuotes < numSingleQuotes) { + return Attribute2.DOUBLE_QUOTE; + } else { + return Attribute2.SINGLE_QUOTE; + } + }; + Attribute2.prototype.preferredQuoteMark = function(options) { + var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark; + if (quoteMark === void 0) { + quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark; + } + if (quoteMark === void 0) { + quoteMark = Attribute2.DOUBLE_QUOTE; + } + return quoteMark; + }; + Object.defineProperty(Attribute2.prototype, "quoted", { + get: function() { + var qm = this.quoteMark; + return qm === "'" || qm === '"'; + }, + set: function(value) { + warnOfDeprecatedQuotedAssignment(); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Attribute2.prototype, "quoteMark", { + /** + * returns a single (`'`) or double (`"`) quote character if the value is quoted. + * returns `null` if the value is not quoted. + * returns `undefined` if the quotation state is unknown (this can happen when + * the attribute is constructed without specifying a quote mark.) + */ + get: function() { + return this._quoteMark; + }, + /** + * Set the quote mark to be used by this attribute's value. + * If the quote mark changes, the raw (escaped) value at `attr.raws.value` of the attribute + * value is updated accordingly. + * + * @param {"'" | '"' | null} quoteMark The quote mark or `null` if the value should be unquoted. + */ + set: function(quoteMark) { + if (!this._constructed) { + this._quoteMark = quoteMark; + return; + } + if (this._quoteMark !== quoteMark) { + this._quoteMark = quoteMark; + this._syncRawValue(); + } + }, + enumerable: false, + configurable: true + }); + Attribute2.prototype._syncRawValue = function() { + var rawValue = (0, cssesc_1.default)(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]); + if (rawValue === this._value) { + if (this.raws) { + delete this.raws.value; + } + } else { + this.raws.value = rawValue; + } + }; + Object.defineProperty(Attribute2.prototype, "qualifiedAttribute", { + get: function() { + return this.qualifiedName(this.raws.attribute || this.attribute); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Attribute2.prototype, "insensitiveFlag", { + get: function() { + return this.insensitive ? "i" : ""; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Attribute2.prototype, "value", { + get: function() { + return this._value; + }, + /** + * Before 3.0, the value had to be set to an escaped value including any wrapped + * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value + * is unescaped during parsing and any quote marks are removed. + * + * Because the ambiguity of this semantic change, if you set `attr.value = newValue`, + * a deprecation warning is raised when the new value contains any characters that would + * require escaping (including if it contains wrapped quotes). + * + * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe + * how the new value is quoted. + */ + set: function(v3) { + if (this._constructed) { + var _a3 = unescapeValue(v3), deprecatedUsage = _a3.deprecatedUsage, unescaped = _a3.unescaped, quoteMark = _a3.quoteMark; + if (deprecatedUsage) { + warnOfDeprecatedValueAssignment(); + } + if (unescaped === this._value && quoteMark === this._quoteMark) { + return; + } + this._value = unescaped; + this._quoteMark = quoteMark; + this._syncRawValue(); + } else { + this._value = v3; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Attribute2.prototype, "insensitive", { + get: function() { + return this._insensitive; + }, + /** + * Set the case insensitive flag. + * If the case insensitive flag changes, the raw (escaped) value at `attr.raws.insensitiveFlag` + * of the attribute is updated accordingly. + * + * @param {true | false} insensitive true if the attribute should match case-insensitively. + */ + set: function(insensitive) { + if (!insensitive) { + this._insensitive = false; + if (this.raws && (this.raws.insensitiveFlag === "I" || this.raws.insensitiveFlag === "i")) { + this.raws.insensitiveFlag = void 0; + } + } + this._insensitive = insensitive; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Attribute2.prototype, "attribute", { + get: function() { + return this._attribute; + }, + set: function(name2) { + this._handleEscapes("attribute", name2); + this._attribute = name2; + }, + enumerable: false, + configurable: true + }); + Attribute2.prototype._handleEscapes = function(prop, value) { + if (this._constructed) { + var escaped = (0, cssesc_1.default)(value, { isIdentifier: true }); + if (escaped !== value) { + this.raws[prop] = escaped; + } else { + delete this.raws[prop]; + } + } + }; + Attribute2.prototype._spacesFor = function(name2) { + var attrSpaces = { before: "", after: "" }; + var spaces = this.spaces[name2] || {}; + var rawSpaces = this.raws.spaces && this.raws.spaces[name2] || {}; + return Object.assign(attrSpaces, spaces, rawSpaces); + }; + Attribute2.prototype._stringFor = function(name2, spaceName, concat) { + if (spaceName === void 0) { + spaceName = name2; + } + if (concat === void 0) { + concat = defaultAttrConcat; + } + var attrSpaces = this._spacesFor(spaceName); + return concat(this.stringifyProperty(name2), attrSpaces); + }; + Attribute2.prototype.offsetOf = function(name2) { + var count = 1; + var attributeSpaces = this._spacesFor("attribute"); + count += attributeSpaces.before.length; + if (name2 === "namespace" || name2 === "ns") { + return this.namespace ? count : -1; + } + if (name2 === "attributeNS") { + return count; + } + count += this.namespaceString.length; + if (this.namespace) { + count += 1; + } + if (name2 === "attribute") { + return count; + } + count += this.stringifyProperty("attribute").length; + count += attributeSpaces.after.length; + var operatorSpaces = this._spacesFor("operator"); + count += operatorSpaces.before.length; + var operator = this.stringifyProperty("operator"); + if (name2 === "operator") { + return operator ? count : -1; + } + count += operator.length; + count += operatorSpaces.after.length; + var valueSpaces = this._spacesFor("value"); + count += valueSpaces.before.length; + var value = this.stringifyProperty("value"); + if (name2 === "value") { + return value ? count : -1; + } + count += value.length; + count += valueSpaces.after.length; + var insensitiveSpaces = this._spacesFor("insensitive"); + count += insensitiveSpaces.before.length; + if (name2 === "insensitive") { + return this.insensitive ? count : -1; + } + return -1; + }; + Attribute2.prototype.toString = function() { + var _this = this; + var selector = [this.rawSpaceBefore, "["]; + selector.push(this._stringFor("qualifiedAttribute", "attribute")); + if (this.operator && (this.value || this.value === "")) { + selector.push(this._stringFor("operator")); + selector.push(this._stringFor("value")); + selector.push(this._stringFor("insensitiveFlag", "insensitive", function(attrValue, attrSpaces) { + if (attrValue.length > 0 && !_this.quoted && attrSpaces.before.length === 0 && !(_this.spaces.value && _this.spaces.value.after)) { + attrSpaces.before = " "; + } + return defaultAttrConcat(attrValue, attrSpaces); + })); + } + selector.push("]"); + selector.push(this.rawSpaceAfter); + return selector.join(""); + }; + Attribute2.NO_QUOTE = null; + Attribute2.SINGLE_QUOTE = "'"; + Attribute2.DOUBLE_QUOTE = '"'; + return Attribute2; + })(namespace_1.default) + ); + exports.default = Attribute; + var CSSESC_QUOTE_OPTIONS = (_a2 = { + "'": { quotes: "single", wrap: true }, + '"': { quotes: "double", wrap: true } + }, _a2[null] = { isIdentifier: true }, _a2); + function defaultAttrConcat(attrValue, attrSpaces) { + return "".concat(attrSpaces.before).concat(attrValue).concat(attrSpaces.after); + } } - /** - * Visit a LocalVariableOperatorWriteNode node. - * - * @param {nodes.LocalVariableOperatorWriteNode} node - */ - visitLocalVariableOperatorWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/universal.js + var require_universal = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/universal.js"(exports) { + "use strict"; + var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { + var extendStatics = function(d2, b3) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b4) { + d3.__proto__ = b4; + } || function(d3, b4) { + for (var p2 in b4) if (Object.prototype.hasOwnProperty.call(b4, p2)) d3[p2] = b4[p2]; + }; + return extendStatics(d2, b3); + }; + return function(d2, b3) { + if (typeof b3 !== "function" && b3 !== null) + throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null"); + extendStatics(d2, b3); + function __() { + this.constructor = d2; + } + d2.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __()); + }; + })(); + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var namespace_1 = __importDefault(require_namespace()); + var types_1 = require_types(); + var Universal = ( + /** @class */ + (function(_super) { + __extends(Universal2, _super); + function Universal2(opts) { + var _this = _super.call(this, opts) || this; + _this.type = types_1.UNIVERSAL; + _this.value = "*"; + return _this; + } + return Universal2; + })(namespace_1.default) + ); + exports.default = Universal; } - /** - * Visit a LocalVariableOrWriteNode node. - * - * @param {nodes.LocalVariableOrWriteNode} node - */ - visitLocalVariableOrWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/combinator.js + var require_combinator = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/combinator.js"(exports) { + "use strict"; + var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { + var extendStatics = function(d2, b3) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b4) { + d3.__proto__ = b4; + } || function(d3, b4) { + for (var p2 in b4) if (Object.prototype.hasOwnProperty.call(b4, p2)) d3[p2] = b4[p2]; + }; + return extendStatics(d2, b3); + }; + return function(d2, b3) { + if (typeof b3 !== "function" && b3 !== null) + throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null"); + extendStatics(d2, b3); + function __() { + this.constructor = d2; + } + d2.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __()); + }; + })(); + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var node_1 = __importDefault(require_node2()); + var types_1 = require_types(); + var Combinator = ( + /** @class */ + (function(_super) { + __extends(Combinator2, _super); + function Combinator2(opts) { + var _this = _super.call(this, opts) || this; + _this.type = types_1.COMBINATOR; + _this._constructed = true; + return _this; + } + Object.defineProperty(Combinator2.prototype, "value", { + get: function() { + return this._value; + }, + set: function(value) { + if (this._constructed && this.raws) { + delete this.raws.value; + } + this._value = value; + }, + enumerable: false, + configurable: true + }); + return Combinator2; + })(node_1.default) + ); + exports.default = Combinator; } - /** - * Visit a LocalVariableReadNode node. - * - * @param {nodes.LocalVariableReadNode} node - */ - visitLocalVariableReadNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/nesting.js + var require_nesting = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/nesting.js"(exports) { + "use strict"; + var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { + var extendStatics = function(d2, b3) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b4) { + d3.__proto__ = b4; + } || function(d3, b4) { + for (var p2 in b4) if (Object.prototype.hasOwnProperty.call(b4, p2)) d3[p2] = b4[p2]; + }; + return extendStatics(d2, b3); + }; + return function(d2, b3) { + if (typeof b3 !== "function" && b3 !== null) + throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null"); + extendStatics(d2, b3); + function __() { + this.constructor = d2; + } + d2.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __()); + }; + })(); + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var node_1 = __importDefault(require_node2()); + var types_1 = require_types(); + var Nesting = ( + /** @class */ + (function(_super) { + __extends(Nesting2, _super); + function Nesting2(opts) { + var _this = _super.call(this, opts) || this; + _this.type = types_1.NESTING; + _this.value = "&"; + return _this; + } + return Nesting2; + })(node_1.default) + ); + exports.default = Nesting; } - /** - * Visit a LocalVariableTargetNode node. - * - * @param {nodes.LocalVariableTargetNode} node - */ - visitLocalVariableTargetNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/sortAscending.js + var require_sortAscending = __commonJS({ + "node_modules/postcss-selector-parser/dist/sortAscending.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = sortAscending; + function sortAscending(list2) { + return list2.sort(function(a, b3) { + return a - b3; + }); + } } - /** - * Visit a LocalVariableWriteNode node. - * - * @param {nodes.LocalVariableWriteNode} node - */ - visitLocalVariableWriteNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/tokenTypes.js + var require_tokenTypes = __commonJS({ + "node_modules/postcss-selector-parser/dist/tokenTypes.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.combinator = exports.word = exports.comment = exports.str = exports.tab = exports.newline = exports.feed = exports.cr = exports.backslash = exports.bang = exports.slash = exports.doubleQuote = exports.singleQuote = exports.space = exports.greaterThan = exports.pipe = exports.equals = exports.plus = exports.caret = exports.tilde = exports.dollar = exports.closeSquare = exports.openSquare = exports.closeParenthesis = exports.openParenthesis = exports.semicolon = exports.colon = exports.comma = exports.at = exports.asterisk = exports.ampersand = void 0; + exports.ampersand = 38; + exports.asterisk = 42; + exports.at = 64; + exports.comma = 44; + exports.colon = 58; + exports.semicolon = 59; + exports.openParenthesis = 40; + exports.closeParenthesis = 41; + exports.openSquare = 91; + exports.closeSquare = 93; + exports.dollar = 36; + exports.tilde = 126; + exports.caret = 94; + exports.plus = 43; + exports.equals = 61; + exports.pipe = 124; + exports.greaterThan = 62; + exports.space = 32; + exports.singleQuote = 39; + exports.doubleQuote = 34; + exports.slash = 47; + exports.bang = 33; + exports.backslash = 92; + exports.cr = 13; + exports.feed = 12; + exports.newline = 10; + exports.tab = 9; + exports.str = exports.singleQuote; + exports.comment = -1; + exports.word = -2; + exports.combinator = -3; } - /** - * Visit a MatchLastLineNode node. - * - * @param {nodes.MatchLastLineNode} node - */ - visitMatchLastLineNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/tokenize.js + var require_tokenize2 = __commonJS({ + "node_modules/postcss-selector-parser/dist/tokenize.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m2, k2, k22) { + if (k22 === void 0) k22 = k2; + var desc = Object.getOwnPropertyDescriptor(m2, k2); + if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m2[k2]; + } }; + } + Object.defineProperty(o, k22, desc); + }) : (function(o, m2, k2, k22) { + if (k22 === void 0) k22 = k2; + o[k22] = m2[k2]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v3) { + Object.defineProperty(o, "default", { enumerable: true, value: v3 }); + }) : function(o, v3) { + o["default"] = v3; + }); + var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() { + var ownKeys2 = function(o) { + ownKeys2 = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k2 in o2) if (Object.prototype.hasOwnProperty.call(o2, k2)) ar[ar.length] = k2; + return ar; + }; + return ownKeys2(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k2 = ownKeys2(mod), i2 = 0; i2 < k2.length; i2++) if (k2[i2] !== "default") __createBinding(result, mod, k2[i2]); + } + __setModuleDefault(result, mod); + return result; + }; + })(); + var _a2; + var _b; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.FIELDS = void 0; + exports.default = tokenize; + var t = __importStar(require_tokenTypes()); + var unescapable = (_a2 = {}, _a2[t.tab] = true, _a2[t.newline] = true, _a2[t.cr] = true, _a2[t.feed] = true, _a2); + var wordDelimiters = (_b = {}, _b[t.space] = true, _b[t.tab] = true, _b[t.newline] = true, _b[t.cr] = true, _b[t.feed] = true, _b[t.ampersand] = true, _b[t.asterisk] = true, _b[t.bang] = true, _b[t.comma] = true, _b[t.colon] = true, _b[t.semicolon] = true, _b[t.openParenthesis] = true, _b[t.closeParenthesis] = true, _b[t.openSquare] = true, _b[t.closeSquare] = true, _b[t.singleQuote] = true, _b[t.doubleQuote] = true, _b[t.plus] = true, _b[t.pipe] = true, _b[t.tilde] = true, _b[t.greaterThan] = true, _b[t.equals] = true, _b[t.dollar] = true, _b[t.caret] = true, _b[t.slash] = true, _b); + var hex = {}; + var hexChars = "0123456789abcdefABCDEF"; + for (i = 0; i < hexChars.length; i++) { + hex[hexChars.charCodeAt(i)] = true; + } + var i; + function consumeWord(css, start) { + var next = start; + var code; + do { + code = css.charCodeAt(next); + if (wordDelimiters[code]) { + return next - 1; + } else if (code === t.backslash) { + next = consumeEscape(css, next) + 1; + } else { + next++; + } + } while (next < css.length); + return next - 1; + } + function consumeEscape(css, start) { + var next = start; + var code = css.charCodeAt(next + 1); + if (unescapable[code]) { + } else if (hex[code]) { + var hexDigits = 0; + do { + next++; + hexDigits++; + code = css.charCodeAt(next + 1); + } while (hex[code] && hexDigits < 6); + if (hexDigits < 6 && code === t.space) { + next++; + } + } else { + next++; + } + return next; + } + exports.FIELDS = { + TYPE: 0, + START_LINE: 1, + START_COL: 2, + END_LINE: 3, + END_COL: 4, + START_POS: 5, + END_POS: 6 + }; + function tokenize(input) { + var tokens = []; + var css = input.css.valueOf(); + var length = css.length; + var offset = -1; + var line = 1; + var start = 0; + var end = 0; + var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType; + function unclosed(what, fix) { + if (input.safe) { + css += fix; + next = css.length - 1; + } else { + throw input.error("Unclosed " + what, line, start - offset, start); + } + } + while (start < length) { + code = css.charCodeAt(start); + if (code === t.newline) { + offset = start; + line += 1; + } + switch (code) { + case t.space: + case t.tab: + case t.newline: + case t.cr: + case t.feed: + next = start; + do { + next += 1; + code = css.charCodeAt(next); + if (code === t.newline) { + offset = next; + line += 1; + } + } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed); + tokenType = t.space; + endLine = line; + endColumn = next - offset - 1; + end = next; + break; + case t.plus: + case t.greaterThan: + case t.tilde: + case t.pipe: + next = start; + do { + next += 1; + code = css.charCodeAt(next); + } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe); + tokenType = t.combinator; + endLine = line; + endColumn = start - offset; + end = next; + break; + // Consume these characters as single tokens. + case t.asterisk: + case t.ampersand: + case t.bang: + case t.comma: + case t.equals: + case t.dollar: + case t.caret: + case t.openSquare: + case t.closeSquare: + case t.colon: + case t.semicolon: + case t.openParenthesis: + case t.closeParenthesis: + next = start; + tokenType = code; + endLine = line; + endColumn = start - offset; + end = next + 1; + break; + case t.singleQuote: + case t.doubleQuote: + quote = code === t.singleQuote ? "'" : '"'; + next = start; + do { + escaped = false; + next = css.indexOf(quote, next + 1); + if (next === -1) { + unclosed("quote", quote); + } + escapePos = next; + while (css.charCodeAt(escapePos - 1) === t.backslash) { + escapePos -= 1; + escaped = !escaped; + } + } while (escaped); + tokenType = t.str; + endLine = line; + endColumn = start - offset; + end = next + 1; + break; + default: + if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) { + next = css.indexOf("*/", start + 2) + 1; + if (next === 0) { + unclosed("comment", "*/"); + } + content = css.slice(start, next + 1); + lines = content.split("\n"); + last = lines.length - 1; + if (last > 0) { + nextLine = line + last; + nextOffset = next - lines[last].length; + } else { + nextLine = line; + nextOffset = offset; + } + tokenType = t.comment; + line = nextLine; + endLine = nextLine; + endColumn = next - nextOffset; + } else if (code === t.slash) { + next = start; + tokenType = code; + endLine = line; + endColumn = start - offset; + end = next + 1; + } else { + next = consumeWord(css, start); + tokenType = t.word; + endLine = line; + endColumn = next - offset; + } + end = next + 1; + break; + } + tokens.push([ + tokenType, + // [0] Token type + line, + // [1] Starting line + start - offset, + // [2] Starting column + endLine, + // [3] Ending line + endColumn, + // [4] Ending column + start, + // [5] Start position / Source index + end + // [6] End position + ]); + if (nextOffset) { + offset = nextOffset; + nextOffset = null; + } + start = end; + } + return tokens; + } } - /** - * Visit a MatchPredicateNode node. - * - * @param {nodes.MatchPredicateNode} node - */ - visitMatchPredicateNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a MatchRequiredNode node. - * - * @param {nodes.MatchRequiredNode} node - */ - visitMatchRequiredNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a MatchWriteNode node. - * - * @param {nodes.MatchWriteNode} node - */ - visitMatchWriteNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a MissingNode node. - * - * @param {nodes.MissingNode} node - */ - visitMissingNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a ModuleNode node. - * - * @param {nodes.ModuleNode} node - */ - visitModuleNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a MultiTargetNode node. - * - * @param {nodes.MultiTargetNode} node - */ - visitMultiTargetNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a MultiWriteNode node. - * - * @param {nodes.MultiWriteNode} node - */ - visitMultiWriteNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a NextNode node. - * - * @param {nodes.NextNode} node - */ - visitNextNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a NilNode node. - * - * @param {nodes.NilNode} node - */ - visitNilNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a NoKeywordsParameterNode node. - * - * @param {nodes.NoKeywordsParameterNode} node - */ - visitNoKeywordsParameterNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a NumberedParametersNode node. - * - * @param {nodes.NumberedParametersNode} node - */ - visitNumberedParametersNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a NumberedReferenceReadNode node. - * - * @param {nodes.NumberedReferenceReadNode} node - */ - visitNumberedReferenceReadNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a OptionalKeywordParameterNode node. - * - * @param {nodes.OptionalKeywordParameterNode} node - */ - visitOptionalKeywordParameterNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a OptionalParameterNode node. - * - * @param {nodes.OptionalParameterNode} node - */ - visitOptionalParameterNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a OrNode node. - * - * @param {nodes.OrNode} node - */ - visitOrNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a ParametersNode node. - * - * @param {nodes.ParametersNode} node - */ - visitParametersNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a ParenthesesNode node. - * - * @param {nodes.ParenthesesNode} node - */ - visitParenthesesNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a PinnedExpressionNode node. - * - * @param {nodes.PinnedExpressionNode} node - */ - visitPinnedExpressionNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a PinnedVariableNode node. - * - * @param {nodes.PinnedVariableNode} node - */ - visitPinnedVariableNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a PostExecutionNode node. - * - * @param {nodes.PostExecutionNode} node - */ - visitPostExecutionNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a PreExecutionNode node. - * - * @param {nodes.PreExecutionNode} node - */ - visitPreExecutionNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a ProgramNode node. - * - * @param {nodes.ProgramNode} node - */ - visitProgramNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a RangeNode node. - * - * @param {nodes.RangeNode} node - */ - visitRangeNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a RationalNode node. - * - * @param {nodes.RationalNode} node - */ - visitRationalNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a RedoNode node. - * - * @param {nodes.RedoNode} node - */ - visitRedoNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a RegularExpressionNode node. - * - * @param {nodes.RegularExpressionNode} node - */ - visitRegularExpressionNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a RequiredKeywordParameterNode node. - * - * @param {nodes.RequiredKeywordParameterNode} node - */ - visitRequiredKeywordParameterNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a RequiredParameterNode node. - * - * @param {nodes.RequiredParameterNode} node - */ - visitRequiredParameterNode(node) { - this.visitChildNodes(node); - } - /** - * Visit a RescueModifierNode node. - * - * @param {nodes.RescueModifierNode} node - */ - visitRescueModifierNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/parser.js + var require_parser2 = __commonJS({ + "node_modules/postcss-selector-parser/dist/parser.js"(exports) { + "use strict"; + var __assign = exports && exports.__assign || function() { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2)) + t[p2] = s[p2]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m2, k2, k22) { + if (k22 === void 0) k22 = k2; + var desc = Object.getOwnPropertyDescriptor(m2, k2); + if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m2[k2]; + } }; + } + Object.defineProperty(o, k22, desc); + }) : (function(o, m2, k2, k22) { + if (k22 === void 0) k22 = k2; + o[k22] = m2[k2]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v3) { + Object.defineProperty(o, "default", { enumerable: true, value: v3 }); + }) : function(o, v3) { + o["default"] = v3; + }); + var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() { + var ownKeys2 = function(o) { + ownKeys2 = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k2 in o2) if (Object.prototype.hasOwnProperty.call(o2, k2)) ar[ar.length] = k2; + return ar; + }; + return ownKeys2(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k2 = ownKeys2(mod), i = 0; i < k2.length; i++) if (k2[i] !== "default") __createBinding(result, mod, k2[i]); + } + __setModuleDefault(result, mod); + return result; + }; + })(); + var __read = exports && exports.__read || function(o, n) { + var m2 = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m2) return o; + var i = m2.call(o), r2, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r2 = i.next()).done) ar.push(r2.value); + } catch (error2) { + e = { error: error2 }; + } finally { + try { + if (r2 && !r2.done && (m2 = i["return"])) m2.call(i); + } finally { + if (e) throw e.error; + } + } + return ar; + }; + var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + }; + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + var _a2; + var _b; + Object.defineProperty(exports, "__esModule", { value: true }); + var root_1 = __importDefault(require_root2()); + var selector_1 = __importDefault(require_selector()); + var className_1 = __importDefault(require_className()); + var comment_1 = __importDefault(require_comment2()); + var id_1 = __importDefault(require_id()); + var tag_1 = __importDefault(require_tag()); + var string_1 = __importDefault(require_string()); + var pseudo_1 = __importDefault(require_pseudo()); + var attribute_1 = __importStar(require_attribute()); + var universal_1 = __importDefault(require_universal()); + var combinator_1 = __importDefault(require_combinator()); + var nesting_1 = __importDefault(require_nesting()); + var sortAscending_1 = __importDefault(require_sortAscending()); + var tokenize_1 = __importStar(require_tokenize2()); + var tokens = __importStar(require_tokenTypes()); + var types = __importStar(require_types()); + var util_1 = require_util2(); + var WHITESPACE_TOKENS = (_a2 = {}, _a2[tokens.space] = true, _a2[tokens.cr] = true, _a2[tokens.feed] = true, _a2[tokens.newline] = true, _a2[tokens.tab] = true, _a2); + var WHITESPACE_EQUIV_TOKENS = __assign(__assign({}, WHITESPACE_TOKENS), (_b = {}, _b[tokens.comment] = true, _b)); + function tokenStart(token2) { + return { + line: token2[tokenize_1.FIELDS.START_LINE], + column: token2[tokenize_1.FIELDS.START_COL] + }; + } + function tokenEnd(token2) { + return { + line: token2[tokenize_1.FIELDS.END_LINE], + column: token2[tokenize_1.FIELDS.END_COL] + }; + } + function getSource(startLine, startColumn, endLine, endColumn) { + return { + start: { + line: startLine, + column: startColumn + }, + end: { + line: endLine, + column: endColumn + } + }; + } + function getTokenSource(token2) { + return getSource(token2[tokenize_1.FIELDS.START_LINE], token2[tokenize_1.FIELDS.START_COL], token2[tokenize_1.FIELDS.END_LINE], token2[tokenize_1.FIELDS.END_COL]); + } + function getTokenSourceSpan(startToken, endToken) { + if (!startToken) { + return void 0; + } + return getSource(startToken[tokenize_1.FIELDS.START_LINE], startToken[tokenize_1.FIELDS.START_COL], endToken[tokenize_1.FIELDS.END_LINE], endToken[tokenize_1.FIELDS.END_COL]); + } + function unescapeProp(node2, prop) { + var value = node2[prop]; + if (typeof value !== "string") { + return; + } + if (value.indexOf("\\") !== -1) { + (0, util_1.ensureObject)(node2, "raws"); + node2[prop] = (0, util_1.unesc)(value); + if (node2.raws[prop] === void 0) { + node2.raws[prop] = value; + } + } + return node2; + } + function indexesOf(array2, item) { + var i = -1; + var indexes = []; + while ((i = array2.indexOf(item, i + 1)) !== -1) { + indexes.push(i); + } + return indexes; + } + function uniqs() { + return Array.from(new Set(Array.prototype.concat.apply([], arguments))); + } + var Parser = ( + /** @class */ + (function() { + function Parser2(rule2, options) { + if (options === void 0) { + options = {}; + } + this.rule = rule2; + this.options = Object.assign({ lossy: false, safe: false }, options); + this.position = 0; + this.nestingDepth = 0; + this.maxNestingDepth = (0, util_1.resolveMaxNestingDepth)(this.options.maxNestingDepth); + this.css = typeof this.rule === "string" ? this.rule : this.rule.selector; + this.tokens = (0, tokenize_1.default)({ + css: this.css, + error: this._errorGenerator(), + safe: this.options.safe + }); + var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]); + this.root = new root_1.default({ source: rootSource }); + this.root.errorGenerator = this._errorGenerator(); + var selector = new selector_1.default({ + source: { start: { line: 1, column: 1 } }, + sourceIndex: 0 + }); + this.root.append(selector); + this.current = selector; + this.loop(); + } + Parser2.prototype._errorGenerator = function() { + var _this = this; + return function(message, errorOptions) { + if (typeof _this.rule === "string") { + return new Error(message); + } + return _this.rule.error(message, errorOptions); + }; + }; + Parser2.prototype.namespaceSeparatorFollows = function(attr, pos) { + var next = pos; + while (attr[next] && attr[next][tokenize_1.FIELDS.TYPE] === tokens.space) { + next++; + } + if (!attr[next] || this.content(attr[next]) !== "|") { + return false; + } + next++; + if (attr[next] && attr[next][tokenize_1.FIELDS.TYPE] === tokens.equals) { + return false; + } + while (attr[next] && attr[next][tokenize_1.FIELDS.TYPE] === tokens.space) { + next++; + } + return Boolean(attr[next]); + }; + Parser2.prototype.attribute = function() { + var attr = []; + var startingToken = this.currToken; + this.position++; + while (this.position < this.tokens.length && this.currToken[tokenize_1.FIELDS.TYPE] !== tokens.closeSquare) { + attr.push(this.currToken); + this.position++; + } + if (!this.currToken) { + return this.expected("closing square bracket", startingToken[tokenize_1.FIELDS.START_POS]); + } + if (this.currToken[tokenize_1.FIELDS.TYPE] !== tokens.closeSquare) { + return this.expected("closing square bracket", this.currToken[tokenize_1.FIELDS.START_POS]); + } + var len = attr.length; + var node2 = { + source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]), + sourceIndex: startingToken[tokenize_1.FIELDS.START_POS] + }; + if (len === 1 && !~[tokens.word].indexOf(attr[0][tokenize_1.FIELDS.TYPE])) { + return this.expected("attribute", attr[0][tokenize_1.FIELDS.START_POS]); + } + var pos = 0; + var spaceBefore = ""; + var commentBefore = ""; + var lastAdded = null; + var spaceAfterMeaningfulToken = false; + var namespaceSpaces = null; + while (pos < len) { + var token2 = attr[pos]; + var content = this.content(token2); + var next = attr[pos + 1]; + switch (token2[tokenize_1.FIELDS.TYPE]) { + case tokens.space: + spaceAfterMeaningfulToken = true; + if (this.options.lossy) { + break; + } + if (namespaceSpaces !== null) { + namespaceSpaces += content; + break; + } + if (lastAdded === "namespace") { + (0, util_1.ensureObject)(node2, "raws"); + node2.raws.namespace = (node2.raws.namespace || node2.namespace) + content; + break; + } + if (lastAdded) { + (0, util_1.ensureObject)(node2, "spaces", lastAdded); + var prevContent = node2.spaces[lastAdded].after || ""; + node2.spaces[lastAdded].after = prevContent + content; + var existingComment = (0, util_1.getProp)(node2, "raws", "spaces", lastAdded, "after") || null; + if (existingComment) { + node2.raws.spaces[lastAdded].after = existingComment + content; + } + } else { + spaceBefore = spaceBefore + content; + commentBefore = commentBefore + content; + } + break; + case tokens.asterisk: + if (next[tokenize_1.FIELDS.TYPE] === tokens.equals) { + node2.operator = content; + lastAdded = "operator"; + } else if ((!node2.namespace || lastAdded === "namespace" && !spaceAfterMeaningfulToken) && next) { + node2.namespace = (node2.namespace || "") + content; + var rawValue = (0, util_1.getProp)(node2, "raws", "namespace") || null; + if (rawValue) { + node2.raws.namespace += content; + } + if (spaceBefore) { + (0, util_1.ensureObject)(node2, "spaces", "attribute"); + node2.spaces.attribute.before = spaceBefore; + spaceBefore = ""; + } + if (commentBefore) { + (0, util_1.ensureObject)(node2, "raws", "spaces", "attribute"); + node2.raws.spaces.attribute.before = commentBefore; + commentBefore = ""; + } + lastAdded = "namespace"; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.dollar: + if (lastAdded === "value") { + var oldRawValue = (0, util_1.getProp)(node2, "raws", "value"); + node2.value += "$"; + if (oldRawValue) { + node2.raws.value = oldRawValue + "$"; + } + break; + } + // Falls through + case tokens.caret: + if (next[tokenize_1.FIELDS.TYPE] === tokens.equals) { + node2.operator = content; + lastAdded = "operator"; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.combinator: + if (content === "~" && next[tokenize_1.FIELDS.TYPE] === tokens.equals) { + node2.operator = content; + lastAdded = "operator"; + } + if (content !== "|") { + spaceAfterMeaningfulToken = false; + break; + } + if (next[tokenize_1.FIELDS.TYPE] === tokens.equals) { + node2.operator = content; + lastAdded = "operator"; + } else if (!node2.operator) { + if (!node2.namespace && !node2.attribute) { + node2.namespace = true; + } + namespaceSpaces = ""; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.word: + if (this.namespaceSeparatorFollows(attr, pos + 1) && !node2.operator && !node2.namespace) { + node2.namespace = content; + lastAdded = "namespace"; + } else if (!node2.attribute || lastAdded === "attribute" && !spaceAfterMeaningfulToken) { + if (spaceBefore) { + (0, util_1.ensureObject)(node2, "spaces", "attribute"); + node2.spaces.attribute.before = spaceBefore; + spaceBefore = ""; + } + if (commentBefore) { + (0, util_1.ensureObject)(node2, "raws", "spaces", "attribute"); + node2.raws.spaces.attribute.before = commentBefore; + commentBefore = ""; + } + if (namespaceSpaces) { + (0, util_1.ensureObject)(node2, "raws"); + node2.raws.attribute = namespaceSpaces + (node2.raws.attribute || node2.attribute || ""); + } + namespaceSpaces = null; + node2.attribute = (node2.attribute || "") + content; + var rawValue = (0, util_1.getProp)(node2, "raws", "attribute") || null; + if (rawValue) { + node2.raws.attribute += content; + } + lastAdded = "attribute"; + } else if (!node2.value && node2.value !== "" || lastAdded === "value" && !(spaceAfterMeaningfulToken || node2.quoteMark)) { + var unescaped_1 = (0, util_1.unesc)(content); + var oldRawValue = (0, util_1.getProp)(node2, "raws", "value") || ""; + var oldValue = node2.value || ""; + node2.value = oldValue + unescaped_1; + node2.quoteMark = null; + if (unescaped_1 !== content || oldRawValue) { + (0, util_1.ensureObject)(node2, "raws"); + node2.raws.value = (oldRawValue || oldValue) + content; + } + lastAdded = "value"; + } else { + var insensitive = content === "i" || content === "I"; + if ((node2.value || node2.value === "") && (node2.quoteMark || spaceAfterMeaningfulToken)) { + node2.insensitive = insensitive; + if (!insensitive || content === "I") { + (0, util_1.ensureObject)(node2, "raws"); + node2.raws.insensitiveFlag = content; + } + lastAdded = "insensitive"; + if (spaceBefore) { + (0, util_1.ensureObject)(node2, "spaces", "insensitive"); + node2.spaces.insensitive.before = spaceBefore; + spaceBefore = ""; + } + if (commentBefore) { + (0, util_1.ensureObject)(node2, "raws", "spaces", "insensitive"); + node2.raws.spaces.insensitive.before = commentBefore; + commentBefore = ""; + } + } else if (node2.value || node2.value === "") { + lastAdded = "value"; + node2.value += content; + if (node2.raws.value) { + node2.raws.value += content; + } + } + } + spaceAfterMeaningfulToken = false; + break; + case tokens.str: + if (!node2.attribute || !node2.operator) { + return this.error("Expected an attribute followed by an operator preceding the string.", { + index: token2[tokenize_1.FIELDS.START_POS] + }); + } + var _a3 = (0, attribute_1.unescapeValue)(content), unescaped = _a3.unescaped, quoteMark = _a3.quoteMark; + node2.value = unescaped; + node2.quoteMark = quoteMark; + lastAdded = "value"; + (0, util_1.ensureObject)(node2, "raws"); + node2.raws.value = content; + spaceAfterMeaningfulToken = false; + break; + case tokens.equals: + if (!node2.attribute) { + return this.expected("attribute", token2[tokenize_1.FIELDS.START_POS], content); + } + if (node2.value) { + return this.error('Unexpected "=" found; an operator was already defined.', { + index: token2[tokenize_1.FIELDS.START_POS] + }); + } + node2.operator = node2.operator ? node2.operator + content : content; + lastAdded = "operator"; + spaceAfterMeaningfulToken = false; + break; + case tokens.comment: + if (lastAdded) { + if (spaceAfterMeaningfulToken || next && next[tokenize_1.FIELDS.TYPE] === tokens.space || lastAdded === "insensitive") { + var lastComment = (0, util_1.getProp)(node2, "spaces", lastAdded, "after") || ""; + var rawLastComment = (0, util_1.getProp)(node2, "raws", "spaces", lastAdded, "after") || lastComment; + (0, util_1.ensureObject)(node2, "raws", "spaces", lastAdded); + node2.raws.spaces[lastAdded].after = rawLastComment + content; + } else { + var lastValue = node2[lastAdded] || ""; + var rawLastValue = (0, util_1.getProp)(node2, "raws", lastAdded) || lastValue; + (0, util_1.ensureObject)(node2, "raws"); + node2.raws[lastAdded] = rawLastValue + content; + } + } else { + commentBefore = commentBefore + content; + } + break; + default: + return this.error('Unexpected "'.concat(content, '" found.'), { index: token2[tokenize_1.FIELDS.START_POS] }); + } + pos++; + } + unescapeProp(node2, "attribute"); + unescapeProp(node2, "namespace"); + this.newNode(new attribute_1.default(node2)); + this.position++; + }; + Parser2.prototype.parseWhitespaceEquivalentTokens = function(stopPosition) { + if (stopPosition < 0) { + stopPosition = this.tokens.length; + } + var startPosition = this.position; + var nodes = []; + var space = ""; + var lastComment = void 0; + do { + if (WHITESPACE_TOKENS[this.currToken[tokenize_1.FIELDS.TYPE]]) { + if (!this.options.lossy) { + space += this.content(); + } + } else if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.comment) { + var spaces = {}; + if (space) { + spaces.before = space; + space = ""; + } + lastComment = new comment_1.default({ + value: this.content(), + source: getTokenSource(this.currToken), + sourceIndex: this.currToken[tokenize_1.FIELDS.START_POS], + spaces + }); + nodes.push(lastComment); + } + } while (++this.position < stopPosition); + if (space) { + if (lastComment) { + lastComment.spaces.after = space; + } else if (!this.options.lossy) { + var firstToken = this.tokens[startPosition]; + var lastToken = this.tokens[this.position - 1]; + nodes.push(new string_1.default({ + value: "", + source: getSource(firstToken[tokenize_1.FIELDS.START_LINE], firstToken[tokenize_1.FIELDS.START_COL], lastToken[tokenize_1.FIELDS.END_LINE], lastToken[tokenize_1.FIELDS.END_COL]), + sourceIndex: firstToken[tokenize_1.FIELDS.START_POS], + spaces: { before: space, after: "" } + })); + } + } + return nodes; + }; + Parser2.prototype.convertWhitespaceNodesToSpace = function(nodes, requiredSpace) { + var _this = this; + if (requiredSpace === void 0) { + requiredSpace = false; + } + var space = ""; + var rawSpace = ""; + nodes.forEach(function(n) { + var spaceBefore = _this.lossySpace(n.spaces.before, requiredSpace); + var rawSpaceBefore = _this.lossySpace(n.rawSpaceBefore, requiredSpace); + space += spaceBefore + _this.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0); + rawSpace += spaceBefore + n.value + _this.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0); + }); + if (rawSpace === space) { + rawSpace = void 0; + } + var result = { space, rawSpace }; + return result; + }; + Parser2.prototype.isNamedCombinator = function(position) { + if (position === void 0) { + position = this.position; + } + return this.tokens[position + 0] && this.tokens[position + 0][tokenize_1.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][tokenize_1.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][tokenize_1.FIELDS.TYPE] === tokens.slash; + }; + Parser2.prototype.namedCombinator = function() { + if (this.isNamedCombinator()) { + var nameRaw = this.content(this.tokens[this.position + 1]); + var name2 = (0, util_1.unesc)(nameRaw).toLowerCase(); + var raws = {}; + if (name2 !== nameRaw) { + raws.value = "/".concat(nameRaw, "/"); + } + var node2 = new combinator_1.default({ + value: "/".concat(name2, "/"), + source: getSource(this.currToken[tokenize_1.FIELDS.START_LINE], this.currToken[tokenize_1.FIELDS.START_COL], this.tokens[this.position + 2][tokenize_1.FIELDS.END_LINE], this.tokens[this.position + 2][tokenize_1.FIELDS.END_COL]), + sourceIndex: this.currToken[tokenize_1.FIELDS.START_POS], + raws + }); + this.position = this.position + 3; + return node2; + } else { + this.unexpected(); + } + }; + Parser2.prototype.combinator = function() { + var _this = this; + if (this.content() === "|") { + return this.namespace(); + } + var nextSigTokenPos = this.locateNextMeaningfulToken(this.position); + if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][tokenize_1.FIELDS.TYPE] === tokens.comma || this.tokens[nextSigTokenPos][tokenize_1.FIELDS.TYPE] === tokens.closeParenthesis) { + var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); + if (nodes.length > 0) { + var last = this.current.last; + if (last) { + var _a3 = this.convertWhitespaceNodesToSpace(nodes), space = _a3.space, rawSpace = _a3.rawSpace; + if (rawSpace !== void 0) { + last.rawSpaceAfter += rawSpace; + } + last.spaces.after += space; + } else { + nodes.forEach(function(n) { + return _this.newNode(n); + }); + } + } + return; + } + var firstToken = this.currToken; + var spaceOrDescendantSelectorNodes = void 0; + if (nextSigTokenPos > this.position) { + spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); + } + var node2; + if (this.isNamedCombinator()) { + node2 = this.namedCombinator(); + } else if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.combinator) { + node2 = new combinator_1.default({ + value: this.content(), + source: getTokenSource(this.currToken), + sourceIndex: this.currToken[tokenize_1.FIELDS.START_POS] + }); + this.position++; + } else if (WHITESPACE_TOKENS[this.currToken[tokenize_1.FIELDS.TYPE]]) { + } else if (!spaceOrDescendantSelectorNodes) { + this.unexpected(); + } + if (node2) { + if (spaceOrDescendantSelectorNodes) { + var _b2 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes), space = _b2.space, rawSpace = _b2.rawSpace; + node2.spaces.before = space; + node2.rawSpaceBefore = rawSpace; + } + } else { + var _c = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true), space = _c.space, rawSpace = _c.rawSpace; + if (!rawSpace) { + rawSpace = space; + } + var spaces = {}; + var raws = { spaces: {} }; + if (space.endsWith(" ") && rawSpace.endsWith(" ")) { + spaces.before = space.slice(0, space.length - 1); + raws.spaces.before = rawSpace.slice(0, rawSpace.length - 1); + } else if (space[0] === " " && rawSpace[0] === " ") { + spaces.after = space.slice(1); + raws.spaces.after = rawSpace.slice(1); + } else { + raws.value = rawSpace; + } + node2 = new combinator_1.default({ + value: " ", + source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]), + sourceIndex: firstToken[tokenize_1.FIELDS.START_POS], + spaces, + raws + }); + } + if (this.currToken && this.currToken[tokenize_1.FIELDS.TYPE] === tokens.space) { + node2.spaces.after = this.optionalSpace(this.content()); + this.position++; + } + return this.newNode(node2); + }; + Parser2.prototype.flushPendingSpaces = function() { + if (!this.spaces) { + return; + } + var last = this.current.last; + if (last) { + last.spaces.after += this.spaces; + this.spaces = ""; + return; + } + var token2 = this.currToken || this.prevToken; + this.newNode(new string_1.default({ + value: "", + source: token2 ? getTokenSource(token2) : void 0, + sourceIndex: token2 ? token2[tokenize_1.FIELDS.START_POS] : 0 + })); + }; + Parser2.prototype.comma = function() { + this.flushPendingSpaces(); + if (this.position === this.tokens.length - 1) { + this.root.trailingComma = true; + this.position++; + return; + } + this.current._inferEndPosition(); + var selector = new selector_1.default({ + source: { + start: tokenStart(this.tokens[this.position + 1]) + }, + sourceIndex: this.tokens[this.position + 1][tokenize_1.FIELDS.START_POS] + }); + this.current.parent.append(selector); + this.current = selector; + this.position++; + }; + Parser2.prototype.comment = function() { + var current = this.currToken; + this.newNode(new comment_1.default({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[tokenize_1.FIELDS.START_POS] + })); + this.position++; + }; + Parser2.prototype.error = function(message, opts) { + throw this.root.error(message, opts); + }; + Parser2.prototype.missingBackslash = function() { + return this.error("Expected a backslash preceding the semicolon.", { + index: this.currToken[tokenize_1.FIELDS.START_POS] + }); + }; + Parser2.prototype.missingParenthesis = function() { + return this.expected("opening parenthesis", this.currToken[tokenize_1.FIELDS.START_POS]); + }; + Parser2.prototype.missingSquareBracket = function() { + return this.expected("opening square bracket", this.currToken[tokenize_1.FIELDS.START_POS]); + }; + Parser2.prototype.unexpected = function() { + return this.error("Unexpected '".concat(this.content(), "'. Escaping special characters with \\ may help."), this.currToken[tokenize_1.FIELDS.START_POS]); + }; + Parser2.prototype.unexpectedPipe = function() { + return this.error("Unexpected '|'.", this.currToken[tokenize_1.FIELDS.START_POS]); + }; + Parser2.prototype.namespace = function() { + var prev = this.prevToken; + var before = prev && (prev[tokenize_1.FIELDS.TYPE] === tokens.word || prev[tokenize_1.FIELDS.TYPE] === tokens.asterisk || prev[tokenize_1.FIELDS.TYPE] === tokens.ampersand) ? this.content(prev) : true; + if (!this.nextToken) { + return this.unexpectedPipe(); + } + if (this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.word) { + this.position++; + return this.word(before); + } else if (this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.asterisk) { + this.position++; + return this.universal(before); + } + this.unexpectedPipe(); + }; + Parser2.prototype.nesting = function() { + if (this.nextToken) { + var nextContent = this.content(this.nextToken); + if (nextContent === "|") { + this.position++; + return; + } + } + var current = this.currToken; + this.newNode(new nesting_1.default({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[tokenize_1.FIELDS.START_POS] + })); + this.position++; + }; + Parser2.prototype.parentheses = function() { + var last = this.current.last; + var unbalanced = 1; + var openingToken = this.currToken; + this.position++; + if (last && last.type === types.PSEUDO) { + var selector = new selector_1.default({ + source: { start: tokenStart(this.tokens[this.position]) }, + sourceIndex: this.tokens[this.position][tokenize_1.FIELDS.START_POS] + }); + var cache = this.current; + last.append(selector); + this.current = selector; + this.nestingDepth++; + try { + if (this.nestingDepth > this.maxNestingDepth) { + this.error("Cannot parse selector: nesting depth exceeds the maximum of ".concat(this.maxNestingDepth, "."), { index: this.currToken[tokenize_1.FIELDS.START_POS] }); + } + while (this.position < this.tokens.length && unbalanced) { + if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.openParenthesis) { + unbalanced++; + } + if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.closeParenthesis) { + unbalanced--; + } + if (unbalanced) { + this.parse(); + } else { + this.flushPendingSpaces(); + this.current.source.end = tokenEnd(this.currToken); + this.current.parent.source.end = tokenEnd(this.currToken); + this.position++; + } + } + } finally { + this.nestingDepth--; + } + this.current = cache; + } else { + var parenStart = this.currToken; + var parenValue = "("; + var parenEnd = void 0; + while (this.position < this.tokens.length && unbalanced) { + if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.openParenthesis) { + unbalanced++; + } + if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.closeParenthesis) { + unbalanced--; + } + parenEnd = this.currToken; + parenValue += this.parseParenthesisToken(this.currToken); + this.position++; + } + if (last) { + last.appendToPropertyAndEscape("value", parenValue, parenValue); + } else { + this.newNode(new string_1.default({ + value: parenValue, + source: getSource(parenStart[tokenize_1.FIELDS.START_LINE], parenStart[tokenize_1.FIELDS.START_COL], parenEnd[tokenize_1.FIELDS.END_LINE], parenEnd[tokenize_1.FIELDS.END_COL]), + sourceIndex: parenStart[tokenize_1.FIELDS.START_POS] + })); + } + } + if (unbalanced) { + return this.expected("closing parenthesis", (this.currToken || openingToken)[tokenize_1.FIELDS.START_POS]); + } + }; + Parser2.prototype.pseudo = function() { + var _this = this; + var pseudoStr = ""; + var startingToken = this.currToken; + while (this.currToken && this.currToken[tokenize_1.FIELDS.TYPE] === tokens.colon) { + pseudoStr += this.content(); + this.position++; + } + if (!this.currToken) { + return this.expected(["pseudo-class", "pseudo-element"], this.position - 1); + } + if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.word) { + this.splitWord(false, function(first, length) { + pseudoStr += first; + _this.newNode(new pseudo_1.default({ + value: pseudoStr, + source: getTokenSourceSpan(startingToken, _this.currToken), + sourceIndex: startingToken[tokenize_1.FIELDS.START_POS] + })); + if (length > 1 && _this.nextToken && _this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.openParenthesis) { + _this.error("Misplaced parenthesis.", { + index: _this.nextToken[tokenize_1.FIELDS.START_POS] + }); + } + }); + } else { + return this.expected(["pseudo-class", "pseudo-element"], this.currToken[tokenize_1.FIELDS.START_POS]); + } + }; + Parser2.prototype.space = function() { + var content = this.content(); + if (this.position === 0 || this.prevToken[tokenize_1.FIELDS.TYPE] === tokens.comma || this.prevToken[tokenize_1.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function(node2) { + return node2.type === "comment"; + })) { + this.spaces = this.optionalSpace(content); + this.position++; + } else if (this.position === this.tokens.length - 1 || this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.comma || this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.closeParenthesis) { + this.current.last.spaces.after = this.optionalSpace(content); + this.position++; + } else { + this.combinator(); + } + }; + Parser2.prototype.string = function() { + var current = this.currToken; + this.newNode(new string_1.default({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[tokenize_1.FIELDS.START_POS] + })); + this.position++; + }; + Parser2.prototype.universal = function(namespace) { + var nextToken = this.nextToken; + if (nextToken && this.content(nextToken) === "|") { + this.position++; + return this.namespace(); + } + var current = this.currToken; + this.newNode(new universal_1.default({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[tokenize_1.FIELDS.START_POS] + }), namespace); + this.position++; + }; + Parser2.prototype.splitWord = function(namespace, firstCallback) { + var _this = this; + var nextToken = this.nextToken; + var word = this.content(); + while (nextToken && ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[tokenize_1.FIELDS.TYPE])) { + this.position++; + var current = this.content(); + word += current; + if (current.lastIndexOf("\\") === current.length - 1) { + var next = this.nextToken; + if (next && next[tokenize_1.FIELDS.TYPE] === tokens.space) { + word += this.requiredSpace(this.content(next)); + this.position++; + } + } + nextToken = this.nextToken; + } + var hasClass = indexesOf(word, ".").filter(function(i) { + var escapedDot = word[i - 1] === "\\"; + var isKeyframesPercent = /^\d+\.\d+%$/.test(word); + return !escapedDot && !isKeyframesPercent; + }); + var hasId = indexesOf(word, "#").filter(function(i) { + return word[i - 1] !== "\\"; + }); + var interpolations = indexesOf(word, "#{"); + if (interpolations.length) { + var interpolationIndexes_1 = new Set(interpolations); + hasId = hasId.filter(function(hashIndex) { + return !interpolationIndexes_1.has(hashIndex); + }); + } + var classIndexes = new Set(hasClass); + var idIndexes = new Set(hasId); + var indices = (0, sortAscending_1.default)(uniqs(__spreadArray(__spreadArray([0], __read(hasClass), false), __read(hasId), false))); + indices.forEach(function(ind, i) { + var index = indices[i + 1] || word.length; + var value = word.slice(ind, index); + if (i === 0 && firstCallback) { + return firstCallback.call(_this, value, indices.length); + } + var node2; + var current2 = _this.currToken; + var sourceIndex = current2[tokenize_1.FIELDS.START_POS] + indices[i]; + var source = getSource(current2[1], current2[2] + ind, current2[3], current2[2] + (index - 1)); + if (classIndexes.has(ind)) { + var classNameOpts = { + value: value.slice(1), + source, + sourceIndex + }; + node2 = new className_1.default(unescapeProp(classNameOpts, "value")); + } else if (idIndexes.has(ind)) { + var idOpts = { + value: value.slice(1), + source, + sourceIndex + }; + node2 = new id_1.default(unescapeProp(idOpts, "value")); + } else { + var tagOpts = { + value, + source, + sourceIndex + }; + unescapeProp(tagOpts, "value"); + node2 = new tag_1.default(tagOpts); + } + _this.newNode(node2, namespace); + namespace = null; + }); + this.position++; + }; + Parser2.prototype.word = function(namespace) { + var nextToken = this.nextToken; + if (nextToken && this.content(nextToken) === "|") { + this.position++; + return this.namespace(); + } + return this.splitWord(namespace); + }; + Parser2.prototype.loop = function() { + while (this.position < this.tokens.length) { + this.parse(true); + } + this.flushPendingSpaces(); + this.current._inferEndPosition(); + return this.root; + }; + Parser2.prototype.parse = function(throwOnParenthesis) { + switch (this.currToken[tokenize_1.FIELDS.TYPE]) { + case tokens.space: + this.space(); + break; + case tokens.comment: + this.comment(); + break; + case tokens.openParenthesis: + this.parentheses(); + break; + case tokens.closeParenthesis: + if (throwOnParenthesis) { + this.missingParenthesis(); + } + break; + case tokens.openSquare: + this.attribute(); + break; + case tokens.dollar: + case tokens.caret: + case tokens.equals: + case tokens.word: + this.word(); + break; + case tokens.colon: + this.pseudo(); + break; + case tokens.comma: + this.comma(); + break; + case tokens.asterisk: + this.universal(); + break; + case tokens.ampersand: + this.nesting(); + break; + case tokens.slash: + case tokens.combinator: + this.combinator(); + break; + case tokens.str: + this.string(); + break; + // These cases throw; no break needed. + case tokens.closeSquare: + this.missingSquareBracket(); + case tokens.semicolon: + this.missingBackslash(); + default: + this.unexpected(); + } + }; + Parser2.prototype.expected = function(description, index, found) { + if (Array.isArray(description)) { + var last = description.pop(); + description = "".concat(description.join(", "), " or ").concat(last); + } + var an = /^[aeiou]/.test(description[0]) ? "an" : "a"; + if (!found) { + return this.error("Expected ".concat(an, " ").concat(description, "."), { index }); + } + return this.error("Expected ".concat(an, " ").concat(description, ', found "').concat(found, '" instead.'), { index }); + }; + Parser2.prototype.requiredSpace = function(space) { + return this.options.lossy ? " " : space; + }; + Parser2.prototype.optionalSpace = function(space) { + return this.options.lossy ? "" : space; + }; + Parser2.prototype.lossySpace = function(space, required2) { + if (this.options.lossy) { + return required2 ? " " : ""; + } else { + return space; + } + }; + Parser2.prototype.parseParenthesisToken = function(token2) { + var content = this.content(token2); + if (token2[tokenize_1.FIELDS.TYPE] === tokens.space) { + return this.requiredSpace(content); + } else { + return content; + } + }; + Parser2.prototype.newNode = function(node2, namespace) { + if (namespace) { + if (/^ +$/.test(namespace)) { + if (!this.options.lossy) { + this.spaces = (this.spaces || "") + namespace; + } + namespace = true; + } + node2.namespace = namespace; + unescapeProp(node2, "namespace"); + } + if (this.spaces) { + node2.spaces.before = this.spaces; + this.spaces = ""; + } + return this.current.append(node2); + }; + Parser2.prototype.content = function(token2) { + if (token2 === void 0) { + token2 = this.currToken; + } + return this.css.slice(token2[tokenize_1.FIELDS.START_POS], token2[tokenize_1.FIELDS.END_POS]); + }; + Object.defineProperty(Parser2.prototype, "currToken", { + get: function() { + return this.tokens[this.position]; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Parser2.prototype, "nextToken", { + get: function() { + return this.tokens[this.position + 1]; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Parser2.prototype, "prevToken", { + get: function() { + return this.tokens[this.position - 1]; + }, + enumerable: false, + configurable: true + }); + Parser2.prototype.locateNextMeaningfulToken = function(startPosition) { + if (startPosition === void 0) { + startPosition = this.position + 1; + } + var searchPosition = startPosition; + while (searchPosition < this.tokens.length) { + if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][tokenize_1.FIELDS.TYPE]]) { + searchPosition++; + continue; + } else { + return searchPosition; + } + } + return -1; + }; + return Parser2; + })() + ); + exports.default = Parser; } - /** - * Visit a RescueNode node. - * - * @param {nodes.RescueNode} node - */ - visitRescueNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/processor.js + var require_processor2 = __commonJS({ + "node_modules/postcss-selector-parser/dist/processor.js"(exports) { + "use strict"; + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var parser_1 = __importDefault(require_parser2()); + var Processor2 = ( + /** @class */ + (function() { + function Processor3(func, options) { + this.func = func || function noop() { + }; + this.funcRes = null; + this.options = options; + } + Processor3.prototype._shouldUpdateSelector = function(rule2, options) { + if (options === void 0) { + options = {}; + } + var merged = Object.assign({}, this.options, options); + if (merged.updateSelector === false) { + return false; + } else { + return typeof rule2 !== "string"; + } + }; + Processor3.prototype._isLossy = function(options) { + if (options === void 0) { + options = {}; + } + var merged = Object.assign({}, this.options, options); + if (merged.lossless === false) { + return true; + } else { + return false; + } + }; + Processor3.prototype._root = function(rule2, options) { + if (options === void 0) { + options = {}; + } + var parser = new parser_1.default(rule2, this._parseOptions(options)); + return parser.root; + }; + Processor3.prototype._parseOptions = function(options) { + var merged = Object.assign({}, this.options, options); + return { + lossy: this._isLossy(merged), + maxNestingDepth: merged.maxNestingDepth + }; + }; + Processor3.prototype._stringifyOptions = function(options) { + var merged = Object.assign({}, this.options, options); + return { + maxNestingDepth: merged.maxNestingDepth + }; + }; + Processor3.prototype._run = function(rule2, options) { + var _this = this; + if (options === void 0) { + options = {}; + } + return new Promise(function(resolve2, reject) { + try { + var root_1 = _this._root(rule2, options); + Promise.resolve(_this.func(root_1)).then(function(transform2) { + var string2 = void 0; + if (_this._shouldUpdateSelector(rule2, options)) { + string2 = root_1.toString(_this._stringifyOptions(options)); + rule2.selector = string2; + } + return { transform: transform2, root: root_1, string: string2 }; + }).then(resolve2, reject); + } catch (e) { + reject(e); + return; + } + }); + }; + Processor3.prototype._runSync = function(rule2, options) { + if (options === void 0) { + options = {}; + } + var root3 = this._root(rule2, options); + var transform2 = this.func(root3); + if (transform2 && typeof transform2.then === "function") { + throw new Error("Selector processor returned a promise to a synchronous call."); + } + var string2 = void 0; + if (options.updateSelector && typeof rule2 !== "string") { + string2 = root3.toString(this._stringifyOptions(options)); + rule2.selector = string2; + } + return { transform: transform2, root: root3, string: string2 }; + }; + Processor3.prototype.ast = function(rule2, options) { + return this._run(rule2, options).then(function(result) { + return result.root; + }); + }; + Processor3.prototype.astSync = function(rule2, options) { + return this._runSync(rule2, options).root; + }; + Processor3.prototype.transform = function(rule2, options) { + return this._run(rule2, options).then(function(result) { + return result.transform; + }); + }; + Processor3.prototype.transformSync = function(rule2, options) { + return this._runSync(rule2, options).transform; + }; + Processor3.prototype.process = function(rule2, options) { + var _this = this; + return this._run(rule2, options).then(function(result) { + return result.string || result.root.toString(_this._stringifyOptions(options)); + }); + }; + Processor3.prototype.processSync = function(rule2, options) { + var result = this._runSync(rule2, options); + return result.string || result.root.toString(this._stringifyOptions(options)); + }; + return Processor3; + })() + ); + exports.default = Processor2; } - /** - * Visit a RestParameterNode node. - * - * @param {nodes.RestParameterNode} node - */ - visitRestParameterNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/constructors.js + var require_constructors = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/constructors.js"(exports) { + "use strict"; + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.universal = exports.tag = exports.string = exports.selector = exports.root = exports.pseudo = exports.nesting = exports.id = exports.comment = exports.combinator = exports.className = exports.attribute = void 0; + var attribute_1 = __importDefault(require_attribute()); + var className_1 = __importDefault(require_className()); + var combinator_1 = __importDefault(require_combinator()); + var comment_1 = __importDefault(require_comment2()); + var id_1 = __importDefault(require_id()); + var nesting_1 = __importDefault(require_nesting()); + var pseudo_1 = __importDefault(require_pseudo()); + var root_1 = __importDefault(require_root2()); + var selector_1 = __importDefault(require_selector()); + var string_1 = __importDefault(require_string()); + var tag_1 = __importDefault(require_tag()); + var universal_1 = __importDefault(require_universal()); + var attribute2 = function(opts) { + return new attribute_1.default(opts); + }; + exports.attribute = attribute2; + var className = function(opts) { + return new className_1.default(opts); + }; + exports.className = className; + var combinator = function(opts) { + return new combinator_1.default(opts); + }; + exports.combinator = combinator; + var comment2 = function(opts) { + return new comment_1.default(opts); + }; + exports.comment = comment2; + var id = function(opts) { + return new id_1.default(opts); + }; + exports.id = id; + var nesting = function(opts) { + return new nesting_1.default(opts); + }; + exports.nesting = nesting; + var pseudo = function(opts) { + return new pseudo_1.default(opts); + }; + exports.pseudo = pseudo; + var root3 = function(opts) { + return new root_1.default(opts); + }; + exports.root = root3; + var selector = function(opts) { + return new selector_1.default(opts); + }; + exports.selector = selector; + var string2 = function(opts) { + return new string_1.default(opts); + }; + exports.string = string2; + var tag2 = function(opts) { + return new tag_1.default(opts); + }; + exports.tag = tag2; + var universal = function(opts) { + return new universal_1.default(opts); + }; + exports.universal = universal; } - /** - * Visit a RetryNode node. - * - * @param {nodes.RetryNode} node - */ - visitRetryNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/guards.js + var require_guards = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/guards.js"(exports) { + "use strict"; + var _a2; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isUniversal = exports.isTag = exports.isString = exports.isSelector = exports.isRoot = exports.isPseudo = exports.isNesting = exports.isIdentifier = exports.isComment = exports.isCombinator = exports.isClassName = exports.isAttribute = void 0; + exports.isNode = isNode2; + exports.isPseudoElement = isPseudoElement; + exports.isPseudoClass = isPseudoClass; + exports.isContainer = isContainer; + exports.isNamespace = isNamespace; + var types_1 = require_types(); + var IS_TYPE = (_a2 = {}, _a2[types_1.ATTRIBUTE] = true, _a2[types_1.CLASS] = true, _a2[types_1.COMBINATOR] = true, _a2[types_1.COMMENT] = true, _a2[types_1.ID] = true, _a2[types_1.NESTING] = true, _a2[types_1.PSEUDO] = true, _a2[types_1.ROOT] = true, _a2[types_1.SELECTOR] = true, _a2[types_1.STRING] = true, _a2[types_1.TAG] = true, _a2[types_1.UNIVERSAL] = true, _a2); + function isNode2(node2) { + return typeof node2 === "object" && IS_TYPE[node2.type]; + } + function isNodeType(type, node2) { + return isNode2(node2) && node2.type === type; + } + exports.isAttribute = isNodeType.bind(null, types_1.ATTRIBUTE); + exports.isClassName = isNodeType.bind(null, types_1.CLASS); + exports.isCombinator = isNodeType.bind(null, types_1.COMBINATOR); + exports.isComment = isNodeType.bind(null, types_1.COMMENT); + exports.isIdentifier = isNodeType.bind(null, types_1.ID); + exports.isNesting = isNodeType.bind(null, types_1.NESTING); + exports.isPseudo = isNodeType.bind(null, types_1.PSEUDO); + exports.isRoot = isNodeType.bind(null, types_1.ROOT); + exports.isSelector = isNodeType.bind(null, types_1.SELECTOR); + exports.isString = isNodeType.bind(null, types_1.STRING); + exports.isTag = isNodeType.bind(null, types_1.TAG); + exports.isUniversal = isNodeType.bind(null, types_1.UNIVERSAL); + function isPseudoElement(node2) { + return (0, exports.isPseudo)(node2) && node2.value && (node2.value.startsWith("::") || node2.value.toLowerCase() === ":before" || node2.value.toLowerCase() === ":after" || node2.value.toLowerCase() === ":first-letter" || node2.value.toLowerCase() === ":first-line"); + } + function isPseudoClass(node2) { + return (0, exports.isPseudo)(node2) && !isPseudoElement(node2); + } + function isContainer(node2) { + return !!(isNode2(node2) && node2.walk); + } + function isNamespace(node2) { + return (0, exports.isAttribute)(node2) || (0, exports.isTag)(node2); + } } - /** - * Visit a ReturnNode node. - * - * @param {nodes.ReturnNode} node - */ - visitReturnNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/selectors/index.js + var require_selectors = __commonJS({ + "node_modules/postcss-selector-parser/dist/selectors/index.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m2, k2, k22) { + if (k22 === void 0) k22 = k2; + var desc = Object.getOwnPropertyDescriptor(m2, k2); + if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m2[k2]; + } }; + } + Object.defineProperty(o, k22, desc); + }) : (function(o, m2, k2, k22) { + if (k22 === void 0) k22 = k2; + o[k22] = m2[k2]; + })); + var __exportStar = exports && exports.__exportStar || function(m2, exports2) { + for (var p2 in m2) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p2)) __createBinding(exports2, m2, p2); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + __exportStar(require_types(), exports); + __exportStar(require_constructors(), exports); + __exportStar(require_guards(), exports); } - /** - * Visit a SelfNode node. - * - * @param {nodes.SelfNode} node - */ - visitSelfNode(node) { - this.visitChildNodes(node); + }); + + // node_modules/postcss-selector-parser/dist/index.js + var require_dist = __commonJS({ + "node_modules/postcss-selector-parser/dist/index.js"(exports, module) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m2, k2, k22) { + if (k22 === void 0) k22 = k2; + var desc = Object.getOwnPropertyDescriptor(m2, k2); + if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m2[k2]; + } }; + } + Object.defineProperty(o, k22, desc); + }) : (function(o, m2, k2, k22) { + if (k22 === void 0) k22 = k2; + o[k22] = m2[k2]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v3) { + Object.defineProperty(o, "default", { enumerable: true, value: v3 }); + }) : function(o, v3) { + o["default"] = v3; + }); + var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() { + var ownKeys2 = function(o) { + ownKeys2 = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k2 in o2) if (Object.prototype.hasOwnProperty.call(o2, k2)) ar[ar.length] = k2; + return ar; + }; + return ownKeys2(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k2 = ownKeys2(mod), i = 0; i < k2.length; i++) if (k2[i] !== "default") __createBinding(result, mod, k2[i]); + } + __setModuleDefault(result, mod); + return result; + }; + })(); + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + var processor_1 = __importDefault(require_processor2()); + var selectors2 = __importStar(require_selectors()); + var parser = function(processor) { + return new processor_1.default(processor); + }; + Object.assign(parser, selectors2); + delete parser.__esModule; + module.exports = parser; } - /** - * Visit a ShareableConstantNode node. + }); + + // js/entry.mjs + var entry_exports = {}; + __export(entry_exports, { + A11yAvoidGenericLinkTextRule: () => A11yAvoidGenericLinkTextRule, + A11yDisabledAttributeRule: () => A11yDisabledAttributeRule, + A11yNestedInteractiveElementsRule: () => A11yNestedInteractiveElementsRule, + A11yNoAccesskeyAttributeRule: () => A11yNoAccesskeyAttributeRule, + A11yNoAriaLabelMisuseRule: () => A11yNoAriaLabelMisuseRule, + A11yNoAriaUnsupportedElementsRule: () => A11yNoAriaUnsupportedElementsRule, + A11yNoAutofocusAttributeRule: () => A11yNoAutofocusAttributeRule, + A11yNoRedundantImageAltRule: () => A11yNoRedundantImageAltRule, + A11yNoVisuallyHiddenInteractiveElementsRule: () => A11yNoVisuallyHiddenInteractiveElementsRule, + A11ySVGHasAccessibleTextRule: () => A11ySVGHasAccessibleTextRule, + ABSTRACT_ARIA_ROLES: () => ABSTRACT_ARIA_ROLES, + AMBIGUOUS_HELPERS: () => AMBIGUOUS_HELPERS, + ARIA_ATTRIBUTES: () => ARIA_ATTRIBUTES, + AST_TYPE_GUARDS: () => AST_TYPE_GUARDS, + ActionViewNoContentArgumentWithBlockRule: () => ActionViewNoContentArgumentWithBlockRule, + ActionViewNoDynamicPartialPathRule: () => ActionViewNoDynamicPartialPathRule, + ActionViewNoHelperShadowingRule: () => ActionViewNoHelperShadowingRule, + ActionViewNoImplicitPartialRule: () => ActionViewNoImplicitPartialRule, + ActionViewNoImplicitPolymorphicURLRule: () => ActionViewNoImplicitPolymorphicURLRule, + ActionViewNoLocalAssignsRule: () => ActionViewNoLocalAssignsRule, + ActionViewNoMistypedLocalsRule: () => ActionViewNoMistypedLocalsRule, + ActionViewNoRedundantLocalAssignsRule: () => ActionViewNoRedundantLocalAssignsRule, + ActionViewNoRenderOptionShadowingRule: () => ActionViewNoRenderOptionShadowingRule, + ActionViewNoSilentHelperRule: () => ActionViewNoSilentHelperRule, + ActionViewNoSilentRenderRule: () => ActionViewNoSilentRenderRule, + ActionViewNoStrictLocalsErrorRule: () => ActionViewNoStrictLocalsErrorRule, + ActionViewNoUnnecessaryHTMLSafeRule: () => ActionViewNoUnnecessaryHTMLSafeRule, + ActionViewNoUnnecessaryTagAttributesRule: () => ActionViewNoUnnecessaryTagAttributesRule, + ActionViewNoUnusedStrictLocalsRule: () => ActionViewNoUnusedStrictLocalsRule, + ActionViewNoVoidElementContentRule: () => ActionViewNoVoidElementContentRule, + ActionViewPreferCollectionRenderRule: () => ActionViewPreferCollectionRenderRule, + ActionViewPreferFormWithRule: () => ActionViewPreferFormWithRule, + ActionViewPreferLinkToHelperRule: () => ActionViewPreferLinkToHelperRule, + ActionViewPreferPluralizeHelperRule: () => ActionViewPreferPluralizeHelperRule, + ActionViewPreferQualifiedPartialPathRule: () => ActionViewPreferQualifiedPartialPathRule, + ActionViewStrictLocalsFirstLineRule: () => ActionViewStrictLocalsFirstLineRule, + ActionViewStrictLocalsPartialOnlyRule: () => ActionViewStrictLocalsPartialOnlyRule, + AttributeVisitorMixin: () => AttributeVisitorMixin, + BINDING_DEBUGGER_METHODS: () => BINDING_DEBUGGER_METHODS, + BUILT_IN_COMPONENTS: () => BUILT_IN_COMPONENTS, + BUILT_IN_COMPONENT_NAMES: () => BUILT_IN_COMPONENT_NAMES, + BYTE_ORDER_MARK: () => BYTE_ORDER_MARK, + BaseLexerRuleVisitor: () => BaseLexerRuleVisitor, + BaseRuleVisitor: () => BaseRuleVisitor, + BaseSourceRuleVisitor: () => BaseSourceRuleVisitor, + CDATANode: () => CDATANode, + CHARACTER_REFERENCE_PATTERN: () => CHARACTER_REFERENCE_PATTERN, + COMPONENT_DEFINITIONS: () => COMPONENT_DEFINITIONS, + CONTROL_FLOW_METHODS: () => CONTROL_FLOW_METHODS, + ConditionalElementConditionMismatchError: () => ConditionalElementConditionMismatchError, + ConditionalElementMultipleTagsError: () => ConditionalElementMultipleTagsError, + ControlFlowTrackingVisitor: () => ControlFlowTrackingVisitor, + ControlFlowType: () => ControlFlowType, + DEBUG_OUTPUT_METHODS: () => DEBUG_OUTPUT_METHODS, + DEFAULT_CONFIG: () => DEFAULT_CONFIG, + DEFAULT_ENVIRONMENT: () => DEFAULT_ENVIRONMENT, + DEFAULT_EXTRACT_RUBY_OPTIONS: () => DEFAULT_EXTRACT_RUBY_OPTIONS, + DEFAULT_FRAMEWORK: () => DEFAULT_FRAMEWORK, + DEFAULT_LINTER_PARSER_OPTIONS: () => DEFAULT_LINTER_PARSER_OPTIONS, + DEFAULT_LINT_CONTEXT: () => DEFAULT_LINT_CONTEXT, + DEFAULT_PARSER_OPTIONS: () => DEFAULT_PARSER_OPTIONS, + DEFAULT_RULE_CONFIG: () => DEFAULT_RULE_CONFIG, + DEFAULT_TEMPLATE_ENGINE: () => DEFAULT_TEMPLATE_ENGINE, + DEFERRED_COMPONENTS: () => DEFERRED_COMPONENTS, + DEPRECATED_SVG_ELEMENTS: () => DEPRECATED_SVG_ELEMENTS, + DIAGNOSTIC_SEVERITIES: () => DIAGNOSTIC_SEVERITIES, + DOCUMENT_ONLY_TAG_NAMES: () => DOCUMENT_ONLY_TAG_NAMES, + DocumentNode: () => DocumentNode, + DotNotationCasingError: () => DotNotationCasingError, + ERBBeginNode: () => ERBBeginNode, + ERBBlockNode: () => ERBBlockNode, + ERBCaseInlinePatternMatchError: () => ERBCaseInlinePatternMatchError, + ERBCaseMatchNode: () => ERBCaseMatchNode, + ERBCaseNode: () => ERBCaseNode, + ERBCaseWithConditionsError: () => ERBCaseWithConditionsError, + ERBClosingTagIndentRule: () => ERBClosingTagIndentRule, + ERBCommentNode: () => ERBCommentNode, + ERBCommentSyntax: () => ERBCommentSyntax, + ERBContentNode: () => ERBContentNode, + ERBControlFlowScopeError: () => ERBControlFlowScopeError, + ERBElseNode: () => ERBElseNode, + ERBEndNode: () => ERBEndNode, + ERBEnsureNode: () => ERBEnsureNode, + ERBForNode: () => ERBForNode, + ERBIfNode: () => ERBIfNode, + ERBInNode: () => ERBInNode, + ERBIterationBlockNode: () => ERBIterationBlockNode, + ERBMultipleBlocksInTagError: () => ERBMultipleBlocksInTagError, + ERBNoByteOrderMarkRule: () => ERBNoByteOrderMarkRule, + ERBNoCaseNodeChildrenRule: () => ERBNoCaseNodeChildrenRule, + ERBNoClassDefinitionsRule: () => ERBNoClassDefinitionsRule, + ERBNoCommentedOutOutputTagsRule: () => ERBNoCommentedOutOutputTagsRule, + ERBNoConditionalHTMLElementRule: () => ERBNoConditionalHTMLElementRule, + ERBNoConditionalOpenTagRule: () => ERBNoConditionalOpenTagRule, + ERBNoDebugOutputRule: () => ERBNoDebugOutputRule, + ERBNoDuplicateBranchElementsRule: () => ERBNoDuplicateBranchElementsRule, + ERBNoEmptyControlFlowRule: () => ERBNoEmptyControlFlowRule, + ERBNoEmptyTagsRule: () => ERBNoEmptyTagsRule, + ERBNoExtraNewLineRule: () => ERBNoExtraNewLineRule, + ERBNoExtraWhitespaceRule: () => ERBNoExtraWhitespaceRule, + ERBNoInlineCaseConditionsRule: () => ERBNoInlineCaseConditionsRule, + ERBNoInstanceVariablesInPartialsRule: () => ERBNoInstanceVariablesInPartialsRule, + ERBNoInterpolatedClassNamesRule: () => ERBNoInterpolatedClassNamesRule, + ERBNoJavascriptTagHelperRule: () => ERBNoJavascriptTagHelperRule, + ERBNoMethodDefinitionsRule: () => ERBNoMethodDefinitionsRule, + ERBNoModuleDefinitionsRule: () => ERBNoModuleDefinitionsRule, + ERBNoMultipleStatementsRule: () => ERBNoMultipleStatementsRule, + ERBNoOutputControlFlowRule: () => ERBNoOutputControlFlowRule, + ERBNoOutputInAttributeNameRule: () => ERBNoOutputInAttributeNameRule, + ERBNoOutputInAttributePositionRule: () => ERBNoOutputInAttributePositionRule, + ERBNoRawOutputInAttributeValueRule: () => ERBNoRawOutputInAttributeValueRule, + ERBNoReturnRule: () => ERBNoReturnRule, + ERBNoShadowedBlockArgumentRule: () => ERBNoShadowedBlockArgumentRule, + ERBNoSilentStatementRule: () => ERBNoSilentStatementRule, + ERBNoSilentTagInAttributeNameRule: () => ERBNoSilentTagInAttributeNameRule, + ERBNoSleepRule: () => ERBNoSleepRule, + ERBNoStatementInScriptRule: () => ERBNoStatementInScriptRule, + ERBNoThenInControlFlowRule: () => ERBNoThenInControlFlowRule, + ERBNoTrailingWhitespaceRule: () => ERBNoTrailingWhitespaceRule, + ERBNoUnsafeJSAttributeRule: () => ERBNoUnsafeJSAttributeRule, + ERBNoUnsafeRawRule: () => ERBNoUnsafeRawRule, + ERBNoUnsafeScriptInterpolationRule: () => ERBNoUnsafeScriptInterpolationRule, + ERBNoUnusedBlockArgumentRule: () => ERBNoUnusedBlockArgumentRule, + ERBNoUnusedExpressionsRule: () => ERBNoUnusedExpressionsRule, + ERBNoUnusedLiteralsRule: () => ERBNoUnusedLiteralsRule, + ERBNoUnusedLocalVariableRule: () => ERBNoUnusedLocalVariableRule, + ERBNodeClasses: () => ERBNodeClasses, + ERBOpenTagNode: () => ERBOpenTagNode, + ERBPreferDirectOutputRule: () => ERBPreferDirectOutputRule, + ERBPreferDoEndBlocksRule: () => ERBPreferDoEndBlocksRule, + ERBPreferEachOverMapRule: () => ERBPreferEachOverMapRule, + ERBPreferExplicitConditionalsRule: () => ERBPreferExplicitConditionalsRule, + ERBPreferImageTagHelperRule: () => ERBPreferImageTagHelperRule, + ERBRenderNode: () => ERBRenderNode, + ERBRequireTemplateFormatRule: () => ERBRequireTemplateFormatRule, + ERBRequireTrailingNewlineRule: () => ERBRequireTrailingNewlineRule, + ERBRequireWhitespaceRule: () => ERBRequireWhitespaceRule, + ERBRescueNode: () => ERBRescueNode, + ERBRightTrimRule: () => ERBRightTrimRule, + ERBStrictLocalsCommentSyntaxRule: () => ERBStrictLocalsCommentSyntaxRule, + ERBStrictLocalsNode: () => ERBStrictLocalsNode, + ERBStrictLocalsRequiredRule: () => ERBStrictLocalsRequiredRule, + ERBUnlessNode: () => ERBUnlessNode, + ERBUntilNode: () => ERBUntilNode, + ERBWhenNode: () => ERBWhenNode, + ERBWhileNode: () => ERBWhileNode, + ERBYieldNode: () => ERBYieldNode, + ElementStackVisitor: () => ElementStackVisitor, + EndTagWithTrailingSolidusError: () => EndTagWithTrailingSolidusError, + FOREIGN_CONTENT_ELEMENTS: () => FOREIGN_CONTENT_ELEMENTS, + FRAMEWORKS: () => FRAMEWORKS, + FRAMEWORK_NAMES: () => FRAMEWORK_NAMES, + HEADING_TAGS: () => HEADING_TAGS, + HEAD_AND_BODY_TAG_NAMES: () => HEAD_AND_BODY_TAG_NAMES, + HEAD_ONLY_TAG_NAMES: () => HEAD_ONLY_TAG_NAMES, + HELPERS_BY_TAG_NAME: () => HELPERS_BY_TAG_NAME, + HELPER_BY_SOURCE: () => HELPER_BY_SOURCE, + HELPER_REGISTRY: () => HELPER_REGISTRY, + HTMLAllowedScriptTypeRule: () => HTMLAllowedScriptTypeRule, + HTMLAnchorRequireHrefRule: () => HTMLAnchorRequireHrefRule, + HTMLAriaAttributeMustBeValid: () => HTMLAriaAttributeMustBeValid, + HTMLAriaLabelIsWellFormattedRule: () => HTMLAriaLabelIsWellFormattedRule, + HTMLAriaLevelMustBeValidRule: () => HTMLAriaLevelMustBeValidRule, + HTMLAriaRoleHeadingRequiresLevelRule: () => HTMLAriaRoleHeadingRequiresLevelRule, + HTMLAriaRoleMustBeValidRule: () => HTMLAriaRoleMustBeValidRule, + HTMLAttributeDoubleQuotesRule: () => HTMLAttributeDoubleQuotesRule, + HTMLAttributeEqualsSpacingRule: () => HTMLAttributeEqualsSpacingRule, + HTMLAttributeNameNode: () => HTMLAttributeNameNode, + HTMLAttributeNameValidCharactersRule: () => HTMLAttributeNameValidCharactersRule, + HTMLAttributeNode: () => HTMLAttributeNode, + HTMLAttributeValueNode: () => HTMLAttributeValueNode, + HTMLAttributeValuesRequireQuotesRule: () => HTMLAttributeValuesRequireQuotesRule, + HTMLAvoidBothDisabledAndAriaDisabledRule: () => HTMLAvoidBothDisabledAndAriaDisabledRule, + HTMLBodyOnlyElementsRule: () => HTMLBodyOnlyElementsRule, + HTMLBooleanAttributesNoValueRule: () => HTMLBooleanAttributesNoValueRule, + HTMLCloseTagNode: () => HTMLCloseTagNode, + HTMLCommentNode: () => HTMLCommentNode, + HTMLConditionalElementNode: () => HTMLConditionalElementNode, + HTMLConditionalOpenTagNode: () => HTMLConditionalOpenTagNode, + HTMLDetailsHasSummaryRule: () => HTMLDetailsHasSummaryRule, + HTMLDoctypeNode: () => HTMLDoctypeNode, + HTMLElementNode: () => HTMLElementNode, + HTMLHeadOnlyElementsRule: () => HTMLHeadOnlyElementsRule, + HTMLIframeHasTitleRule: () => HTMLIframeHasTitleRule, + HTMLImgRequireAltRule: () => HTMLImgRequireAltRule, + HTMLInputRequireAutocompleteRule: () => HTMLInputRequireAutocompleteRule, + HTMLNavigationHasLabelRule: () => HTMLNavigationHasLabelRule, + HTMLNoAbstractRolesRule: () => HTMLNoAbstractRolesRule, + HTMLNoAriaHiddenOnBodyRule: () => HTMLNoAriaHiddenOnBodyRule, + HTMLNoAriaHiddenOnFocusableRule: () => HTMLNoAriaHiddenOnFocusableRule, + HTMLNoBlockInsideInlineRule: () => HTMLNoBlockInsideInlineRule, + HTMLNoDuplicateAttributesRule: () => HTMLNoDuplicateAttributesRule, + HTMLNoDuplicateIdsRule: () => HTMLNoDuplicateIdsRule, + HTMLNoDuplicateMetaNamesRule: () => HTMLNoDuplicateMetaNamesRule, + HTMLNoEmptyAttributesRule: () => HTMLNoEmptyAttributesRule, + HTMLNoEmptyCSSRuleRule: () => HTMLNoEmptyCSSRuleRule, + HTMLNoEmptyHeadingsRule: () => HTMLNoEmptyHeadingsRule, + HTMLNoEventHandlerAttributesRule: () => HTMLNoEventHandlerAttributesRule, + HTMLNoInlineScriptElementsRule: () => HTMLNoInlineScriptElementsRule, + HTMLNoLiteralNBSPRule: () => HTMLNoLiteralNBSPRule, + HTMLNoNestedFormsRule: () => HTMLNoNestedFormsRule, + HTMLNoNestedLinksRule: () => HTMLNoNestedLinksRule, + HTMLNoObsoleteTagsRule: () => HTMLNoObsoleteTagsRule, + HTMLNoPositiveTabIndexRule: () => HTMLNoPositiveTabIndexRule, + HTMLNoSelfClosingRule: () => HTMLNoSelfClosingRule, + HTMLNoSpaceInTagRule: () => HTMLNoSpaceInTagRule, + HTMLNoStyleAttributesRule: () => HTMLNoStyleAttributesRule, + HTMLNoStyleElementsRule: () => HTMLNoStyleElementsRule, + HTMLNoTitleAttributeRule: () => HTMLNoTitleAttributeRule, + HTMLNoUnderscoresInAttributeNamesRule: () => HTMLNoUnderscoresInAttributeNamesRule, + HTMLNoUnescapedEntitiesRule: () => HTMLNoUnescapedEntitiesRule, + HTMLNoUnknownTagRule: () => HTMLNoUnknownTagRule, + HTMLNodeClasses: () => HTMLNodeClasses, + HTMLOmittedCloseTagNode: () => HTMLOmittedCloseTagNode, + HTMLOpenTagNode: () => HTMLOpenTagNode, + HTMLRequireClosingTagsRule: () => HTMLRequireClosingTagsRule, + HTMLRequireScriptNonceRule: () => HTMLRequireScriptNonceRule, + HTMLTagNameLowercaseRule: () => HTMLTagNameLowercaseRule, + HTMLTextNode: () => HTMLTextNode, + HTMLVirtualCloseTagNode: () => HTMLVirtualCloseTagNode, + HTML_BLOCK_ELEMENTS: () => HTML_BLOCK_ELEMENTS, + HTML_BOOLEAN_ATTRIBUTES: () => HTML_BOOLEAN_ATTRIBUTES, + HTML_DEPRECATED_ELEMENTS: () => HTML_DEPRECATED_ELEMENTS, + HTML_ELEMENTS: () => HTML_ELEMENTS, + HTML_ELEMENT_NAMES: () => HTML_ELEMENT_NAMES, + HTML_ESCAPES: () => HTML_ESCAPES, + HTML_INLINE_ELEMENTS: () => HTML_INLINE_ELEMENTS, + HTML_NAMED_CHARACTER_REFERENCES: () => HTML_NAMED_CHARACTER_REFERENCES, + HTML_ONLY_TAG_NAMES: () => HTML_ONLY_TAG_NAMES, + HTML_VOID_ELEMENTS: () => HTML_VOID_ELEMENTS, + HTML_WHITESPACE_PRESERVING_ELEMENTS: () => HTML_WHITESPACE_PRESERVING_ELEMENTS, + HelperType: () => HelperType, + HerbBackend: () => HerbBackend, + HerbComponentRequiresSlotsRule: () => HerbComponentRequiresSlotsRule, + HerbConfigFrameworkOptionRule: () => HerbConfigFrameworkOptionRule, + HerbDirectiveNode: () => HerbDirectiveNode, + HerbDisableCommentBaseVisitor: () => HerbDisableCommentBaseVisitor, + HerbDisableCommentMalformedRule: () => HerbDisableCommentMalformedRule, + HerbDisableCommentMissingRulesRule: () => HerbDisableCommentMissingRulesRule, + HerbDisableCommentNoDuplicateRulesRule: () => HerbDisableCommentNoDuplicateRulesRule, + HerbDisableCommentNoRedundantAllRule: () => HerbDisableCommentNoRedundantAllRule, + HerbDisableCommentOutOfDateRule: () => HerbDisableCommentOutOfDateRule, + HerbDisableCommentParsedVisitor: () => HerbDisableCommentParsedVisitor, + HerbDisableCommentUnnecessaryRule: () => HerbDisableCommentUnnecessaryRule, + HerbDisableCommentValidRuleNameRule: () => HerbDisableCommentValidRuleNameRule, + HerbError: () => HerbError, + HerbIntoRequiresCollectionRule: () => HerbIntoRequiresCollectionRule, + HerbScopedStyleNoUnusedSelectorRule: () => HerbScopedStyleNoUnusedSelectorRule, + HerbScopedStyleRequireTopLevelRule: () => HerbScopedStyleRequireTopLevelRule, + HerbScopedStyleSingleDeclarationRule: () => HerbScopedStyleSingleDeclarationRule, + HerbSlotsSingleDirectiveRule: () => HerbSlotsSingleDirectiveRule, + HerbSlotsValidComponentsRule: () => HerbSlotsValidComponentsRule, + HerbSlotsValidModeRule: () => HerbSlotsValidModeRule, + HerbStateDeclarationNode: () => HerbStateDeclarationNode, + HerbStateDirectiveNode: () => HerbStateDirectiveNode, + HerbStateDirectiveSyntaxRule: () => HerbStateDirectiveSyntaxRule, + HerbStateDuplicateDeclarationError: () => HerbStateDuplicateDeclarationError, + HerbStateInvalidParameterError: () => HerbStateInvalidParameterError, + HerbStateMissingParenthesisError: () => HerbStateMissingParenthesisError, + HerbStateNoServerWritesRule: () => HerbStateNoServerWritesRule, + HerbStateNoShadowedStatesRule: () => HerbStateNoShadowedStatesRule, + HerbStateNoSilentReadsRule: () => HerbStateNoSilentReadsRule, + HerbStateNoUnusedStatesRule: () => HerbStateNoUnusedStatesRule, + HerbStateNonCanonicalDirectiveError: () => HerbStateNonCanonicalDirectiveError, + HerbStateRequiresSlotsRule: () => HerbStateRequiresSlotsRule, + HerbStateSingleDeclarationRule: () => HerbStateSingleDeclarationRule, + HerbStateValidActionsRule: () => HerbStateValidActionsRule, + HerbStateValidBindingsRule: () => HerbStateValidBindingsRule, + HerbStateValidDeclarationRule: () => HerbStateValidDeclarationRule, + HerbStateValidReadsRule: () => HerbStateValidReadsRule, + HerbValidSlotNamesRule: () => HerbValidSlotNamesRule, + HerbWarning: () => HerbWarning, + InvalidCommentClosingTagError: () => InvalidCommentClosingTagError, + LexResult: () => LexResult, + LexerRule: () => LexerRule, + Linter: () => Linter, + LiteralNode: () => LiteralNode, + LocateResult: () => LocateResult, + Location: () => Location, + MATHML_KNOWN_ELEMENTS: () => MATHML_KNOWN_ELEMENTS, + MalformedERBClosingTagError: () => MalformedERBClosingTagError, + MissingAttributeValueError: () => MissingAttributeValueError, + MissingClosingTagError: () => MissingClosingTagError, + MissingERBEndTagError: () => MissingERBEndTagError, + MissingOpeningTagError: () => MissingOpeningTagError, + MissingWhitespaceBetweenAttributesError: () => MissingWhitespaceBetweenAttributesError, + NODE_TYPE_GUARDS: () => NODE_TYPE_GUARDS, + NestedCommentError: () => NestedCommentError, + NestedERBTagError: () => NestedERBTagError, + Node: () => Node, + OBSOLETE_ELEMENT_REPLACEMENTS: () => OBSOLETE_ELEMENT_REPLACEMENTS, + OmittedClosingTagError: () => OmittedClosingTagError, + ParseResult: () => ParseResult2, + ParserNoErrorsRule: () => ParserNoErrorsRule, + ParserOptions: () => ParserOptions, + ParserRule: () => ParserRule, + Position: () => Position, + PrismBasicVisitor: () => PrismBasicVisitor, + PrismNodes: () => nodes_exports, + PrismVisitor: () => PrismVisitor, + RAW_TEXT_ELEMENTS: () => RAW_TEXT_ELEMENTS, + RCDATA_ELEMENTS: () => RCDATA_ELEMENTS, + RUBY_INTROSPECTION_METHODS: () => RUBY_INTROSPECTION_METHODS, + RUBY_KEYWORDS: () => RUBY_KEYWORDS, + Range: () => Range, + RenderAmbiguousLocalsError: () => RenderAmbiguousLocalsError, + RenderConflictingPartialError: () => RenderConflictingPartialError, + RenderInvalidAsOptionError: () => RenderInvalidAsOptionError, + RenderLayoutWithoutBlockError: () => RenderLayoutWithoutBlockError, + RenderMissingLocalsError: () => RenderMissingLocalsError, + RenderNoArgumentsError: () => RenderNoArgumentsError, + RenderObjectAndCollectionError: () => RenderObjectAndCollectionError, + Result: () => Result, + RubyHTMLAttributesSplatNode: () => RubyHTMLAttributesSplatNode, + RubyLiteralNode: () => RubyLiteralNode, + RubyParameterNode: () => RubyParameterNode, + RubyParseError: () => RubyParseError, + RubyReferenceCollector: () => RubyReferenceCollector, + RubyRenderKeywordsNode: () => RubyRenderKeywordsNode, + RubyRenderLocalNode: () => RubyRenderLocalNode, + SIDE_EFFECT_METHODS: () => SIDE_EFFECT_METHODS, + SVGNoDeprecatedTagsRule: () => SVGNoDeprecatedTagsRule, + SVGTagNameCapitalizationRule: () => SVGTagNameCapitalizationRule, + SVG_CAMEL_CASE_ELEMENTS: () => SVG_CAMEL_CASE_ELEMENTS, + SVG_KNOWN_ELEMENTS: () => SVG_KNOWN_ELEMENTS, + SVG_LOWERCASE_TO_CAMELCASE: () => SVG_LOWERCASE_TO_CAMELCASE, + SourceIndentationRule: () => SourceIndentationRule, + SourceOffsets: () => SourceOffsets, + SourcePath: () => SourcePath, + SourceRule: () => SourceRule, + StrayERBClosingTagError: () => StrayERBClosingTagError, + StrictLocalsBlockArgumentError: () => StrictLocalsBlockArgumentError, + StrictLocalsDuplicateDeclarationError: () => StrictLocalsDuplicateDeclarationError, + StrictLocalsMissingParenthesisError: () => StrictLocalsMissingParenthesisError, + StrictLocalsPositionalArgumentError: () => StrictLocalsPositionalArgumentError, + StrictLocalsSplatArgumentError: () => StrictLocalsSplatArgumentError, + TOKEN_LIST_ATTRIBUTES: () => TOKEN_LIST_ATTRIBUTES, + TagNamesMismatchError: () => TagNamesMismatchError, + TimeoutError: () => TimeoutError, + Token: () => Token, + TokenList: () => TokenList, + TurboPermanentNoMisleadingValueRule: () => TurboPermanentNoMisleadingValueRule, + TurboPermanentRequireIdRule: () => TurboPermanentRequireIdRule, + UJSAttributeVisitor: () => UJSAttributeVisitor, + UJSNoRemoteAttributeRule: () => UJSNoRemoteAttributeRule, + UJSPreferTurboConfirmRule: () => UJSPreferTurboConfirmRule, + UJSPreferTurboMethodRule: () => UJSPreferTurboMethodRule, + UJSPreferTurboSubmitsWithRule: () => UJSPreferTurboSubmitsWithRule, + UNRELEASED_VERSION: () => UNRELEASED_VERSION, + UnclosedCloseTagError: () => UnclosedCloseTagError, + UnclosedCommentError: () => UnclosedCommentError, + UnclosedERBTagError: () => UnclosedERBTagError, + UnclosedElementError: () => UnclosedElementError, + UnclosedOpenTagError: () => UnclosedOpenTagError, + UnclosedQuoteError: () => UnclosedQuoteError, + UnexpectedCharacterInAttributeNameError: () => UnexpectedCharacterInAttributeNameError, + UnexpectedCharacterInUnquotedAttributeValueError: () => UnexpectedCharacterInUnquotedAttributeValueError, + UnexpectedEqualsSignBeforeAttributeNameError: () => UnexpectedEqualsSignBeforeAttributeNameError, + UnexpectedError: () => UnexpectedError, + UnexpectedSolidusInTagError: () => UnexpectedSolidusInTagError, + UnexpectedTokenError: () => UnexpectedTokenError, + VALID_ARIA_ROLES: () => VALID_ARIA_ROLES, + VALID_FRAMEWORKS: () => VALID_FRAMEWORKS, + VALID_TEMPLATE_ENGINES: () => VALID_TEMPLATE_ENGINES, + Visitor: () => Visitor2, + VoidElementClosingTagError: () => VoidElementClosingTagError, + VoidElementContentError: () => VoidElementContentError, + WhitespaceNode: () => WhitespaceNode, + XMLDeclarationNode: () => XMLDeclarationNode, + XMLProcessingInstructionNode: () => XMLProcessingInstructionNode, + _TYPECHECK: () => _TYPECHECK, + areAllOfType: () => areAllOfType, + commentedERBTagPrefixes: () => commentedERBTagPrefixes, + compareSemver: () => compareSemver, + componentAttribute: () => componentAttribute, + constructsObject: () => constructsObject, + continuesFromPreviousNode: () => continuesFromPreviousNode, + continuesIntoNextNode: () => continuesIntoNextNode, + createERBOutputNode: () => createERBOutputNode, + createERBSilentNode: () => createERBSilentNode, + createEndOfFileLocation: () => createEndOfFileLocation, + createLiteral: () => createLiteral, + createWhitespaceNode: () => createWhitespaceNode, + deserializeDiagnostic: () => deserializeDiagnostic, + deserializePrismNode: () => deserializePrismNode, + deserializePrismParseResult: () => deserializePrismParseResult, + didyoumean: () => didyoumean, + didyoumeanRanked: () => didyoumeanRanked, + ensureLibHerbBackend: () => ensureLibHerbBackend, + ensureString: () => ensureString, + escapeHTML: () => escapeHTML, + filterCDATANodes: () => filterCDATANodes, + filterDocumentNodes: () => filterDocumentNodes, + filterERBBeginNodes: () => filterERBBeginNodes, + filterERBBlockNodes: () => filterERBBlockNodes, + filterERBCaseMatchNodes: () => filterERBCaseMatchNodes, + filterERBCaseNodes: () => filterERBCaseNodes, + filterERBCommentNodes: () => filterERBCommentNodes, + filterERBContentNodes: () => filterERBContentNodes, + filterERBElseNodes: () => filterERBElseNodes, + filterERBEndNodes: () => filterERBEndNodes, + filterERBEnsureNodes: () => filterERBEnsureNodes, + filterERBForNodes: () => filterERBForNodes, + filterERBIfNodes: () => filterERBIfNodes, + filterERBInNodes: () => filterERBInNodes, + filterERBIterationBlockNodes: () => filterERBIterationBlockNodes, + filterERBOpenTagNodes: () => filterERBOpenTagNodes, + filterERBRenderNodes: () => filterERBRenderNodes, + filterERBRescueNodes: () => filterERBRescueNodes, + filterERBStrictLocalsNodes: () => filterERBStrictLocalsNodes, + filterERBUnlessNodes: () => filterERBUnlessNodes, + filterERBUntilNodes: () => filterERBUntilNodes, + filterERBWhenNodes: () => filterERBWhenNodes, + filterERBWhileNodes: () => filterERBWhileNodes, + filterERBYieldNodes: () => filterERBYieldNodes, + filterHTMLAttributeNameNodes: () => filterHTMLAttributeNameNodes, + filterHTMLAttributeNodes: () => filterHTMLAttributeNodes, + filterHTMLAttributeValueNodes: () => filterHTMLAttributeValueNodes, + filterHTMLCloseTagNodes: () => filterHTMLCloseTagNodes, + filterHTMLCommentNodes: () => filterHTMLCommentNodes, + filterHTMLConditionalElementNodes: () => filterHTMLConditionalElementNodes, + filterHTMLConditionalOpenTagNodes: () => filterHTMLConditionalOpenTagNodes, + filterHTMLDoctypeNodes: () => filterHTMLDoctypeNodes, + filterHTMLElementNodes: () => filterHTMLElementNodes, + filterHTMLOmittedCloseTagNodes: () => filterHTMLOmittedCloseTagNodes, + filterHTMLOpenTagNodes: () => filterHTMLOpenTagNodes, + filterHTMLTextNodes: () => filterHTMLTextNodes, + filterHTMLVirtualCloseTagNodes: () => filterHTMLVirtualCloseTagNodes, + filterHerbDirectiveNodes: () => filterHerbDirectiveNodes, + filterHerbStateDeclarationNodes: () => filterHerbStateDeclarationNodes, + filterHerbStateDirectiveNodes: () => filterHerbStateDirectiveNodes, + filterLiteralNodes: () => filterLiteralNodes, + filterNodes: () => filterNodes, + filterRubyHTMLAttributesSplatNodes: () => filterRubyHTMLAttributesSplatNodes, + filterRubyLiteralNodes: () => filterRubyLiteralNodes, + filterRubyParameterNodes: () => filterRubyParameterNodes, + filterRubyRenderKeywordsNodes: () => filterRubyRenderKeywordsNodes, + filterRubyRenderLocalNodes: () => filterRubyRenderLocalNodes, + filterWhitespaceNodes: () => filterWhitespaceNodes, + filterXMLDeclarationNodes: () => filterXMLDeclarationNodes, + filterXMLProcessingInstructionNodes: () => filterXMLProcessingInstructionNodes, + findAttributeByName: () => findAttributeByName, + findElementAttribute: () => findElementAttribute, + findNodeAtPosition: () => findNodeAtPosition, + findNodeByLocation: () => findNodeByLocation, + findParent: () => findParent, + findParentArray: () => findParentArray, + findPreferredHelperForTag: () => findPreferredHelperForTag, + fixabilityFor: () => fixabilityFor, + forEachAttribute: () => forEachAttribute, + fromSerializedError: () => fromSerializedError, + fromSerializedNode: () => fromSerializedNode, + getAttribute: () => getAttribute, + getAttributeName: () => getAttributeName, + getAttributeValue: () => getAttributeValue, + getAttributeValueNodes: () => getAttributeValueNodes, + getAttributeValueQuoteType: () => getAttributeValueQuoteType, + getAttributes: () => getAttributes, + getBasename: () => getBasename, + getCombinedAttributeName: () => getCombinedAttributeName, + getCombinedAttributeNameString: () => getCombinedAttributeNameString, + getCombinedStringFromNodes: () => getCombinedStringFromNodes, + getHelper: () => getHelper, + getHelperBySource: () => getHelperBySource, + getHelperEntries: () => getHelperEntries, + getHelpersByGem: () => getHelpersByGem, + getHelpersByModule: () => getHelpersByModule, + getHelpersByOutput: () => getHelpersByOutput, + getHelpersByReceiver: () => getHelpersByReceiver, + getHelpersForTag: () => getHelpersForTag, + getNamedCharacterReference: () => getNamedCharacterReference, + getNodesAfterLocation: () => getNodesAfterLocation, + getNodesAfterPosition: () => getNodesAfterPosition, + getNodesBeforeLocation: () => getNodesBeforeLocation, + getNodesBeforePosition: () => getNodesBeforePosition, + getOpenTag: () => getOpenTag, + getStaticAttributeName: () => getStaticAttributeName, + getStaticAttributeValue: () => getStaticAttributeValue, + getStaticAttributeValueContent: () => getStaticAttributeValueContent, + getStaticBodyText: () => getStaticBodyText, + getStaticContentFromNodes: () => getStaticContentFromNodes, + getStaticStringFromNodes: () => getStaticStringFromNodes, + getSupportedHelpers: () => getSupportedHelpers, + getTagLocalName: () => getTagLocalName, + getTagName: () => getTagName, + getTokenList: () => getTokenList, + getValidatableStaticContent: () => getValidatableStaticContent, + groupNodesByClass: () => groupNodesByClass, + hasAttribute: () => hasAttribute, + hasAttributeValue: () => hasAttributeValue, + hasBalancedParentheses: () => hasBalancedParentheses, + hasChildren: () => hasChildren, + hasDynamicAttributeName: () => hasDynamicAttributeName, + hasDynamicAttributeNameNode: () => hasDynamicAttributeNameNode, + hasDynamicAttributeValue: () => hasDynamicAttributeValue, + hasDynamicOutput: () => hasDynamicOutput, + hasERBContent: () => hasERBContent, + hasERBOutput: () => hasERBOutput, + hasStaticAttributeName: () => hasStaticAttributeName, + hasStaticAttributeValue: () => hasStaticAttributeValue, + hasStaticAttributeValueContent: () => hasStaticAttributeValueContent, + hasStaticContent: () => hasStaticContent, + helperExists: () => helperExists, + helperNamesForTags: () => helperNamesForTags, + inspectPrismNode: () => inspectPrismNode, + inspectPrismSerialized: () => inspectPrismSerialized, + isActionViewHelperCall: () => isActionViewHelperCall, + isAnyOf: () => isAnyOf, + isAssignmentNode: () => isAssignmentNode, + isAttributeValueQuoted: () => isAttributeValueQuoted, + isAttributeWriteCall: () => isAttributeWriteCall, + isBlockElement: () => isBlockElement, + isBodyOnlyTag: () => isBodyOnlyTag, + isBodyTag: () => isBodyTag, + isBooleanAttribute: () => isBooleanAttribute, + isBuiltInComponent: () => isBuiltInComponent, + isCDATANode: () => isCDATANode, + isCallOnLocal: () => isCallOnLocal, + isCommentNode: () => isCommentNode, + isComponentTagName: () => isComponentTagName, + isConditionalTagAttributesCall: () => isConditionalTagAttributesCall, + isControlFlowNode: () => isControlFlowNode, + isCustomElement: () => isCustomElement, + isDebugOutputCall: () => isDebugOutputCall, + isDeprecatedElement: () => isDeprecatedElement, + isDiagnosticSeverity: () => isDiagnosticSeverity, + isDocumentNode: () => isDocumentNode, + isDocumentOnlyTag: () => isDocumentOnlyTag, + isDynamicOutputNode: () => isDynamicOutputNode, + isERBBeginNode: () => isERBBeginNode, + isERBBlockNode: () => isERBBlockNode, + isERBCaseMatchNode: () => isERBCaseMatchNode, + isERBCaseNode: () => isERBCaseNode, + isERBCommentNode: () => isERBCommentNode, + isERBContentNode: () => isERBContentNode, + isERBControlFlowNode: () => isERBControlFlowNode, + isERBElseNode: () => isERBElseNode, + isERBEndNode: () => isERBEndNode, + isERBEnsureNode: () => isERBEnsureNode, + isERBEscapedNode: () => isERBEscapedNode, + isERBForNode: () => isERBForNode, + isERBIfNode: () => isERBIfNode, + isERBInNode: () => isERBInNode, + isERBIterationBlockNode: () => isERBIterationBlockNode, + isERBNode: () => isERBNode, + isERBOpenTagNode: () => isERBOpenTagNode, + isERBOutputNode: () => isERBOutputNode, + isERBRenderNode: () => isERBRenderNode, + isERBRescueNode: () => isERBRescueNode, + isERBStrictLocalsNode: () => isERBStrictLocalsNode, + isERBUnlessNode: () => isERBUnlessNode, + isERBUntilNode: () => isERBUntilNode, + isERBWhenNode: () => isERBWhenNode, + isERBWhileNode: () => isERBWhileNode, + isERBYieldNode: () => isERBYieldNode, + isEffectivelyStatic: () => isEffectivelyStatic, + isEquivalentAttribute: () => isEquivalentAttribute, + isEquivalentElement: () => isEquivalentElement, + isEquivalentOpenTag: () => isEquivalentOpenTag, + isHTMLAttributeNameNode: () => isHTMLAttributeNameNode, + isHTMLAttributeNode: () => isHTMLAttributeNode, + isHTMLAttributeValueNode: () => isHTMLAttributeValueNode, + isHTMLCloseTagNode: () => isHTMLCloseTagNode, + isHTMLCommentNode: () => isHTMLCommentNode, + isHTMLConditionalElementNode: () => isHTMLConditionalElementNode, + isHTMLConditionalOpenTagNode: () => isHTMLConditionalOpenTagNode, + isHTMLDoctypeNode: () => isHTMLDoctypeNode, + isHTMLElementNode: () => isHTMLElementNode, + isHTMLNode: () => isHTMLNode, + isHTMLOmittedCloseTagNode: () => isHTMLOmittedCloseTagNode, + isHTMLOpenTagNode: () => isHTMLOpenTagNode, + isHTMLTextNode: () => isHTMLTextNode, + isHTMLVirtualCloseTagNode: () => isHTMLVirtualCloseTagNode, + isHeadAndBodyTag: () => isHeadAndBodyTag, + isHeadOnlyTag: () => isHeadOnlyTag, + isHeadTag: () => isHeadTag, + isHelperSupported: () => isHelperSupported, + isHerbDirectiveNode: () => isHerbDirectiveNode, + isHerbStateDeclarationNode: () => isHerbStateDeclarationNode, + isHerbStateDirectiveNode: () => isHerbStateDirectiveNode, + isHtmlOnlyTag: () => isHtmlOnlyTag, + isInlineElement: () => isInlineElement, + isInlineRubyCommentNode: () => isInlineRubyCommentNode, + isJavaScriptTagElement: () => isJavaScriptTagElement, + isKeyboardFocusableElement: () => isKeyboardFocusableElement, + isKnownHTMLElement: () => isKnownHTMLElement, + isKnownMathMLElement: () => isKnownMathMLElement, + isKnownSVGElement: () => isKnownSVGElement, + isLibHerbBackend: () => isLibHerbBackend, + isLiteralNode: () => isLiteralNode, + isNamedCharacterReference: () => isNamedCharacterReference, + isNilAttributeValue: () => isNilAttributeValue, + isNode: () => isNode, + isNoneOf: () => isNoneOf, + isParseResult: () => isParseResult, + isPartialFile: () => isPartialFile, + isPositionAfter: () => isPositionAfter, + isPositionEqual: () => isPositionEqual, + isPrismNodeType: () => isPrismNodeType, + isProbableLocal: () => isProbableLocal, + isPureWhitespaceNode: () => isPureWhitespaceNode, + isRubyHTMLAttributesSplatNode: () => isRubyHTMLAttributesSplatNode, + isRubyIntrospectionMethod: () => isRubyIntrospectionMethod, + isRubyKeyword: () => isRubyKeyword, + isRubyLiteralNode: () => isRubyLiteralNode, + isRubyParameterNode: () => isRubyParameterNode, + isRubyRenderKeywordsNode: () => isRubyRenderKeywordsNode, + isRubyRenderLocalNode: () => isRubyRenderLocalNode, + isSideEffectCall: () => isSideEffectCall, + isSleepCall: () => isSleepCall, + isStaticPartialPath: () => isStaticPartialPath, + isTagAttributesCall: () => isTagAttributesCall, + isTagBuilderCall: () => isTagBuilderCall, + isToken: () => isToken, + isValidCharacterReference: () => isValidCharacterReference, + isValidFramework: () => isValidFramework, + isValidLocalName: () => isValidLocalName, + isValidTemplateEngine: () => isValidTemplateEngine, + isVoidElement: () => isVoidElement, + isWhitespaceNode: () => isWhitespaceNode, + isWhitespacePreservingElement: () => isWhitespacePreservingElement, + isXMLDeclarationNode: () => isXMLDeclarationNode, + isXMLProcessingInstructionNode: () => isXMLProcessingInstructionNode, + levenshtein: () => levenshtein, + locatable: () => locatable, + locate: () => locate, + locationFromByteOffset: () => locationFromByteOffset, + locationFromContentOffset: () => locationFromContentOffset, + locationsEqual: () => locationsEqual, + meetsSeverityThreshold: () => meetsSeverityThreshold, + offsetFromPosition: () => offsetFromPosition, + parseSemver: () => parseSemver, + positionFromOffset: () => positionFromOffset, + removeNodeFromArray: () => removeNodeFromArray, + replaceNodeWithBody: () => replaceNodeWithBody, + rootReceiver: () => rootReceiver, + ruleDocumentationUrl: () => ruleDocumentationUrl, + rules: () => rules, + semverGreaterThan: () => semverGreaterThan, + sliceBetweenPositions: () => sliceBetweenPositions, + splitByTopLevelComma: () => splitByTopLevelComma, + splitLiteralsAtWhitespace: () => splitLiteralsAtWhitespace, + splitNodesAroundLocation: () => splitNodesAroundLocation, + splitNodesAroundPosition: () => splitNodesAroundPosition, + stringIndexFromByteOffset: () => stringIndexFromByteOffset, + substringFromByteOffset: () => substringFromByteOffset, + toMonacoDiagnostic: () => toMonacoDiagnostic, + unwrapModifierStatement: () => unwrapModifierStatement, + viewHelperExists: () => viewHelperExists + }); + + // node_modules/@herb-tools/linter/dist/index.js + var import_picomatch = __toESM(require_picomatch2()); + + // node_modules/@ruby/prism/src/nodes.js + var nodes_exports = {}; + __export(nodes_exports, { + AliasGlobalVariableNode: () => AliasGlobalVariableNode, + AliasMethodNode: () => AliasMethodNode, + AlternationPatternNode: () => AlternationPatternNode, + AndNode: () => AndNode, + ArgumentsNode: () => ArgumentsNode, + ArrayNode: () => ArrayNode, + ArrayPatternNode: () => ArrayPatternNode, + AssocNode: () => AssocNode, + AssocSplatNode: () => AssocSplatNode, + BackReferenceReadNode: () => BackReferenceReadNode, + BeginNode: () => BeginNode, + BlockArgumentNode: () => BlockArgumentNode, + BlockLocalVariableNode: () => BlockLocalVariableNode, + BlockNode: () => BlockNode, + BlockParameterNode: () => BlockParameterNode, + BlockParametersNode: () => BlockParametersNode, + BreakNode: () => BreakNode, + CallAndWriteNode: () => CallAndWriteNode, + CallNode: () => CallNode, + CallOperatorWriteNode: () => CallOperatorWriteNode, + CallOrWriteNode: () => CallOrWriteNode, + CallTargetNode: () => CallTargetNode, + CapturePatternNode: () => CapturePatternNode, + CaseMatchNode: () => CaseMatchNode, + CaseNode: () => CaseNode, + ClassNode: () => ClassNode, + ClassVariableAndWriteNode: () => ClassVariableAndWriteNode, + ClassVariableOperatorWriteNode: () => ClassVariableOperatorWriteNode, + ClassVariableOrWriteNode: () => ClassVariableOrWriteNode, + ClassVariableReadNode: () => ClassVariableReadNode, + ClassVariableTargetNode: () => ClassVariableTargetNode, + ClassVariableWriteNode: () => ClassVariableWriteNode, + ConstantAndWriteNode: () => ConstantAndWriteNode, + ConstantOperatorWriteNode: () => ConstantOperatorWriteNode, + ConstantOrWriteNode: () => ConstantOrWriteNode, + ConstantPathAndWriteNode: () => ConstantPathAndWriteNode, + ConstantPathNode: () => ConstantPathNode, + ConstantPathOperatorWriteNode: () => ConstantPathOperatorWriteNode, + ConstantPathOrWriteNode: () => ConstantPathOrWriteNode, + ConstantPathTargetNode: () => ConstantPathTargetNode, + ConstantPathWriteNode: () => ConstantPathWriteNode, + ConstantReadNode: () => ConstantReadNode, + ConstantTargetNode: () => ConstantTargetNode, + ConstantWriteNode: () => ConstantWriteNode, + DefNode: () => DefNode, + DefinedNode: () => DefinedNode, + ElseNode: () => ElseNode, + EmbeddedStatementsNode: () => EmbeddedStatementsNode, + EmbeddedVariableNode: () => EmbeddedVariableNode, + EnsureNode: () => EnsureNode, + FalseNode: () => FalseNode, + FindPatternNode: () => FindPatternNode, + FlipFlopNode: () => FlipFlopNode, + FloatNode: () => FloatNode, + ForNode: () => ForNode, + ForwardingArgumentsNode: () => ForwardingArgumentsNode, + ForwardingParameterNode: () => ForwardingParameterNode, + ForwardingSuperNode: () => ForwardingSuperNode, + GlobalVariableAndWriteNode: () => GlobalVariableAndWriteNode, + GlobalVariableOperatorWriteNode: () => GlobalVariableOperatorWriteNode, + GlobalVariableOrWriteNode: () => GlobalVariableOrWriteNode, + GlobalVariableReadNode: () => GlobalVariableReadNode, + GlobalVariableTargetNode: () => GlobalVariableTargetNode, + GlobalVariableWriteNode: () => GlobalVariableWriteNode, + HashNode: () => HashNode, + HashPatternNode: () => HashPatternNode, + IfNode: () => IfNode, + ImaginaryNode: () => ImaginaryNode, + ImplicitNode: () => ImplicitNode, + ImplicitRestNode: () => ImplicitRestNode, + InNode: () => InNode, + IndexAndWriteNode: () => IndexAndWriteNode, + IndexOperatorWriteNode: () => IndexOperatorWriteNode, + IndexOrWriteNode: () => IndexOrWriteNode, + IndexTargetNode: () => IndexTargetNode, + InstanceVariableAndWriteNode: () => InstanceVariableAndWriteNode, + InstanceVariableOperatorWriteNode: () => InstanceVariableOperatorWriteNode, + InstanceVariableOrWriteNode: () => InstanceVariableOrWriteNode, + InstanceVariableReadNode: () => InstanceVariableReadNode, + InstanceVariableTargetNode: () => InstanceVariableTargetNode, + InstanceVariableWriteNode: () => InstanceVariableWriteNode, + IntegerNode: () => IntegerNode, + InterpolatedMatchLastLineNode: () => InterpolatedMatchLastLineNode, + InterpolatedRegularExpressionNode: () => InterpolatedRegularExpressionNode, + InterpolatedStringNode: () => InterpolatedStringNode, + InterpolatedSymbolNode: () => InterpolatedSymbolNode, + InterpolatedXStringNode: () => InterpolatedXStringNode, + ItLocalVariableReadNode: () => ItLocalVariableReadNode, + ItParametersNode: () => ItParametersNode, + KeywordHashNode: () => KeywordHashNode, + KeywordRestParameterNode: () => KeywordRestParameterNode, + LambdaNode: () => LambdaNode, + LocalVariableAndWriteNode: () => LocalVariableAndWriteNode, + LocalVariableOperatorWriteNode: () => LocalVariableOperatorWriteNode, + LocalVariableOrWriteNode: () => LocalVariableOrWriteNode, + LocalVariableReadNode: () => LocalVariableReadNode, + LocalVariableTargetNode: () => LocalVariableTargetNode, + LocalVariableWriteNode: () => LocalVariableWriteNode, + MatchLastLineNode: () => MatchLastLineNode, + MatchPredicateNode: () => MatchPredicateNode, + MatchRequiredNode: () => MatchRequiredNode, + MatchWriteNode: () => MatchWriteNode, + MissingNode: () => MissingNode, + ModuleNode: () => ModuleNode, + MultiTargetNode: () => MultiTargetNode, + MultiWriteNode: () => MultiWriteNode, + NextNode: () => NextNode, + NilNode: () => NilNode, + NoKeywordsParameterNode: () => NoKeywordsParameterNode, + NumberedParametersNode: () => NumberedParametersNode, + NumberedReferenceReadNode: () => NumberedReferenceReadNode, + OptionalKeywordParameterNode: () => OptionalKeywordParameterNode, + OptionalParameterNode: () => OptionalParameterNode, + OrNode: () => OrNode, + ParametersNode: () => ParametersNode, + ParenthesesNode: () => ParenthesesNode, + PinnedExpressionNode: () => PinnedExpressionNode, + PinnedVariableNode: () => PinnedVariableNode, + PostExecutionNode: () => PostExecutionNode, + PreExecutionNode: () => PreExecutionNode, + ProgramNode: () => ProgramNode, + RangeNode: () => RangeNode, + RationalNode: () => RationalNode, + RedoNode: () => RedoNode, + RegularExpressionNode: () => RegularExpressionNode, + RequiredKeywordParameterNode: () => RequiredKeywordParameterNode, + RequiredParameterNode: () => RequiredParameterNode, + RescueModifierNode: () => RescueModifierNode, + RescueNode: () => RescueNode, + RestParameterNode: () => RestParameterNode, + RetryNode: () => RetryNode, + ReturnNode: () => ReturnNode, + SelfNode: () => SelfNode, + ShareableConstantNode: () => ShareableConstantNode, + SingletonClassNode: () => SingletonClassNode, + SourceEncodingNode: () => SourceEncodingNode, + SourceFileNode: () => SourceFileNode, + SourceLineNode: () => SourceLineNode, + SplatNode: () => SplatNode, + StatementsNode: () => StatementsNode, + StringNode: () => StringNode, + SuperNode: () => SuperNode, + SymbolNode: () => SymbolNode, + TrueNode: () => TrueNode, + UndefNode: () => UndefNode, + UnlessNode: () => UnlessNode, + UntilNode: () => UntilNode, + WhenNode: () => WhenNode, + WhileNode: () => WhileNode, + XStringNode: () => XStringNode, + YieldNode: () => YieldNode + }); + + // node_modules/@ruby/prism/src/visitor.js + var BasicVisitor = class { + /** + * Calls `accept` on the given node if it is not `null`, which in turn should + * call back into this visitor by calling the appropriate `visit*` method. * - * @param {nodes.ShareableConstantNode} node + * @param {nodes.Node} node */ - visitShareableConstantNode(node) { - this.visitChildNodes(node); + visit(node2) { + node2?.accept(this); } /** - * Visit a SingletonClassNode node. + * Visits each node in `nodes` by calling `accept` on each one. * - * @param {nodes.SingletonClassNode} node + * @param {nodes.Node[]} nodes */ - visitSingletonClassNode(node) { - this.visitChildNodes(node); + visitAll(nodes) { + nodes.forEach((node2) => { + node2?.accept(this); + }); } /** - * Visit a SourceEncodingNode node. + * Visits the child nodes of `node` by calling `accept` on each one. * - * @param {nodes.SourceEncodingNode} node + * @param {nodes.Node} node */ - visitSourceEncodingNode(node) { - this.visitChildNodes(node); + visitChildNodes(node2) { + node2.compactChildNodes().forEach((childNode) => { + childNode.accept(this); + }); } + }; + var Visitor = class extends BasicVisitor { /** - * Visit a SourceFileNode node. + * Visit a AliasGlobalVariableNode node. * - * @param {nodes.SourceFileNode} node + * @param {nodes.AliasGlobalVariableNode} node */ - visitSourceFileNode(node) { - this.visitChildNodes(node); + visitAliasGlobalVariableNode(node2) { + this.visitChildNodes(node2); } /** - * Visit a SourceLineNode node. + * Visit a AliasMethodNode node. * - * @param {nodes.SourceLineNode} node + * @param {nodes.AliasMethodNode} node */ - visitSourceLineNode(node) { - this.visitChildNodes(node); + visitAliasMethodNode(node2) { + this.visitChildNodes(node2); } /** - * Visit a SplatNode node. + * Visit a AlternationPatternNode node. * - * @param {nodes.SplatNode} node + * @param {nodes.AlternationPatternNode} node */ - visitSplatNode(node) { - this.visitChildNodes(node); + visitAlternationPatternNode(node2) { + this.visitChildNodes(node2); } /** - * Visit a StatementsNode node. + * Visit a AndNode node. * - * @param {nodes.StatementsNode} node + * @param {nodes.AndNode} node */ - visitStatementsNode(node) { - this.visitChildNodes(node); + visitAndNode(node2) { + this.visitChildNodes(node2); } /** - * Visit a StringNode node. + * Visit a ArgumentsNode node. * - * @param {nodes.StringNode} node + * @param {nodes.ArgumentsNode} node */ - visitStringNode(node) { - this.visitChildNodes(node); + visitArgumentsNode(node2) { + this.visitChildNodes(node2); } /** - * Visit a SuperNode node. + * Visit a ArrayNode node. * - * @param {nodes.SuperNode} node + * @param {nodes.ArrayNode} node */ - visitSuperNode(node) { - this.visitChildNodes(node); + visitArrayNode(node2) { + this.visitChildNodes(node2); } /** - * Visit a SymbolNode node. + * Visit a ArrayPatternNode node. * - * @param {nodes.SymbolNode} node + * @param {nodes.ArrayPatternNode} node */ - visitSymbolNode(node) { - this.visitChildNodes(node); + visitArrayPatternNode(node2) { + this.visitChildNodes(node2); } /** - * Visit a TrueNode node. + * Visit a AssocNode node. * - * @param {nodes.TrueNode} node + * @param {nodes.AssocNode} node */ - visitTrueNode(node) { - this.visitChildNodes(node); + visitAssocNode(node2) { + this.visitChildNodes(node2); } /** - * Visit a UndefNode node. + * Visit a AssocSplatNode node. * - * @param {nodes.UndefNode} node + * @param {nodes.AssocSplatNode} node */ - visitUndefNode(node) { - this.visitChildNodes(node); + visitAssocSplatNode(node2) { + this.visitChildNodes(node2); } /** - * Visit a UnlessNode node. + * Visit a BackReferenceReadNode node. * - * @param {nodes.UnlessNode} node + * @param {nodes.BackReferenceReadNode} node */ - visitUnlessNode(node) { - this.visitChildNodes(node); + visitBackReferenceReadNode(node2) { + this.visitChildNodes(node2); } /** - * Visit a UntilNode node. + * Visit a BeginNode node. * - * @param {nodes.UntilNode} node + * @param {nodes.BeginNode} node */ - visitUntilNode(node) { - this.visitChildNodes(node); + visitBeginNode(node2) { + this.visitChildNodes(node2); } /** - * Visit a WhenNode node. + * Visit a BlockArgumentNode node. * - * @param {nodes.WhenNode} node + * @param {nodes.BlockArgumentNode} node */ - visitWhenNode(node) { - this.visitChildNodes(node); + visitBlockArgumentNode(node2) { + this.visitChildNodes(node2); } /** - * Visit a WhileNode node. + * Visit a BlockLocalVariableNode node. * - * @param {nodes.WhileNode} node + * @param {nodes.BlockLocalVariableNode} node */ - visitWhileNode(node) { - this.visitChildNodes(node); + visitBlockLocalVariableNode(node2) { + this.visitChildNodes(node2); } /** - * Visit a XStringNode node. + * Visit a BlockNode node. * - * @param {nodes.XStringNode} node + * @param {nodes.BlockNode} node */ - visitXStringNode(node) { - this.visitChildNodes(node); + visitBlockNode(node2) { + this.visitChildNodes(node2); } /** - * Visit a YieldNode node. + * Visit a BlockParameterNode node. * - * @param {nodes.YieldNode} node + * @param {nodes.BlockParameterNode} node */ - visitYieldNode(node) { - this.visitChildNodes(node); + visitBlockParameterNode(node2) { + this.visitChildNodes(node2); } - }; - - // node_modules/@ruby/prism/src/nodes.js - var ArgumentsNodeFlags = { - CONTAINS_FORWARDING: 1 << 2, - CONTAINS_KEYWORDS: 1 << 3, - CONTAINS_KEYWORD_SPLAT: 1 << 4, - CONTAINS_SPLAT: 1 << 5, - CONTAINS_MULTIPLE_SPLATS: 1 << 6 - }; - var ArrayNodeFlags = { - CONTAINS_SPLAT: 1 << 2 - }; - var CallNodeFlags = { - SAFE_NAVIGATION: 1 << 2, - VARIABLE_CALL: 1 << 3, - ATTRIBUTE_WRITE: 1 << 4, - IGNORE_VISIBILITY: 1 << 5 - }; - var EncodingFlags = { - FORCED_UTF8_ENCODING: 1 << 2, - FORCED_BINARY_ENCODING: 1 << 3 - }; - var IntegerBaseFlags = { - BINARY: 1 << 2, - DECIMAL: 1 << 3, - OCTAL: 1 << 4, - HEXADECIMAL: 1 << 5 - }; - var InterpolatedStringNodeFlags = { - FROZEN: 1 << 2, - MUTABLE: 1 << 3 - }; - var KeywordHashNodeFlags = { - SYMBOL_KEYS: 1 << 2 - }; - var LoopFlags = { - BEGIN_MODIFIER: 1 << 2 - }; - var ParameterFlags = { - REPEATED_PARAMETER: 1 << 2 - }; - var ParenthesesNodeFlags = { - MULTIPLE_STATEMENTS: 1 << 2 - }; - var RangeFlags = { - EXCLUDE_END: 1 << 2 - }; - var RegularExpressionFlags = { - IGNORE_CASE: 1 << 2, - EXTENDED: 1 << 3, - MULTI_LINE: 1 << 4, - ONCE: 1 << 5, - EUC_JP: 1 << 6, - ASCII_8BIT: 1 << 7, - WINDOWS_31J: 1 << 8, - UTF_8: 1 << 9, - FORCED_UTF8_ENCODING: 1 << 10, - FORCED_BINARY_ENCODING: 1 << 11, - FORCED_US_ASCII_ENCODING: 1 << 12 - }; - var ShareableConstantNodeFlags = { - LITERAL: 1 << 2, - EXPERIMENTAL_EVERYTHING: 1 << 3, - EXPERIMENTAL_COPY: 1 << 4 - }; - var StringFlags = { - FORCED_UTF8_ENCODING: 1 << 2, - FORCED_BINARY_ENCODING: 1 << 3, - FROZEN: 1 << 4, - MUTABLE: 1 << 5 - }; - var SymbolFlags = { - FORCED_UTF8_ENCODING: 1 << 2, - FORCED_BINARY_ENCODING: 1 << 3, - FORCED_US_ASCII_ENCODING: 1 << 4 - }; - var AliasGlobalVariableNode = class { /** - * @type number + * Visit a BlockParametersNode node. + * + * @param {nodes.BlockParametersNode} node */ - nodeID; + visitBlockParametersNode(node2) { + this.visitChildNodes(node2); + } /** - * @type {Location} + * Visit a BreakNode node. + * + * @param {nodes.BreakNode} node */ - location; + visitBreakNode(node2) { + this.visitChildNodes(node2); + } /** - * @type number + * Visit a CallAndWriteNode node. + * + * @param {nodes.CallAndWriteNode} node */ - #flags; + visitCallAndWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node + * Visit a CallNode node. + * + * @param {nodes.CallNode} node */ - newName; + visitCallNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node + * Visit a CallOperatorWriteNode node. + * + * @param {nodes.CallOperatorWriteNode} node */ - oldName; + visitCallOperatorWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Location + * Visit a CallOrWriteNode node. + * + * @param {nodes.CallOrWriteNode} node */ - keywordLoc; + visitCallOrWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * Construct a new AliasGlobalVariableNode. + * Visit a CallTargetNode node. * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {Node} newName - * @param {Node} oldName - * @param {Location} keywordLoc + * @param {nodes.CallTargetNode} node */ - constructor(nodeID, location, flags, newName, oldName, keywordLoc) { - this.nodeID = nodeID; - this.location = location; - this.#flags = flags; - this.newName = newName; - this.oldName = oldName; - this.keywordLoc = keywordLoc; + visitCallTargetNode(node2) { + this.visitChildNodes(node2); } /** - * Accept a visitor for this node. + * Visit a CapturePatternNode node. * - * @param {visitors.Visitor} visitor + * @param {nodes.CapturePatternNode} node */ - accept(visitor) { - visitor.visitAliasGlobalVariableNode(this); + visitCapturePatternNode(node2) { + this.visitChildNodes(node2); } /** - * Returns all child nodes of the current node. + * Visit a CaseMatchNode node. * - * @returns {(Node | null)[]} An array of child nodes. + * @param {nodes.CaseMatchNode} node */ - childNodes() { - return [this.newName, this.oldName]; + visitCaseMatchNode(node2) { + this.visitChildNodes(node2); } /** - * Compact and return an array of child nodes. + * Visit a CaseNode node. * - * @returns {Node[]} An array of compacted child nodes. + * @param {nodes.CaseNode} node */ - compactChildNodes() { - return [this.newName, this.oldName]; + visitCaseNode(node2) { + this.visitChildNodes(node2); } /** - * Transforms the Node to a JavaScript object. + * Visit a ClassNode node. * - * @returns {Object} + * @param {nodes.ClassNode} node */ - toJSON() { - return { - type: "AliasGlobalVariableNode", - location: this.location, - flags: this.#flags, - newName: this.newName, - oldName: this.oldName, - keywordLoc: this.keywordLoc - }; + visitClassNode(node2) { + this.visitChildNodes(node2); } - }; - var AliasMethodNode = class { /** - * @type number + * Visit a ClassVariableAndWriteNode node. + * + * @param {nodes.ClassVariableAndWriteNode} node */ - nodeID; + visitClassVariableAndWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * @type {Location} + * Visit a ClassVariableOperatorWriteNode node. + * + * @param {nodes.ClassVariableOperatorWriteNode} node */ - location; + visitClassVariableOperatorWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * @type number + * Visit a ClassVariableOrWriteNode node. + * + * @param {nodes.ClassVariableOrWriteNode} node */ - #flags; + visitClassVariableOrWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node + * Visit a ClassVariableReadNode node. + * + * @param {nodes.ClassVariableReadNode} node */ - newName; + visitClassVariableReadNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node + * Visit a ClassVariableTargetNode node. + * + * @param {nodes.ClassVariableTargetNode} node */ - oldName; + visitClassVariableTargetNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Location + * Visit a ClassVariableWriteNode node. + * + * @param {nodes.ClassVariableWriteNode} node */ - keywordLoc; + visitClassVariableWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * Construct a new AliasMethodNode. + * Visit a ConstantAndWriteNode node. * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {Node} newName - * @param {Node} oldName - * @param {Location} keywordLoc + * @param {nodes.ConstantAndWriteNode} node */ - constructor(nodeID, location, flags, newName, oldName, keywordLoc) { - this.nodeID = nodeID; - this.location = location; - this.#flags = flags; - this.newName = newName; - this.oldName = oldName; - this.keywordLoc = keywordLoc; + visitConstantAndWriteNode(node2) { + this.visitChildNodes(node2); } /** - * Accept a visitor for this node. + * Visit a ConstantOperatorWriteNode node. * - * @param {visitors.Visitor} visitor + * @param {nodes.ConstantOperatorWriteNode} node */ - accept(visitor) { - visitor.visitAliasMethodNode(this); + visitConstantOperatorWriteNode(node2) { + this.visitChildNodes(node2); } /** - * Returns all child nodes of the current node. + * Visit a ConstantOrWriteNode node. * - * @returns {(Node | null)[]} An array of child nodes. + * @param {nodes.ConstantOrWriteNode} node */ - childNodes() { - return [this.newName, this.oldName]; + visitConstantOrWriteNode(node2) { + this.visitChildNodes(node2); } /** - * Compact and return an array of child nodes. + * Visit a ConstantPathAndWriteNode node. * - * @returns {Node[]} An array of compacted child nodes. + * @param {nodes.ConstantPathAndWriteNode} node */ - compactChildNodes() { - return [this.newName, this.oldName]; + visitConstantPathAndWriteNode(node2) { + this.visitChildNodes(node2); } /** - * Transforms the Node to a JavaScript object. + * Visit a ConstantPathNode node. * - * @returns {Object} + * @param {nodes.ConstantPathNode} node */ - toJSON() { - return { - type: "AliasMethodNode", - location: this.location, - flags: this.#flags, - newName: this.newName, - oldName: this.oldName, - keywordLoc: this.keywordLoc - }; + visitConstantPathNode(node2) { + this.visitChildNodes(node2); } - }; - var AlternationPatternNode = class { /** - * @type number + * Visit a ConstantPathOperatorWriteNode node. + * + * @param {nodes.ConstantPathOperatorWriteNode} node */ - nodeID; + visitConstantPathOperatorWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * @type {Location} + * Visit a ConstantPathOrWriteNode node. + * + * @param {nodes.ConstantPathOrWriteNode} node */ - location; + visitConstantPathOrWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * @type number + * Visit a ConstantPathTargetNode node. + * + * @param {nodes.ConstantPathTargetNode} node */ - #flags; + visitConstantPathTargetNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node + * Visit a ConstantPathWriteNode node. + * + * @param {nodes.ConstantPathWriteNode} node */ - left; + visitConstantPathWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node + * Visit a ConstantReadNode node. + * + * @param {nodes.ConstantReadNode} node */ - right; + visitConstantReadNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Location + * Visit a ConstantTargetNode node. + * + * @param {nodes.ConstantTargetNode} node */ - operatorLoc; + visitConstantTargetNode(node2) { + this.visitChildNodes(node2); + } /** - * Construct a new AlternationPatternNode. + * Visit a ConstantWriteNode node. * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {Node} left - * @param {Node} right - * @param {Location} operatorLoc + * @param {nodes.ConstantWriteNode} node */ - constructor(nodeID, location, flags, left, right, operatorLoc) { - this.nodeID = nodeID; - this.location = location; - this.#flags = flags; - this.left = left; - this.right = right; - this.operatorLoc = operatorLoc; + visitConstantWriteNode(node2) { + this.visitChildNodes(node2); } /** - * Accept a visitor for this node. + * Visit a DefNode node. * - * @param {visitors.Visitor} visitor + * @param {nodes.DefNode} node */ - accept(visitor) { - visitor.visitAlternationPatternNode(this); + visitDefNode(node2) { + this.visitChildNodes(node2); } /** - * Returns all child nodes of the current node. + * Visit a DefinedNode node. * - * @returns {(Node | null)[]} An array of child nodes. + * @param {nodes.DefinedNode} node */ - childNodes() { - return [this.left, this.right]; + visitDefinedNode(node2) { + this.visitChildNodes(node2); } /** - * Compact and return an array of child nodes. + * Visit a ElseNode node. * - * @returns {Node[]} An array of compacted child nodes. + * @param {nodes.ElseNode} node */ - compactChildNodes() { - return [this.left, this.right]; + visitElseNode(node2) { + this.visitChildNodes(node2); } /** - * Transforms the Node to a JavaScript object. + * Visit a EmbeddedStatementsNode node. * - * @returns {Object} + * @param {nodes.EmbeddedStatementsNode} node */ - toJSON() { - return { - type: "AlternationPatternNode", - location: this.location, - flags: this.#flags, - left: this.left, - right: this.right, - operatorLoc: this.operatorLoc - }; + visitEmbeddedStatementsNode(node2) { + this.visitChildNodes(node2); } - }; - var AndNode = class { /** - * @type number + * Visit a EmbeddedVariableNode node. + * + * @param {nodes.EmbeddedVariableNode} node */ - nodeID; + visitEmbeddedVariableNode(node2) { + this.visitChildNodes(node2); + } /** - * @type {Location} + * Visit a EnsureNode node. + * + * @param {nodes.EnsureNode} node */ - location; + visitEnsureNode(node2) { + this.visitChildNodes(node2); + } /** - * @type number + * Visit a FalseNode node. + * + * @param {nodes.FalseNode} node */ - #flags; + visitFalseNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node + * Visit a FindPatternNode node. + * + * @param {nodes.FindPatternNode} node */ - left; + visitFindPatternNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node + * Visit a FlipFlopNode node. + * + * @param {nodes.FlipFlopNode} node */ - right; + visitFlipFlopNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Location + * Visit a FloatNode node. + * + * @param {nodes.FloatNode} node */ - operatorLoc; + visitFloatNode(node2) { + this.visitChildNodes(node2); + } /** - * Construct a new AndNode. + * Visit a ForNode node. * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {Node} left - * @param {Node} right - * @param {Location} operatorLoc + * @param {nodes.ForNode} node */ - constructor(nodeID, location, flags, left, right, operatorLoc) { - this.nodeID = nodeID; - this.location = location; - this.#flags = flags; - this.left = left; - this.right = right; - this.operatorLoc = operatorLoc; + visitForNode(node2) { + this.visitChildNodes(node2); } /** - * Accept a visitor for this node. + * Visit a ForwardingArgumentsNode node. * - * @param {visitors.Visitor} visitor + * @param {nodes.ForwardingArgumentsNode} node */ - accept(visitor) { - visitor.visitAndNode(this); + visitForwardingArgumentsNode(node2) { + this.visitChildNodes(node2); } /** - * Returns all child nodes of the current node. + * Visit a ForwardingParameterNode node. * - * @returns {(Node | null)[]} An array of child nodes. + * @param {nodes.ForwardingParameterNode} node */ - childNodes() { - return [this.left, this.right]; + visitForwardingParameterNode(node2) { + this.visitChildNodes(node2); } /** - * Compact and return an array of child nodes. + * Visit a ForwardingSuperNode node. * - * @returns {Node[]} An array of compacted child nodes. + * @param {nodes.ForwardingSuperNode} node */ - compactChildNodes() { - return [this.left, this.right]; + visitForwardingSuperNode(node2) { + this.visitChildNodes(node2); } /** - * Transforms the Node to a JavaScript object. + * Visit a GlobalVariableAndWriteNode node. * - * @returns {Object} + * @param {nodes.GlobalVariableAndWriteNode} node */ - toJSON() { - return { - type: "AndNode", - location: this.location, - flags: this.#flags, - left: this.left, - right: this.right, - operatorLoc: this.operatorLoc - }; + visitGlobalVariableAndWriteNode(node2) { + this.visitChildNodes(node2); } - }; - var ArgumentsNode = class { /** - * @type number + * Visit a GlobalVariableOperatorWriteNode node. + * + * @param {nodes.GlobalVariableOperatorWriteNode} node */ - nodeID; + visitGlobalVariableOperatorWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * @type {Location} + * Visit a GlobalVariableOrWriteNode node. + * + * @param {nodes.GlobalVariableOrWriteNode} node */ - location; + visitGlobalVariableOrWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * @type number + * Visit a GlobalVariableReadNode node. + * + * @param {nodes.GlobalVariableReadNode} node */ - #flags; + visitGlobalVariableReadNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node[] + * Visit a GlobalVariableTargetNode node. + * + * @param {nodes.GlobalVariableTargetNode} node */ - arguments_; + visitGlobalVariableTargetNode(node2) { + this.visitChildNodes(node2); + } /** - * Construct a new ArgumentsNode. + * Visit a GlobalVariableWriteNode node. * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {Node[]} arguments_ + * @param {nodes.GlobalVariableWriteNode} node */ - constructor(nodeID, location, flags, arguments_) { - this.nodeID = nodeID; - this.location = location; - this.#flags = flags; - this.arguments_ = arguments_; + visitGlobalVariableWriteNode(node2) { + this.visitChildNodes(node2); } /** - * True if this node has the CONTAINS_FORWARDING flag. + * Visit a HashNode node. * - * @returns {boolean} + * @param {nodes.HashNode} node */ - isContainsForwarding() { - return (this.#flags & ArgumentsNodeFlags.CONTAINS_FORWARDING) !== 0; + visitHashNode(node2) { + this.visitChildNodes(node2); } /** - * True if this node has the CONTAINS_KEYWORDS flag. + * Visit a HashPatternNode node. * - * @returns {boolean} + * @param {nodes.HashPatternNode} node */ - isContainsKeywords() { - return (this.#flags & ArgumentsNodeFlags.CONTAINS_KEYWORDS) !== 0; + visitHashPatternNode(node2) { + this.visitChildNodes(node2); } /** - * True if this node has the CONTAINS_KEYWORD_SPLAT flag. + * Visit a IfNode node. * - * @returns {boolean} + * @param {nodes.IfNode} node */ - isContainsKeywordSplat() { - return (this.#flags & ArgumentsNodeFlags.CONTAINS_KEYWORD_SPLAT) !== 0; + visitIfNode(node2) { + this.visitChildNodes(node2); } /** - * True if this node has the CONTAINS_SPLAT flag. + * Visit a ImaginaryNode node. * - * @returns {boolean} + * @param {nodes.ImaginaryNode} node */ - isContainsSplat() { - return (this.#flags & ArgumentsNodeFlags.CONTAINS_SPLAT) !== 0; + visitImaginaryNode(node2) { + this.visitChildNodes(node2); } /** - * True if this node has the CONTAINS_MULTIPLE_SPLATS flag. + * Visit a ImplicitNode node. * - * @returns {boolean} + * @param {nodes.ImplicitNode} node */ - isContainsMultipleSplats() { - return (this.#flags & ArgumentsNodeFlags.CONTAINS_MULTIPLE_SPLATS) !== 0; + visitImplicitNode(node2) { + this.visitChildNodes(node2); } /** - * Accept a visitor for this node. + * Visit a ImplicitRestNode node. * - * @param {visitors.Visitor} visitor + * @param {nodes.ImplicitRestNode} node */ - accept(visitor) { - visitor.visitArgumentsNode(this); + visitImplicitRestNode(node2) { + this.visitChildNodes(node2); } /** - * Returns all child nodes of the current node. + * Visit a InNode node. * - * @returns {(Node | null)[]} An array of child nodes. + * @param {nodes.InNode} node */ - childNodes() { - return [...this.arguments_]; + visitInNode(node2) { + this.visitChildNodes(node2); } /** - * Compact and return an array of child nodes. + * Visit a IndexAndWriteNode node. * - * @returns {Node[]} An array of compacted child nodes. + * @param {nodes.IndexAndWriteNode} node */ - compactChildNodes() { - return [...this.arguments_]; + visitIndexAndWriteNode(node2) { + this.visitChildNodes(node2); } /** - * Transforms the Node to a JavaScript object. + * Visit a IndexOperatorWriteNode node. * - * @returns {Object} + * @param {nodes.IndexOperatorWriteNode} node */ - toJSON() { - return { - type: "ArgumentsNode", - location: this.location, - flags: this.#flags, - arguments: this.arguments_ - }; + visitIndexOperatorWriteNode(node2) { + this.visitChildNodes(node2); } - }; - var ArrayNode = class { /** - * @type number + * Visit a IndexOrWriteNode node. + * + * @param {nodes.IndexOrWriteNode} node */ - nodeID; + visitIndexOrWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * @type {Location} + * Visit a IndexTargetNode node. + * + * @param {nodes.IndexTargetNode} node */ - location; + visitIndexTargetNode(node2) { + this.visitChildNodes(node2); + } /** - * @type number + * Visit a InstanceVariableAndWriteNode node. + * + * @param {nodes.InstanceVariableAndWriteNode} node */ - #flags; + visitInstanceVariableAndWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node[] + * Visit a InstanceVariableOperatorWriteNode node. + * + * @param {nodes.InstanceVariableOperatorWriteNode} node */ - elements; + visitInstanceVariableOperatorWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Location | null + * Visit a InstanceVariableOrWriteNode node. + * + * @param {nodes.InstanceVariableOrWriteNode} node */ - openingLoc; + visitInstanceVariableOrWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Location | null + * Visit a InstanceVariableReadNode node. + * + * @param {nodes.InstanceVariableReadNode} node */ - closingLoc; + visitInstanceVariableReadNode(node2) { + this.visitChildNodes(node2); + } /** - * Construct a new ArrayNode. + * Visit a InstanceVariableTargetNode node. * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {Node[]} elements - * @param {Location | null} openingLoc - * @param {Location | null} closingLoc + * @param {nodes.InstanceVariableTargetNode} node */ - constructor(nodeID, location, flags, elements, openingLoc, closingLoc) { - this.nodeID = nodeID; - this.location = location; - this.#flags = flags; - this.elements = elements; - this.openingLoc = openingLoc; - this.closingLoc = closingLoc; + visitInstanceVariableTargetNode(node2) { + this.visitChildNodes(node2); } /** - * True if this node has the CONTAINS_SPLAT flag. + * Visit a InstanceVariableWriteNode node. * - * @returns {boolean} + * @param {nodes.InstanceVariableWriteNode} node */ - isContainsSplat() { - return (this.#flags & ArrayNodeFlags.CONTAINS_SPLAT) !== 0; + visitInstanceVariableWriteNode(node2) { + this.visitChildNodes(node2); } /** - * Accept a visitor for this node. + * Visit a IntegerNode node. * - * @param {visitors.Visitor} visitor + * @param {nodes.IntegerNode} node */ - accept(visitor) { - visitor.visitArrayNode(this); + visitIntegerNode(node2) { + this.visitChildNodes(node2); } /** - * Returns all child nodes of the current node. + * Visit a InterpolatedMatchLastLineNode node. * - * @returns {(Node | null)[]} An array of child nodes. + * @param {nodes.InterpolatedMatchLastLineNode} node */ - childNodes() { - return [...this.elements]; + visitInterpolatedMatchLastLineNode(node2) { + this.visitChildNodes(node2); } /** - * Compact and return an array of child nodes. + * Visit a InterpolatedRegularExpressionNode node. * - * @returns {Node[]} An array of compacted child nodes. + * @param {nodes.InterpolatedRegularExpressionNode} node */ - compactChildNodes() { - return [...this.elements]; + visitInterpolatedRegularExpressionNode(node2) { + this.visitChildNodes(node2); } /** - * Transforms the Node to a JavaScript object. + * Visit a InterpolatedStringNode node. * - * @returns {Object} + * @param {nodes.InterpolatedStringNode} node */ - toJSON() { - return { - type: "ArrayNode", - location: this.location, - flags: this.#flags, - elements: this.elements, - openingLoc: this.openingLoc, - closingLoc: this.closingLoc - }; + visitInterpolatedStringNode(node2) { + this.visitChildNodes(node2); } - }; - var ArrayPatternNode = class { /** - * @type number + * Visit a InterpolatedSymbolNode node. + * + * @param {nodes.InterpolatedSymbolNode} node */ - nodeID; + visitInterpolatedSymbolNode(node2) { + this.visitChildNodes(node2); + } /** - * @type {Location} + * Visit a InterpolatedXStringNode node. + * + * @param {nodes.InterpolatedXStringNode} node */ - location; + visitInterpolatedXStringNode(node2) { + this.visitChildNodes(node2); + } /** - * @type number + * Visit a ItLocalVariableReadNode node. + * + * @param {nodes.ItLocalVariableReadNode} node */ - #flags; + visitItLocalVariableReadNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node | null + * Visit a ItParametersNode node. + * + * @param {nodes.ItParametersNode} node */ - constant; + visitItParametersNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node[] + * Visit a KeywordHashNode node. + * + * @param {nodes.KeywordHashNode} node */ - requireds; + visitKeywordHashNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node | null + * Visit a KeywordRestParameterNode node. + * + * @param {nodes.KeywordRestParameterNode} node */ - rest; + visitKeywordRestParameterNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node[] + * Visit a LambdaNode node. + * + * @param {nodes.LambdaNode} node */ - posts; + visitLambdaNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Location | null + * Visit a LocalVariableAndWriteNode node. + * + * @param {nodes.LocalVariableAndWriteNode} node */ - openingLoc; + visitLocalVariableAndWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Location | null + * Visit a LocalVariableOperatorWriteNode node. + * + * @param {nodes.LocalVariableOperatorWriteNode} node */ - closingLoc; + visitLocalVariableOperatorWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * Construct a new ArrayPatternNode. + * Visit a LocalVariableOrWriteNode node. * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {Node | null} constant - * @param {Node[]} requireds - * @param {Node | null} rest - * @param {Node[]} posts - * @param {Location | null} openingLoc - * @param {Location | null} closingLoc + * @param {nodes.LocalVariableOrWriteNode} node */ - constructor(nodeID, location, flags, constant, requireds, rest, posts, openingLoc, closingLoc) { - this.nodeID = nodeID; - this.location = location; - this.#flags = flags; - this.constant = constant; - this.requireds = requireds; - this.rest = rest; - this.posts = posts; - this.openingLoc = openingLoc; - this.closingLoc = closingLoc; + visitLocalVariableOrWriteNode(node2) { + this.visitChildNodes(node2); } /** - * Accept a visitor for this node. + * Visit a LocalVariableReadNode node. * - * @param {visitors.Visitor} visitor + * @param {nodes.LocalVariableReadNode} node */ - accept(visitor) { - visitor.visitArrayPatternNode(this); + visitLocalVariableReadNode(node2) { + this.visitChildNodes(node2); } /** - * Returns all child nodes of the current node. + * Visit a LocalVariableTargetNode node. * - * @returns {(Node | null)[]} An array of child nodes. + * @param {nodes.LocalVariableTargetNode} node */ - childNodes() { - return [this.constant, ...this.requireds, this.rest, ...this.posts]; + visitLocalVariableTargetNode(node2) { + this.visitChildNodes(node2); } /** - * Compact and return an array of child nodes. + * Visit a LocalVariableWriteNode node. * - * @returns {Node[]} An array of compacted child nodes. + * @param {nodes.LocalVariableWriteNode} node */ - compactChildNodes() { - const compact = []; - if (this.constant) { - compact.push(this.constant); - } - compact.concat(this.requireds); - if (this.rest) { - compact.push(this.rest); - } - compact.concat(this.posts); - return compact; + visitLocalVariableWriteNode(node2) { + this.visitChildNodes(node2); } /** - * Transforms the Node to a JavaScript object. + * Visit a MatchLastLineNode node. * - * @returns {Object} + * @param {nodes.MatchLastLineNode} node */ - toJSON() { - return { - type: "ArrayPatternNode", - location: this.location, - flags: this.#flags, - constant: this.constant, - requireds: this.requireds, - rest: this.rest, - posts: this.posts, - openingLoc: this.openingLoc, - closingLoc: this.closingLoc - }; + visitMatchLastLineNode(node2) { + this.visitChildNodes(node2); } - }; - var AssocNode = class { /** - * @type number + * Visit a MatchPredicateNode node. + * + * @param {nodes.MatchPredicateNode} node */ - nodeID; + visitMatchPredicateNode(node2) { + this.visitChildNodes(node2); + } /** - * @type {Location} + * Visit a MatchRequiredNode node. + * + * @param {nodes.MatchRequiredNode} node */ - location; + visitMatchRequiredNode(node2) { + this.visitChildNodes(node2); + } /** - * @type number + * Visit a MatchWriteNode node. + * + * @param {nodes.MatchWriteNode} node */ - #flags; + visitMatchWriteNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node + * Visit a MissingNode node. + * + * @param {nodes.MissingNode} node */ - key; + visitMissingNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node + * Visit a ModuleNode node. + * + * @param {nodes.ModuleNode} node */ - value; + visitModuleNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Location | null + * Visit a MultiTargetNode node. + * + * @param {nodes.MultiTargetNode} node */ - operatorLoc; + visitMultiTargetNode(node2) { + this.visitChildNodes(node2); + } /** - * Construct a new AssocNode. + * Visit a MultiWriteNode node. * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {Node} key - * @param {Node} value - * @param {Location | null} operatorLoc + * @param {nodes.MultiWriteNode} node */ - constructor(nodeID, location, flags, key, value, operatorLoc) { - this.nodeID = nodeID; - this.location = location; - this.#flags = flags; - this.key = key; - this.value = value; - this.operatorLoc = operatorLoc; + visitMultiWriteNode(node2) { + this.visitChildNodes(node2); } /** - * Accept a visitor for this node. + * Visit a NextNode node. * - * @param {visitors.Visitor} visitor + * @param {nodes.NextNode} node */ - accept(visitor) { - visitor.visitAssocNode(this); + visitNextNode(node2) { + this.visitChildNodes(node2); } /** - * Returns all child nodes of the current node. + * Visit a NilNode node. * - * @returns {(Node | null)[]} An array of child nodes. + * @param {nodes.NilNode} node */ - childNodes() { - return [this.key, this.value]; + visitNilNode(node2) { + this.visitChildNodes(node2); } /** - * Compact and return an array of child nodes. + * Visit a NoKeywordsParameterNode node. * - * @returns {Node[]} An array of compacted child nodes. + * @param {nodes.NoKeywordsParameterNode} node */ - compactChildNodes() { - return [this.key, this.value]; + visitNoKeywordsParameterNode(node2) { + this.visitChildNodes(node2); } /** - * Transforms the Node to a JavaScript object. + * Visit a NumberedParametersNode node. * - * @returns {Object} + * @param {nodes.NumberedParametersNode} node */ - toJSON() { - return { - type: "AssocNode", - location: this.location, - flags: this.#flags, - key: this.key, - value: this.value, - operatorLoc: this.operatorLoc - }; + visitNumberedParametersNode(node2) { + this.visitChildNodes(node2); } - }; - var AssocSplatNode = class { /** - * @type number + * Visit a NumberedReferenceReadNode node. + * + * @param {nodes.NumberedReferenceReadNode} node */ - nodeID; + visitNumberedReferenceReadNode(node2) { + this.visitChildNodes(node2); + } /** - * @type {Location} + * Visit a OptionalKeywordParameterNode node. + * + * @param {nodes.OptionalKeywordParameterNode} node */ - location; + visitOptionalKeywordParameterNode(node2) { + this.visitChildNodes(node2); + } /** - * @type number + * Visit a OptionalParameterNode node. + * + * @param {nodes.OptionalParameterNode} node */ - #flags; + visitOptionalParameterNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node | null + * Visit a OrNode node. + * + * @param {nodes.OrNode} node */ - value; + visitOrNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Location + * Visit a ParametersNode node. + * + * @param {nodes.ParametersNode} node */ - operatorLoc; + visitParametersNode(node2) { + this.visitChildNodes(node2); + } /** - * Construct a new AssocSplatNode. + * Visit a ParenthesesNode node. * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {Node | null} value - * @param {Location} operatorLoc + * @param {nodes.ParenthesesNode} node */ - constructor(nodeID, location, flags, value, operatorLoc) { - this.nodeID = nodeID; - this.location = location; - this.#flags = flags; - this.value = value; - this.operatorLoc = operatorLoc; + visitParenthesesNode(node2) { + this.visitChildNodes(node2); } /** - * Accept a visitor for this node. + * Visit a PinnedExpressionNode node. * - * @param {visitors.Visitor} visitor + * @param {nodes.PinnedExpressionNode} node */ - accept(visitor) { - visitor.visitAssocSplatNode(this); + visitPinnedExpressionNode(node2) { + this.visitChildNodes(node2); } /** - * Returns all child nodes of the current node. + * Visit a PinnedVariableNode node. * - * @returns {(Node | null)[]} An array of child nodes. + * @param {nodes.PinnedVariableNode} node */ - childNodes() { - return [this.value]; + visitPinnedVariableNode(node2) { + this.visitChildNodes(node2); } /** - * Compact and return an array of child nodes. + * Visit a PostExecutionNode node. * - * @returns {Node[]} An array of compacted child nodes. + * @param {nodes.PostExecutionNode} node */ - compactChildNodes() { - const compact = []; - if (this.value) { - compact.push(this.value); - } - return compact; + visitPostExecutionNode(node2) { + this.visitChildNodes(node2); } /** - * Transforms the Node to a JavaScript object. + * Visit a PreExecutionNode node. * - * @returns {Object} + * @param {nodes.PreExecutionNode} node */ - toJSON() { - return { - type: "AssocSplatNode", - location: this.location, - flags: this.#flags, - value: this.value, - operatorLoc: this.operatorLoc - }; + visitPreExecutionNode(node2) { + this.visitChildNodes(node2); } - }; - var BackReferenceReadNode = class { /** - * @type number + * Visit a ProgramNode node. + * + * @param {nodes.ProgramNode} node */ - nodeID; + visitProgramNode(node2) { + this.visitChildNodes(node2); + } /** - * @type {Location} + * Visit a RangeNode node. + * + * @param {nodes.RangeNode} node */ - location; + visitRangeNode(node2) { + this.visitChildNodes(node2); + } /** - * @type number + * Visit a RationalNode node. + * + * @param {nodes.RationalNode} node */ - #flags; + visitRationalNode(node2) { + this.visitChildNodes(node2); + } /** - * @type string + * Visit a RedoNode node. + * + * @param {nodes.RedoNode} node */ - name; + visitRedoNode(node2) { + this.visitChildNodes(node2); + } /** - * Construct a new BackReferenceReadNode. + * Visit a RegularExpressionNode node. * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {string} name + * @param {nodes.RegularExpressionNode} node */ - constructor(nodeID, location, flags, name2) { - this.nodeID = nodeID; - this.location = location; - this.#flags = flags; - this.name = name2; + visitRegularExpressionNode(node2) { + this.visitChildNodes(node2); } /** - * Accept a visitor for this node. + * Visit a RequiredKeywordParameterNode node. * - * @param {visitors.Visitor} visitor + * @param {nodes.RequiredKeywordParameterNode} node */ - accept(visitor) { - visitor.visitBackReferenceReadNode(this); + visitRequiredKeywordParameterNode(node2) { + this.visitChildNodes(node2); } /** - * Returns all child nodes of the current node. + * Visit a RequiredParameterNode node. * - * @returns {(Node | null)[]} An array of child nodes. + * @param {nodes.RequiredParameterNode} node */ - childNodes() { - return []; + visitRequiredParameterNode(node2) { + this.visitChildNodes(node2); } /** - * Compact and return an array of child nodes. + * Visit a RescueModifierNode node. * - * @returns {Node[]} An array of compacted child nodes. + * @param {nodes.RescueModifierNode} node */ - compactChildNodes() { - return []; + visitRescueModifierNode(node2) { + this.visitChildNodes(node2); } /** - * Transforms the Node to a JavaScript object. + * Visit a RescueNode node. * - * @returns {Object} + * @param {nodes.RescueNode} node */ - toJSON() { - return { - type: "BackReferenceReadNode", - location: this.location, - flags: this.#flags, - name: this.name - }; + visitRescueNode(node2) { + this.visitChildNodes(node2); } - }; - var BeginNode = class { /** - * @type number + * Visit a RestParameterNode node. + * + * @param {nodes.RestParameterNode} node */ - nodeID; + visitRestParameterNode(node2) { + this.visitChildNodes(node2); + } /** - * @type {Location} + * Visit a RetryNode node. + * + * @param {nodes.RetryNode} node */ - location; + visitRetryNode(node2) { + this.visitChildNodes(node2); + } /** - * @type number + * Visit a ReturnNode node. + * + * @param {nodes.ReturnNode} node */ - #flags; - /** - * @type Location | null - */ - beginKeywordLoc; - /** - * @type StatementsNode | null - */ - statements; + visitReturnNode(node2) { + this.visitChildNodes(node2); + } /** - * @type RescueNode | null + * Visit a SelfNode node. + * + * @param {nodes.SelfNode} node */ - rescueClause; + visitSelfNode(node2) { + this.visitChildNodes(node2); + } /** - * @type ElseNode | null + * Visit a ShareableConstantNode node. + * + * @param {nodes.ShareableConstantNode} node */ - elseClause; + visitShareableConstantNode(node2) { + this.visitChildNodes(node2); + } /** - * @type EnsureNode | null + * Visit a SingletonClassNode node. + * + * @param {nodes.SingletonClassNode} node */ - ensureClause; + visitSingletonClassNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Location | null + * Visit a SourceEncodingNode node. + * + * @param {nodes.SourceEncodingNode} node */ - endKeywordLoc; + visitSourceEncodingNode(node2) { + this.visitChildNodes(node2); + } /** - * Construct a new BeginNode. + * Visit a SourceFileNode node. * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {Location | null} beginKeywordLoc - * @param {StatementsNode | null} statements - * @param {RescueNode | null} rescueClause - * @param {ElseNode | null} elseClause - * @param {EnsureNode | null} ensureClause - * @param {Location | null} endKeywordLoc + * @param {nodes.SourceFileNode} node */ - constructor(nodeID, location, flags, beginKeywordLoc, statements, rescueClause, elseClause, ensureClause, endKeywordLoc) { - this.nodeID = nodeID; - this.location = location; - this.#flags = flags; - this.beginKeywordLoc = beginKeywordLoc; - this.statements = statements; - this.rescueClause = rescueClause; - this.elseClause = elseClause; - this.ensureClause = ensureClause; - this.endKeywordLoc = endKeywordLoc; + visitSourceFileNode(node2) { + this.visitChildNodes(node2); } /** - * Accept a visitor for this node. + * Visit a SourceLineNode node. * - * @param {visitors.Visitor} visitor + * @param {nodes.SourceLineNode} node */ - accept(visitor) { - visitor.visitBeginNode(this); + visitSourceLineNode(node2) { + this.visitChildNodes(node2); } /** - * Returns all child nodes of the current node. + * Visit a SplatNode node. * - * @returns {(Node | null)[]} An array of child nodes. + * @param {nodes.SplatNode} node */ - childNodes() { - return [this.statements, this.rescueClause, this.elseClause, this.ensureClause]; + visitSplatNode(node2) { + this.visitChildNodes(node2); } /** - * Compact and return an array of child nodes. + * Visit a StatementsNode node. * - * @returns {Node[]} An array of compacted child nodes. + * @param {nodes.StatementsNode} node */ - compactChildNodes() { - const compact = []; - if (this.statements) { - compact.push(this.statements); - } - if (this.rescueClause) { - compact.push(this.rescueClause); - } - if (this.elseClause) { - compact.push(this.elseClause); - } - if (this.ensureClause) { - compact.push(this.ensureClause); - } - return compact; + visitStatementsNode(node2) { + this.visitChildNodes(node2); } /** - * Transforms the Node to a JavaScript object. + * Visit a StringNode node. * - * @returns {Object} + * @param {nodes.StringNode} node */ - toJSON() { - return { - type: "BeginNode", - location: this.location, - flags: this.#flags, - beginKeywordLoc: this.beginKeywordLoc, - statements: this.statements, - rescueClause: this.rescueClause, - elseClause: this.elseClause, - ensureClause: this.ensureClause, - endKeywordLoc: this.endKeywordLoc - }; + visitStringNode(node2) { + this.visitChildNodes(node2); } - }; - var BlockArgumentNode = class { /** - * @type number + * Visit a SuperNode node. + * + * @param {nodes.SuperNode} node */ - nodeID; + visitSuperNode(node2) { + this.visitChildNodes(node2); + } /** - * @type {Location} + * Visit a SymbolNode node. + * + * @param {nodes.SymbolNode} node */ - location; + visitSymbolNode(node2) { + this.visitChildNodes(node2); + } /** - * @type number + * Visit a TrueNode node. + * + * @param {nodes.TrueNode} node */ - #flags; + visitTrueNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Node | null + * Visit a UndefNode node. + * + * @param {nodes.UndefNode} node */ - expression; + visitUndefNode(node2) { + this.visitChildNodes(node2); + } /** - * @type Location + * Visit a UnlessNode node. + * + * @param {nodes.UnlessNode} node */ - operatorLoc; + visitUnlessNode(node2) { + this.visitChildNodes(node2); + } /** - * Construct a new BlockArgumentNode. + * Visit a UntilNode node. * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {Node | null} expression - * @param {Location} operatorLoc + * @param {nodes.UntilNode} node */ - constructor(nodeID, location, flags, expression, operatorLoc) { - this.nodeID = nodeID; - this.location = location; - this.#flags = flags; - this.expression = expression; - this.operatorLoc = operatorLoc; + visitUntilNode(node2) { + this.visitChildNodes(node2); } /** - * Accept a visitor for this node. + * Visit a WhenNode node. * - * @param {visitors.Visitor} visitor + * @param {nodes.WhenNode} node */ - accept(visitor) { - visitor.visitBlockArgumentNode(this); + visitWhenNode(node2) { + this.visitChildNodes(node2); } /** - * Returns all child nodes of the current node. + * Visit a WhileNode node. * - * @returns {(Node | null)[]} An array of child nodes. + * @param {nodes.WhileNode} node */ - childNodes() { - return [this.expression]; + visitWhileNode(node2) { + this.visitChildNodes(node2); } /** - * Compact and return an array of child nodes. + * Visit a XStringNode node. * - * @returns {Node[]} An array of compacted child nodes. + * @param {nodes.XStringNode} node */ - compactChildNodes() { - const compact = []; - if (this.expression) { - compact.push(this.expression); - } - return compact; + visitXStringNode(node2) { + this.visitChildNodes(node2); } /** - * Transforms the Node to a JavaScript object. + * Visit a YieldNode node. * - * @returns {Object} + * @param {nodes.YieldNode} node */ - toJSON() { - return { - type: "BlockArgumentNode", - location: this.location, - flags: this.#flags, - expression: this.expression, - operatorLoc: this.operatorLoc - }; + visitYieldNode(node2) { + this.visitChildNodes(node2); } }; - var BlockLocalVariableNode = class { + + // node_modules/@ruby/prism/src/nodes.js + var ArgumentsNodeFlags = { + CONTAINS_FORWARDING: 1 << 2, + CONTAINS_KEYWORDS: 1 << 3, + CONTAINS_KEYWORD_SPLAT: 1 << 4, + CONTAINS_SPLAT: 1 << 5, + CONTAINS_MULTIPLE_SPLATS: 1 << 6 + }; + var ArrayNodeFlags = { + CONTAINS_SPLAT: 1 << 2 + }; + var CallNodeFlags = { + SAFE_NAVIGATION: 1 << 2, + VARIABLE_CALL: 1 << 3, + ATTRIBUTE_WRITE: 1 << 4, + IGNORE_VISIBILITY: 1 << 5 + }; + var EncodingFlags = { + FORCED_UTF8_ENCODING: 1 << 2, + FORCED_BINARY_ENCODING: 1 << 3 + }; + var IntegerBaseFlags = { + BINARY: 1 << 2, + DECIMAL: 1 << 3, + OCTAL: 1 << 4, + HEXADECIMAL: 1 << 5 + }; + var InterpolatedStringNodeFlags = { + FROZEN: 1 << 2, + MUTABLE: 1 << 3 + }; + var KeywordHashNodeFlags = { + SYMBOL_KEYS: 1 << 2 + }; + var LoopFlags = { + BEGIN_MODIFIER: 1 << 2 + }; + var ParameterFlags = { + REPEATED_PARAMETER: 1 << 2 + }; + var ParenthesesNodeFlags = { + MULTIPLE_STATEMENTS: 1 << 2 + }; + var RangeFlags = { + EXCLUDE_END: 1 << 2 + }; + var RegularExpressionFlags = { + IGNORE_CASE: 1 << 2, + EXTENDED: 1 << 3, + MULTI_LINE: 1 << 4, + ONCE: 1 << 5, + EUC_JP: 1 << 6, + ASCII_8BIT: 1 << 7, + WINDOWS_31J: 1 << 8, + UTF_8: 1 << 9, + FORCED_UTF8_ENCODING: 1 << 10, + FORCED_BINARY_ENCODING: 1 << 11, + FORCED_US_ASCII_ENCODING: 1 << 12 + }; + var ShareableConstantNodeFlags = { + LITERAL: 1 << 2, + EXPERIMENTAL_EVERYTHING: 1 << 3, + EXPERIMENTAL_COPY: 1 << 4 + }; + var StringFlags = { + FORCED_UTF8_ENCODING: 1 << 2, + FORCED_BINARY_ENCODING: 1 << 3, + FROZEN: 1 << 4, + MUTABLE: 1 << 5 + }; + var SymbolFlags = { + FORCED_UTF8_ENCODING: 1 << 2, + FORCED_BINARY_ENCODING: 1 << 3, + FORCED_US_ASCII_ENCODING: 1 << 4 + }; + var AliasGlobalVariableNode = class { /** * @type number */ @@ -4690,30 +14075,34 @@ var HerbLinter = (() => { */ #flags; /** - * @type string + * @type Node */ - name; + newName; /** - * Construct a new BlockLocalVariableNode. + * @type Node + */ + oldName; + /** + * @type Location + */ + keywordLoc; + /** + * Construct a new AliasGlobalVariableNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name + * @param {Node} newName + * @param {Node} oldName + * @param {Location} keywordLoc */ - constructor(nodeID, location, flags, name2) { + constructor(nodeID, location, flags, newName, oldName, keywordLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; - } - /** - * True if this node has the REPEATED_PARAMETER flag. - * - * @returns {boolean} - */ - isRepeatedParameter() { - return (this.#flags & ParameterFlags.REPEATED_PARAMETER) !== 0; + this.newName = newName; + this.oldName = oldName; + this.keywordLoc = keywordLoc; } /** * Accept a visitor for this node. @@ -4721,7 +14110,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitBlockLocalVariableNode(this); + visitor.visitAliasGlobalVariableNode(this); } /** * Returns all child nodes of the current node. @@ -4729,7 +14118,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.newName, this.oldName]; } /** * Compact and return an array of child nodes. @@ -4737,7 +14126,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + return [this.newName, this.oldName]; } /** * Transforms the Node to a JavaScript object. @@ -4746,14 +14135,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "BlockLocalVariableNode", + type: "AliasGlobalVariableNode", location: this.location, flags: this.#flags, - name: this.name + newName: this.newName, + oldName: this.oldName, + keywordLoc: this.keywordLoc }; } }; - var BlockNode = class { + var AliasMethodNode = class { /** * @type number */ @@ -4767,46 +14158,34 @@ var HerbLinter = (() => { */ #flags; /** - * @type string[] - */ - locals; - /** - * @type Node | null - */ - parameters; - /** - * @type Node | null + * @type Node */ - body; + newName; /** - * @type Location + * @type Node */ - openingLoc; + oldName; /** * @type Location */ - closingLoc; + keywordLoc; /** - * Construct a new BlockNode. + * Construct a new AliasMethodNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string[]} locals - * @param {Node | null} parameters - * @param {Node | null} body - * @param {Location} openingLoc - * @param {Location} closingLoc + * @param {Node} newName + * @param {Node} oldName + * @param {Location} keywordLoc */ - constructor(nodeID, location, flags, locals, parameters, body, openingLoc, closingLoc) { + constructor(nodeID, location, flags, newName, oldName, keywordLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.locals = locals; - this.parameters = parameters; - this.body = body; - this.openingLoc = openingLoc; - this.closingLoc = closingLoc; + this.newName = newName; + this.oldName = oldName; + this.keywordLoc = keywordLoc; } /** * Accept a visitor for this node. @@ -4814,7 +14193,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitBlockNode(this); + visitor.visitAliasMethodNode(this); } /** * Returns all child nodes of the current node. @@ -4822,7 +14201,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.parameters, this.body]; + return [this.newName, this.oldName]; } /** * Compact and return an array of child nodes. @@ -4830,14 +14209,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.parameters) { - compact.push(this.parameters); - } - if (this.body) { - compact.push(this.body); - } - return compact; + return [this.newName, this.oldName]; } /** * Transforms the Node to a JavaScript object. @@ -4846,18 +14218,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "BlockNode", + type: "AliasMethodNode", location: this.location, flags: this.#flags, - locals: this.locals, - parameters: this.parameters, - body: this.body, - openingLoc: this.openingLoc, - closingLoc: this.closingLoc + newName: this.newName, + oldName: this.oldName, + keywordLoc: this.keywordLoc }; } }; - var BlockParameterNode = class { + var AlternationPatternNode = class { /** * @type number */ @@ -4871,50 +14241,42 @@ var HerbLinter = (() => { */ #flags; /** - * @type string | null + * @type Node */ - name; + left; /** - * @type Location | null + * @type Node */ - nameLoc; + right; /** * @type Location */ operatorLoc; /** - * Construct a new BlockParameterNode. + * Construct a new AlternationPatternNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string | null} name - * @param {Location | null} nameLoc + * @param {Node} left + * @param {Node} right * @param {Location} operatorLoc */ - constructor(nodeID, location, flags, name2, nameLoc, operatorLoc) { + constructor(nodeID, location, flags, left, right, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; - this.nameLoc = nameLoc; + this.left = left; + this.right = right; this.operatorLoc = operatorLoc; } - /** - * True if this node has the REPEATED_PARAMETER flag. - * - * @returns {boolean} - */ - isRepeatedParameter() { - return (this.#flags & ParameterFlags.REPEATED_PARAMETER) !== 0; - } /** * Accept a visitor for this node. * * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitBlockParameterNode(this); + visitor.visitAlternationPatternNode(this); } /** * Returns all child nodes of the current node. @@ -4922,7 +14284,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.left, this.right]; } /** * Compact and return an array of child nodes. @@ -4930,7 +14292,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + return [this.left, this.right]; } /** * Transforms the Node to a JavaScript object. @@ -4939,16 +14301,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "BlockParameterNode", + type: "AlternationPatternNode", location: this.location, flags: this.#flags, - name: this.name, - nameLoc: this.nameLoc, + left: this.left, + right: this.right, operatorLoc: this.operatorLoc }; } }; - var BlockParametersNode = class { + var AndNode = class { /** * @type number */ @@ -4962,40 +14324,34 @@ var HerbLinter = (() => { */ #flags; /** - * @type ParametersNode | null - */ - parameters; - /** - * @type Node[] + * @type Node */ - locals; + left; /** - * @type Location | null + * @type Node */ - openingLoc; + right; /** - * @type Location | null + * @type Location */ - closingLoc; + operatorLoc; /** - * Construct a new BlockParametersNode. + * Construct a new AndNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {ParametersNode | null} parameters - * @param {Node[]} locals - * @param {Location | null} openingLoc - * @param {Location | null} closingLoc + * @param {Node} left + * @param {Node} right + * @param {Location} operatorLoc */ - constructor(nodeID, location, flags, parameters, locals, openingLoc, closingLoc) { + constructor(nodeID, location, flags, left, right, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.parameters = parameters; - this.locals = locals; - this.openingLoc = openingLoc; - this.closingLoc = closingLoc; + this.left = left; + this.right = right; + this.operatorLoc = operatorLoc; } /** * Accept a visitor for this node. @@ -5003,7 +14359,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitBlockParametersNode(this); + visitor.visitAndNode(this); } /** * Returns all child nodes of the current node. @@ -5011,7 +14367,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.parameters, ...this.locals]; + return [this.left, this.right]; } /** * Compact and return an array of child nodes. @@ -5019,12 +14375,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.parameters) { - compact.push(this.parameters); - } - compact.concat(this.locals); - return compact; + return [this.left, this.right]; } /** * Transforms the Node to a JavaScript object. @@ -5033,17 +14384,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "BlockParametersNode", + type: "AndNode", location: this.location, flags: this.#flags, - parameters: this.parameters, - locals: this.locals, - openingLoc: this.openingLoc, - closingLoc: this.closingLoc + left: this.left, + right: this.right, + operatorLoc: this.operatorLoc }; } }; - var BreakNode = class { + var ArgumentsNode = class { /** * @type number */ @@ -5057,73 +14407,102 @@ var HerbLinter = (() => { */ #flags; /** - * @type ArgumentsNode | null + * @type Node[] */ arguments_; /** - * @type Location - */ - keywordLoc; - /** - * Construct a new BreakNode. + * Construct a new ArgumentsNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {ArgumentsNode | null} arguments_ - * @param {Location} keywordLoc + * @param {Node[]} arguments_ */ - constructor(nodeID, location, flags, arguments_, keywordLoc) { + constructor(nodeID, location, flags, arguments_) { this.nodeID = nodeID; this.location = location; this.#flags = flags; this.arguments_ = arguments_; - this.keywordLoc = keywordLoc; } /** - * Accept a visitor for this node. + * True if this node has the CONTAINS_FORWARDING flag. * - * @param {visitors.Visitor} visitor + * @returns {boolean} */ - accept(visitor) { - visitor.visitBreakNode(this); + isContainsForwarding() { + return (this.#flags & ArgumentsNodeFlags.CONTAINS_FORWARDING) !== 0; } /** - * Returns all child nodes of the current node. + * True if this node has the CONTAINS_KEYWORDS flag. * - * @returns {(Node | null)[]} An array of child nodes. + * @returns {boolean} */ - childNodes() { - return [this.arguments_]; + isContainsKeywords() { + return (this.#flags & ArgumentsNodeFlags.CONTAINS_KEYWORDS) !== 0; } /** - * Compact and return an array of child nodes. + * True if this node has the CONTAINS_KEYWORD_SPLAT flag. * - * @returns {Node[]} An array of compacted child nodes. + * @returns {boolean} */ - compactChildNodes() { - const compact = []; - if (this.arguments_) { - compact.push(this.arguments_); - } - return compact; + isContainsKeywordSplat() { + return (this.#flags & ArgumentsNodeFlags.CONTAINS_KEYWORD_SPLAT) !== 0; } /** - * Transforms the Node to a JavaScript object. + * True if this node has the CONTAINS_SPLAT flag. + * + * @returns {boolean} + */ + isContainsSplat() { + return (this.#flags & ArgumentsNodeFlags.CONTAINS_SPLAT) !== 0; + } + /** + * True if this node has the CONTAINS_MULTIPLE_SPLATS flag. + * + * @returns {boolean} + */ + isContainsMultipleSplats() { + return (this.#flags & ArgumentsNodeFlags.CONTAINS_MULTIPLE_SPLATS) !== 0; + } + /** + * Accept a visitor for this node. + * + * @param {visitors.Visitor} visitor + */ + accept(visitor) { + visitor.visitArgumentsNode(this); + } + /** + * Returns all child nodes of the current node. + * + * @returns {(Node | null)[]} An array of child nodes. + */ + childNodes() { + return [...this.arguments_]; + } + /** + * Compact and return an array of child nodes. + * + * @returns {Node[]} An array of compacted child nodes. + */ + compactChildNodes() { + return [...this.arguments_]; + } + /** + * Transforms the Node to a JavaScript object. * * @returns {Object} */ toJSON() { return { - type: "BreakNode", + type: "ArgumentsNode", location: this.location, flags: this.#flags, - arguments: this.arguments_, - keywordLoc: this.keywordLoc + arguments: this.arguments_ }; } }; - var CallAndWriteNode = class { + var ArrayNode = class { /** * @type number */ @@ -5137,90 +14516,42 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node | null + * @type Node[] */ - receiver; + elements; /** * @type Location | null */ - callOperatorLoc; + openingLoc; /** * @type Location | null */ - messageLoc; - /** - * @type string - */ - readName; - /** - * @type string - */ - writeName; - /** - * @type Location - */ - operatorLoc; - /** - * @type Node - */ - value; + closingLoc; /** - * Construct a new CallAndWriteNode. + * Construct a new ArrayNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node | null} receiver - * @param {Location | null} callOperatorLoc - * @param {Location | null} messageLoc - * @param {string} readName - * @param {string} writeName - * @param {Location} operatorLoc - * @param {Node} value + * @param {Node[]} elements + * @param {Location | null} openingLoc + * @param {Location | null} closingLoc */ - constructor(nodeID, location, flags, receiver, callOperatorLoc, messageLoc, readName, writeName, operatorLoc, value) { + constructor(nodeID, location, flags, elements2, openingLoc, closingLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.receiver = receiver; - this.callOperatorLoc = callOperatorLoc; - this.messageLoc = messageLoc; - this.readName = readName; - this.writeName = writeName; - this.operatorLoc = operatorLoc; - this.value = value; - } - /** - * True if this node has the SAFE_NAVIGATION flag. - * - * @returns {boolean} - */ - isSafeNavigation() { - return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; - } - /** - * True if this node has the VARIABLE_CALL flag. - * - * @returns {boolean} - */ - isVariableCall() { - return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; - } - /** - * True if this node has the ATTRIBUTE_WRITE flag. - * - * @returns {boolean} - */ - isAttributeWrite() { - return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; + this.elements = elements2; + this.openingLoc = openingLoc; + this.closingLoc = closingLoc; } /** - * True if this node has the IGNORE_VISIBILITY flag. + * True if this node has the CONTAINS_SPLAT flag. * * @returns {boolean} */ - isIgnoreVisibility() { - return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; + isContainsSplat() { + return (this.#flags & ArrayNodeFlags.CONTAINS_SPLAT) !== 0; } /** * Accept a visitor for this node. @@ -5228,7 +14559,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitCallAndWriteNode(this); + visitor.visitArrayNode(this); } /** * Returns all child nodes of the current node. @@ -5236,7 +14567,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.receiver, this.value]; + return [...this.elements]; } /** * Compact and return an array of child nodes. @@ -5244,12 +14575,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.receiver) { - compact.push(this.receiver); - } - compact.push(this.value); - return compact; + return [...this.elements]; } /** * Transforms the Node to a JavaScript object. @@ -5258,20 +14584,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "CallAndWriteNode", + type: "ArrayNode", location: this.location, flags: this.#flags, - receiver: this.receiver, - callOperatorLoc: this.callOperatorLoc, - messageLoc: this.messageLoc, - readName: this.readName, - writeName: this.writeName, - operatorLoc: this.operatorLoc, - value: this.value + elements: this.elements, + openingLoc: this.openingLoc, + closingLoc: this.closingLoc }; } }; - var CallNode = class { + var ArrayPatternNode = class { /** * @type number */ @@ -5287,100 +14609,50 @@ var HerbLinter = (() => { /** * @type Node | null */ - receiver; + constant; /** - * @type Location | null + * @type Node[] */ - callOperatorLoc; + requireds; /** - * @type string + * @type Node | null */ - name; + rest; /** - * @type Location | null + * @type Node[] */ - messageLoc; + posts; /** * @type Location | null */ openingLoc; - /** - * @type ArgumentsNode | null - */ - arguments_; /** * @type Location | null */ closingLoc; /** - * @type Location | null - */ - equalLoc; - /** - * @type Node | null - */ - block; - /** - * Construct a new CallNode. + * Construct a new ArrayPatternNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node | null} receiver - * @param {Location | null} callOperatorLoc - * @param {string} name - * @param {Location | null} messageLoc + * @param {Node | null} constant + * @param {Node[]} requireds + * @param {Node | null} rest + * @param {Node[]} posts * @param {Location | null} openingLoc - * @param {ArgumentsNode | null} arguments_ * @param {Location | null} closingLoc - * @param {Location | null} equalLoc - * @param {Node | null} block */ - constructor(nodeID, location, flags, receiver, callOperatorLoc, name2, messageLoc, openingLoc, arguments_, closingLoc, equalLoc, block2) { + constructor(nodeID, location, flags, constant, requireds, rest, posts, openingLoc, closingLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.receiver = receiver; - this.callOperatorLoc = callOperatorLoc; - this.name = name2; - this.messageLoc = messageLoc; + this.constant = constant; + this.requireds = requireds; + this.rest = rest; + this.posts = posts; this.openingLoc = openingLoc; - this.arguments_ = arguments_; this.closingLoc = closingLoc; - this.equalLoc = equalLoc; - this.block = block2; - } - /** - * True if this node has the SAFE_NAVIGATION flag. - * - * @returns {boolean} - */ - isSafeNavigation() { - return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; - } - /** - * True if this node has the VARIABLE_CALL flag. - * - * @returns {boolean} - */ - isVariableCall() { - return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; - } - /** - * True if this node has the ATTRIBUTE_WRITE flag. - * - * @returns {boolean} - */ - isAttributeWrite() { - return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; - } - /** - * True if this node has the IGNORE_VISIBILITY flag. - * - * @returns {boolean} - */ - isIgnoreVisibility() { - return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; } /** * Accept a visitor for this node. @@ -5388,7 +14660,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitCallNode(this); + visitor.visitArrayPatternNode(this); } /** * Returns all child nodes of the current node. @@ -5396,7 +14668,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.receiver, this.arguments_, this.block]; + return [this.constant, ...this.requireds, this.rest, ...this.posts]; } /** * Compact and return an array of child nodes. @@ -5405,15 +14677,14 @@ var HerbLinter = (() => { */ compactChildNodes() { const compact = []; - if (this.receiver) { - compact.push(this.receiver); - } - if (this.arguments_) { - compact.push(this.arguments_); + if (this.constant) { + compact.push(this.constant); } - if (this.block) { - compact.push(this.block); + compact.concat(this.requireds); + if (this.rest) { + compact.push(this.rest); } + compact.concat(this.posts); return compact; } /** @@ -5423,22 +14694,19 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "CallNode", + type: "ArrayPatternNode", location: this.location, flags: this.#flags, - receiver: this.receiver, - callOperatorLoc: this.callOperatorLoc, - name: this.name, - messageLoc: this.messageLoc, + constant: this.constant, + requireds: this.requireds, + rest: this.rest, + posts: this.posts, openingLoc: this.openingLoc, - arguments: this.arguments_, - closingLoc: this.closingLoc, - equalLoc: this.equalLoc, - block: this.block + closingLoc: this.closingLoc }; } }; - var CallOperatorWriteNode = class { + var AssocNode = class { /** * @type number */ @@ -5452,96 +14720,34 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node | null + * @type Node */ - receiver; + key; /** - * @type Location | null + * @type Node */ - callOperatorLoc; + value; /** * @type Location | null */ - messageLoc; - /** - * @type string - */ - readName; - /** - * @type string - */ - writeName; - /** - * @type string - */ - binaryOperator; - /** - * @type Location - */ - binaryOperatorLoc; - /** - * @type Node - */ - value; + operatorLoc; /** - * Construct a new CallOperatorWriteNode. + * Construct a new AssocNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node | null} receiver - * @param {Location | null} callOperatorLoc - * @param {Location | null} messageLoc - * @param {string} readName - * @param {string} writeName - * @param {string} binaryOperator - * @param {Location} binaryOperatorLoc + * @param {Node} key * @param {Node} value + * @param {Location | null} operatorLoc */ - constructor(nodeID, location, flags, receiver, callOperatorLoc, messageLoc, readName, writeName, binaryOperator, binaryOperatorLoc, value) { + constructor(nodeID, location, flags, key, value, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.receiver = receiver; - this.callOperatorLoc = callOperatorLoc; - this.messageLoc = messageLoc; - this.readName = readName; - this.writeName = writeName; - this.binaryOperator = binaryOperator; - this.binaryOperatorLoc = binaryOperatorLoc; + this.key = key; this.value = value; - } - /** - * True if this node has the SAFE_NAVIGATION flag. - * - * @returns {boolean} - */ - isSafeNavigation() { - return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; - } - /** - * True if this node has the VARIABLE_CALL flag. - * - * @returns {boolean} - */ - isVariableCall() { - return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; - } - /** - * True if this node has the ATTRIBUTE_WRITE flag. - * - * @returns {boolean} - */ - isAttributeWrite() { - return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; - } - /** - * True if this node has the IGNORE_VISIBILITY flag. - * - * @returns {boolean} - */ - isIgnoreVisibility() { - return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; + this.operatorLoc = operatorLoc; } /** * Accept a visitor for this node. @@ -5549,7 +14755,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitCallOperatorWriteNode(this); + visitor.visitAssocNode(this); } /** * Returns all child nodes of the current node. @@ -5557,7 +14763,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.receiver, this.value]; + return [this.key, this.value]; } /** * Compact and return an array of child nodes. @@ -5565,12 +14771,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.receiver) { - compact.push(this.receiver); - } - compact.push(this.value); - return compact; + return [this.key, this.value]; } /** * Transforms the Node to a JavaScript object. @@ -5579,21 +14780,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "CallOperatorWriteNode", + type: "AssocNode", location: this.location, flags: this.#flags, - receiver: this.receiver, - callOperatorLoc: this.callOperatorLoc, - messageLoc: this.messageLoc, - readName: this.readName, - writeName: this.writeName, - binaryOperator: this.binaryOperator, - binaryOperatorLoc: this.binaryOperatorLoc, - value: this.value + key: this.key, + value: this.value, + operatorLoc: this.operatorLoc }; } }; - var CallOrWriteNode = class { + var AssocSplatNode = class { /** * @type number */ @@ -5609,88 +14805,26 @@ var HerbLinter = (() => { /** * @type Node | null */ - receiver; - /** - * @type Location | null - */ - callOperatorLoc; - /** - * @type Location | null - */ - messageLoc; - /** - * @type string - */ - readName; - /** - * @type string - */ - writeName; + value; /** * @type Location */ operatorLoc; /** - * @type Node - */ - value; - /** - * Construct a new CallOrWriteNode. + * Construct a new AssocSplatNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node | null} receiver - * @param {Location | null} callOperatorLoc - * @param {Location | null} messageLoc - * @param {string} readName - * @param {string} writeName + * @param {Node | null} value * @param {Location} operatorLoc - * @param {Node} value */ - constructor(nodeID, location, flags, receiver, callOperatorLoc, messageLoc, readName, writeName, operatorLoc, value) { + constructor(nodeID, location, flags, value, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.receiver = receiver; - this.callOperatorLoc = callOperatorLoc; - this.messageLoc = messageLoc; - this.readName = readName; - this.writeName = writeName; - this.operatorLoc = operatorLoc; this.value = value; - } - /** - * True if this node has the SAFE_NAVIGATION flag. - * - * @returns {boolean} - */ - isSafeNavigation() { - return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; - } - /** - * True if this node has the VARIABLE_CALL flag. - * - * @returns {boolean} - */ - isVariableCall() { - return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; - } - /** - * True if this node has the ATTRIBUTE_WRITE flag. - * - * @returns {boolean} - */ - isAttributeWrite() { - return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; - } - /** - * True if this node has the IGNORE_VISIBILITY flag. - * - * @returns {boolean} - */ - isIgnoreVisibility() { - return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; + this.operatorLoc = operatorLoc; } /** * Accept a visitor for this node. @@ -5698,7 +14832,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitCallOrWriteNode(this); + visitor.visitAssocSplatNode(this); } /** * Returns all child nodes of the current node. @@ -5706,7 +14840,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.receiver, this.value]; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -5715,10 +14849,9 @@ var HerbLinter = (() => { */ compactChildNodes() { const compact = []; - if (this.receiver) { - compact.push(this.receiver); + if (this.value) { + compact.push(this.value); } - compact.push(this.value); return compact; } /** @@ -5728,20 +14861,15 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "CallOrWriteNode", + type: "AssocSplatNode", location: this.location, flags: this.#flags, - receiver: this.receiver, - callOperatorLoc: this.callOperatorLoc, - messageLoc: this.messageLoc, - readName: this.readName, - writeName: this.writeName, - operatorLoc: this.operatorLoc, - value: this.value + value: this.value, + operatorLoc: this.operatorLoc }; } }; - var CallTargetNode = class { + var BackReferenceReadNode = class { /** * @type number */ @@ -5754,97 +14882,47 @@ var HerbLinter = (() => { * @type number */ #flags; - /** - * @type Node - */ - receiver; - /** - * @type Location - */ - callOperatorLoc; /** * @type string */ name; /** - * @type Location - */ - messageLoc; - /** - * Construct a new CallTargetNode. + * Construct a new BackReferenceReadNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node} receiver - * @param {Location} callOperatorLoc * @param {string} name - * @param {Location} messageLoc */ - constructor(nodeID, location, flags, receiver, callOperatorLoc, name2, messageLoc) { + constructor(nodeID, location, flags, name2) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.receiver = receiver; - this.callOperatorLoc = callOperatorLoc; this.name = name2; - this.messageLoc = messageLoc; } /** - * True if this node has the SAFE_NAVIGATION flag. + * Accept a visitor for this node. * - * @returns {boolean} + * @param {visitors.Visitor} visitor */ - isSafeNavigation() { - return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; + accept(visitor) { + visitor.visitBackReferenceReadNode(this); } /** - * True if this node has the VARIABLE_CALL flag. + * Returns all child nodes of the current node. * - * @returns {boolean} + * @returns {(Node | null)[]} An array of child nodes. */ - isVariableCall() { - return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; + childNodes() { + return []; } /** - * True if this node has the ATTRIBUTE_WRITE flag. + * Compact and return an array of child nodes. * - * @returns {boolean} - */ - isAttributeWrite() { - return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; - } - /** - * True if this node has the IGNORE_VISIBILITY flag. - * - * @returns {boolean} - */ - isIgnoreVisibility() { - return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; - } - /** - * Accept a visitor for this node. - * - * @param {visitors.Visitor} visitor - */ - accept(visitor) { - visitor.visitCallTargetNode(this); - } - /** - * Returns all child nodes of the current node. - * - * @returns {(Node | null)[]} An array of child nodes. - */ - childNodes() { - return [this.receiver]; - } - /** - * Compact and return an array of child nodes. - * - * @returns {Node[]} An array of compacted child nodes. + * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.receiver]; + return []; } /** * Transforms the Node to a JavaScript object. @@ -5853,17 +14931,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "CallTargetNode", + type: "BackReferenceReadNode", location: this.location, flags: this.#flags, - receiver: this.receiver, - callOperatorLoc: this.callOperatorLoc, - name: this.name, - messageLoc: this.messageLoc + name: this.name }; } }; - var CapturePatternNode = class { + var BeginNode = class { /** * @type number */ @@ -5877,34 +14952,52 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node + * @type Location | null */ - value; + beginKeywordLoc; /** - * @type LocalVariableTargetNode + * @type StatementsNode | null */ - target; + statements; /** - * @type Location + * @type RescueNode | null */ - operatorLoc; + rescueClause; /** - * Construct a new CapturePatternNode. + * @type ElseNode | null + */ + elseClause; + /** + * @type EnsureNode | null + */ + ensureClause; + /** + * @type Location | null + */ + endKeywordLoc; + /** + * Construct a new BeginNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node} value - * @param {LocalVariableTargetNode} target - * @param {Location} operatorLoc + * @param {Location | null} beginKeywordLoc + * @param {StatementsNode | null} statements + * @param {RescueNode | null} rescueClause + * @param {ElseNode | null} elseClause + * @param {EnsureNode | null} ensureClause + * @param {Location | null} endKeywordLoc */ - constructor(nodeID, location, flags, value, target2, operatorLoc) { + constructor(nodeID, location, flags, beginKeywordLoc, statements, rescueClause, elseClause, ensureClause, endKeywordLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.value = value; - this.target = target2; - this.operatorLoc = operatorLoc; + this.beginKeywordLoc = beginKeywordLoc; + this.statements = statements; + this.rescueClause = rescueClause; + this.elseClause = elseClause; + this.ensureClause = ensureClause; + this.endKeywordLoc = endKeywordLoc; } /** * Accept a visitor for this node. @@ -5912,7 +15005,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitCapturePatternNode(this); + visitor.visitBeginNode(this); } /** * Returns all child nodes of the current node. @@ -5920,7 +15013,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value, this.target]; + return [this.statements, this.rescueClause, this.elseClause, this.ensureClause]; } /** * Compact and return an array of child nodes. @@ -5928,7 +15021,20 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value, this.target]; + const compact = []; + if (this.statements) { + compact.push(this.statements); + } + if (this.rescueClause) { + compact.push(this.rescueClause); + } + if (this.elseClause) { + compact.push(this.elseClause); + } + if (this.ensureClause) { + compact.push(this.ensureClause); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -5937,16 +15043,19 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "CapturePatternNode", + type: "BeginNode", location: this.location, flags: this.#flags, - value: this.value, - target: this.target, - operatorLoc: this.operatorLoc + beginKeywordLoc: this.beginKeywordLoc, + statements: this.statements, + rescueClause: this.rescueClause, + elseClause: this.elseClause, + ensureClause: this.ensureClause, + endKeywordLoc: this.endKeywordLoc }; } }; - var CaseMatchNode = class { + var BlockArgumentNode = class { /** * @type number */ @@ -5962,44 +15071,26 @@ var HerbLinter = (() => { /** * @type Node | null */ - predicate; - /** - * @type Node[] - */ - conditions; - /** - * @type ElseNode | null - */ - elseClause; - /** - * @type Location - */ - caseKeywordLoc; + expression; /** * @type Location */ - endKeywordLoc; + operatorLoc; /** - * Construct a new CaseMatchNode. + * Construct a new BlockArgumentNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node | null} predicate - * @param {Node[]} conditions - * @param {ElseNode | null} elseClause - * @param {Location} caseKeywordLoc - * @param {Location} endKeywordLoc + * @param {Node | null} expression + * @param {Location} operatorLoc */ - constructor(nodeID, location, flags, predicate, conditions, elseClause, caseKeywordLoc, endKeywordLoc) { + constructor(nodeID, location, flags, expression, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.predicate = predicate; - this.conditions = conditions; - this.elseClause = elseClause; - this.caseKeywordLoc = caseKeywordLoc; - this.endKeywordLoc = endKeywordLoc; + this.expression = expression; + this.operatorLoc = operatorLoc; } /** * Accept a visitor for this node. @@ -6007,7 +15098,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitCaseMatchNode(this); + visitor.visitBlockArgumentNode(this); } /** * Returns all child nodes of the current node. @@ -6015,7 +15106,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.predicate, ...this.conditions, this.elseClause]; + return [this.expression]; } /** * Compact and return an array of child nodes. @@ -6024,12 +15115,8 @@ var HerbLinter = (() => { */ compactChildNodes() { const compact = []; - if (this.predicate) { - compact.push(this.predicate); - } - compact.concat(this.conditions); - if (this.elseClause) { - compact.push(this.elseClause); + if (this.expression) { + compact.push(this.expression); } return compact; } @@ -6040,18 +15127,15 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "CaseMatchNode", + type: "BlockArgumentNode", location: this.location, flags: this.#flags, - predicate: this.predicate, - conditions: this.conditions, - elseClause: this.elseClause, - caseKeywordLoc: this.caseKeywordLoc, - endKeywordLoc: this.endKeywordLoc + expression: this.expression, + operatorLoc: this.operatorLoc }; } }; - var CaseNode = class { + var BlockLocalVariableNode = class { /** * @type number */ @@ -6065,46 +15149,30 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node | null - */ - predicate; - /** - * @type Node[] - */ - conditions; - /** - * @type ElseNode | null - */ - elseClause; - /** - * @type Location - */ - caseKeywordLoc; - /** - * @type Location + * @type string */ - endKeywordLoc; + name; /** - * Construct a new CaseNode. + * Construct a new BlockLocalVariableNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node | null} predicate - * @param {Node[]} conditions - * @param {ElseNode | null} elseClause - * @param {Location} caseKeywordLoc - * @param {Location} endKeywordLoc + * @param {string} name */ - constructor(nodeID, location, flags, predicate, conditions, elseClause, caseKeywordLoc, endKeywordLoc) { + constructor(nodeID, location, flags, name2) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.predicate = predicate; - this.conditions = conditions; - this.elseClause = elseClause; - this.caseKeywordLoc = caseKeywordLoc; - this.endKeywordLoc = endKeywordLoc; + this.name = name2; + } + /** + * True if this node has the REPEATED_PARAMETER flag. + * + * @returns {boolean} + */ + isRepeatedParameter() { + return (this.#flags & ParameterFlags.REPEATED_PARAMETER) !== 0; } /** * Accept a visitor for this node. @@ -6112,7 +15180,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitCaseNode(this); + visitor.visitBlockLocalVariableNode(this); } /** * Returns all child nodes of the current node. @@ -6120,7 +15188,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.predicate, ...this.conditions, this.elseClause]; + return []; } /** * Compact and return an array of child nodes. @@ -6128,15 +15196,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.predicate) { - compact.push(this.predicate); - } - compact.concat(this.conditions); - if (this.elseClause) { - compact.push(this.elseClause); - } - return compact; + return []; } /** * Transforms the Node to a JavaScript object. @@ -6145,18 +15205,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "CaseNode", + type: "BlockLocalVariableNode", location: this.location, flags: this.#flags, - predicate: this.predicate, - conditions: this.conditions, - elseClause: this.elseClause, - caseKeywordLoc: this.caseKeywordLoc, - endKeywordLoc: this.endKeywordLoc + name: this.name }; } }; - var ClassNode = class { + var BlockNode = class { /** * @type number */ @@ -6173,22 +15229,10 @@ var HerbLinter = (() => { * @type string[] */ locals; - /** - * @type Location - */ - classKeywordLoc; - /** - * @type Node - */ - constantPath; - /** - * @type Location | null - */ - inheritanceOperatorLoc; /** * @type Node | null */ - superclass; + parameters; /** * @type Node | null */ @@ -6196,38 +15240,32 @@ var HerbLinter = (() => { /** * @type Location */ - endKeywordLoc; + openingLoc; /** - * @type string + * @type Location */ - name; + closingLoc; /** - * Construct a new ClassNode. + * Construct a new BlockNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags * @param {string[]} locals - * @param {Location} classKeywordLoc - * @param {Node} constantPath - * @param {Location | null} inheritanceOperatorLoc - * @param {Node | null} superclass + * @param {Node | null} parameters * @param {Node | null} body - * @param {Location} endKeywordLoc - * @param {string} name + * @param {Location} openingLoc + * @param {Location} closingLoc */ - constructor(nodeID, location, flags, locals, classKeywordLoc, constantPath, inheritanceOperatorLoc, superclass, body, endKeywordLoc, name2) { + constructor(nodeID, location, flags, locals, parameters, body, openingLoc, closingLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; this.locals = locals; - this.classKeywordLoc = classKeywordLoc; - this.constantPath = constantPath; - this.inheritanceOperatorLoc = inheritanceOperatorLoc; - this.superclass = superclass; + this.parameters = parameters; this.body = body; - this.endKeywordLoc = endKeywordLoc; - this.name = name2; + this.openingLoc = openingLoc; + this.closingLoc = closingLoc; } /** * Accept a visitor for this node. @@ -6235,7 +15273,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitClassNode(this); + visitor.visitBlockNode(this); } /** * Returns all child nodes of the current node. @@ -6243,7 +15281,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.constantPath, this.superclass, this.body]; + return [this.parameters, this.body]; } /** * Compact and return an array of child nodes. @@ -6252,9 +15290,8 @@ var HerbLinter = (() => { */ compactChildNodes() { const compact = []; - compact.push(this.constantPath); - if (this.superclass) { - compact.push(this.superclass); + if (this.parameters) { + compact.push(this.parameters); } if (this.body) { compact.push(this.body); @@ -6268,21 +15305,18 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ClassNode", + type: "BlockNode", location: this.location, flags: this.#flags, locals: this.locals, - classKeywordLoc: this.classKeywordLoc, - constantPath: this.constantPath, - inheritanceOperatorLoc: this.inheritanceOperatorLoc, - superclass: this.superclass, + parameters: this.parameters, body: this.body, - endKeywordLoc: this.endKeywordLoc, - name: this.name + openingLoc: this.openingLoc, + closingLoc: this.closingLoc }; } }; - var ClassVariableAndWriteNode = class { + var BlockParameterNode = class { /** * @type number */ @@ -6296,11 +15330,11 @@ var HerbLinter = (() => { */ #flags; /** - * @type string + * @type string | null */ name; /** - * @type Location + * @type Location | null */ nameLoc; /** @@ -6308,28 +15342,30 @@ var HerbLinter = (() => { */ operatorLoc; /** - * @type Node - */ - value; - /** - * Construct a new ClassVariableAndWriteNode. + * Construct a new BlockParameterNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name - * @param {Location} nameLoc + * @param {string | null} name + * @param {Location | null} nameLoc * @param {Location} operatorLoc - * @param {Node} value */ - constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { + constructor(nodeID, location, flags, name2, nameLoc, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; this.name = name2; this.nameLoc = nameLoc; this.operatorLoc = operatorLoc; - this.value = value; + } + /** + * True if this node has the REPEATED_PARAMETER flag. + * + * @returns {boolean} + */ + isRepeatedParameter() { + return (this.#flags & ParameterFlags.REPEATED_PARAMETER) !== 0; } /** * Accept a visitor for this node. @@ -6337,7 +15373,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitClassVariableAndWriteNode(this); + visitor.visitBlockParameterNode(this); } /** * Returns all child nodes of the current node. @@ -6345,7 +15381,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return []; } /** * Compact and return an array of child nodes. @@ -6353,7 +15389,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + return []; } /** * Transforms the Node to a JavaScript object. @@ -6362,17 +15398,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ClassVariableAndWriteNode", + type: "BlockParameterNode", location: this.location, flags: this.#flags, name: this.name, nameLoc: this.nameLoc, - operatorLoc: this.operatorLoc, - value: this.value + operatorLoc: this.operatorLoc }; } }; - var ClassVariableOperatorWriteNode = class { + var BlockParametersNode = class { /** * @type number */ @@ -6386,46 +15421,40 @@ var HerbLinter = (() => { */ #flags; /** - * @type string - */ - name; - /** - * @type Location + * @type ParametersNode | null */ - nameLoc; + parameters; /** - * @type Location + * @type Node[] */ - binaryOperatorLoc; + locals; /** - * @type Node + * @type Location | null */ - value; + openingLoc; /** - * @type string + * @type Location | null */ - binaryOperator; + closingLoc; /** - * Construct a new ClassVariableOperatorWriteNode. + * Construct a new BlockParametersNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name - * @param {Location} nameLoc - * @param {Location} binaryOperatorLoc - * @param {Node} value - * @param {string} binaryOperator + * @param {ParametersNode | null} parameters + * @param {Node[]} locals + * @param {Location | null} openingLoc + * @param {Location | null} closingLoc */ - constructor(nodeID, location, flags, name2, nameLoc, binaryOperatorLoc, value, binaryOperator) { + constructor(nodeID, location, flags, parameters, locals, openingLoc, closingLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; - this.nameLoc = nameLoc; - this.binaryOperatorLoc = binaryOperatorLoc; - this.value = value; - this.binaryOperator = binaryOperator; + this.parameters = parameters; + this.locals = locals; + this.openingLoc = openingLoc; + this.closingLoc = closingLoc; } /** * Accept a visitor for this node. @@ -6433,7 +15462,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitClassVariableOperatorWriteNode(this); + visitor.visitBlockParametersNode(this); } /** * Returns all child nodes of the current node. @@ -6441,7 +15470,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return [this.parameters, ...this.locals]; } /** * Compact and return an array of child nodes. @@ -6449,7 +15478,12 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + const compact = []; + if (this.parameters) { + compact.push(this.parameters); + } + compact.concat(this.locals); + return compact; } /** * Transforms the Node to a JavaScript object. @@ -6458,18 +15492,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ClassVariableOperatorWriteNode", + type: "BlockParametersNode", location: this.location, flags: this.#flags, - name: this.name, - nameLoc: this.nameLoc, - binaryOperatorLoc: this.binaryOperatorLoc, - value: this.value, - binaryOperator: this.binaryOperator + parameters: this.parameters, + locals: this.locals, + openingLoc: this.openingLoc, + closingLoc: this.closingLoc }; } }; - var ClassVariableOrWriteNode = class { + var BreakNode = class { /** * @type number */ @@ -6483,40 +15516,28 @@ var HerbLinter = (() => { */ #flags; /** - * @type string - */ - name; - /** - * @type Location + * @type ArgumentsNode | null */ - nameLoc; + arguments_; /** * @type Location */ - operatorLoc; - /** - * @type Node - */ - value; + keywordLoc; /** - * Construct a new ClassVariableOrWriteNode. + * Construct a new BreakNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name - * @param {Location} nameLoc - * @param {Location} operatorLoc - * @param {Node} value + * @param {ArgumentsNode | null} arguments_ + * @param {Location} keywordLoc */ - constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { + constructor(nodeID, location, flags, arguments_, keywordLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; - this.nameLoc = nameLoc; - this.operatorLoc = operatorLoc; - this.value = value; + this.arguments_ = arguments_; + this.keywordLoc = keywordLoc; } /** * Accept a visitor for this node. @@ -6524,7 +15545,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitClassVariableOrWriteNode(this); + visitor.visitBreakNode(this); } /** * Returns all child nodes of the current node. @@ -6532,7 +15553,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return [this.arguments_]; } /** * Compact and return an array of child nodes. @@ -6540,7 +15561,11 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + const compact = []; + if (this.arguments_) { + compact.push(this.arguments_); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -6549,17 +15574,15 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ClassVariableOrWriteNode", + type: "BreakNode", location: this.location, flags: this.#flags, - name: this.name, - nameLoc: this.nameLoc, - operatorLoc: this.operatorLoc, - value: this.value + arguments: this.arguments_, + keywordLoc: this.keywordLoc }; } }; - var ClassVariableReadNode = class { + var CallAndWriteNode = class { /** * @type number */ @@ -6572,31 +15595,99 @@ var HerbLinter = (() => { * @type number */ #flags; + /** + * @type Node | null + */ + receiver; + /** + * @type Location | null + */ + callOperatorLoc; + /** + * @type Location | null + */ + messageLoc; /** * @type string */ - name; + readName; /** - * Construct a new ClassVariableReadNode. + * @type string + */ + writeName; + /** + * @type Location + */ + operatorLoc; + /** + * @type Node + */ + value; + /** + * Construct a new CallAndWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name + * @param {Node | null} receiver + * @param {Location | null} callOperatorLoc + * @param {Location | null} messageLoc + * @param {string} readName + * @param {string} writeName + * @param {Location} operatorLoc + * @param {Node} value */ - constructor(nodeID, location, flags, name2) { + constructor(nodeID, location, flags, receiver, callOperatorLoc, messageLoc, readName, writeName, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; + this.receiver = receiver; + this.callOperatorLoc = callOperatorLoc; + this.messageLoc = messageLoc; + this.readName = readName; + this.writeName = writeName; + this.operatorLoc = operatorLoc; + this.value = value; } /** - * Accept a visitor for this node. + * True if this node has the SAFE_NAVIGATION flag. * - * @param {visitors.Visitor} visitor + * @returns {boolean} */ - accept(visitor) { - visitor.visitClassVariableReadNode(this); + isSafeNavigation() { + return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; + } + /** + * True if this node has the VARIABLE_CALL flag. + * + * @returns {boolean} + */ + isVariableCall() { + return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; + } + /** + * True if this node has the ATTRIBUTE_WRITE flag. + * + * @returns {boolean} + */ + isAttributeWrite() { + return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; + } + /** + * True if this node has the IGNORE_VISIBILITY flag. + * + * @returns {boolean} + */ + isIgnoreVisibility() { + return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; + } + /** + * Accept a visitor for this node. + * + * @param {visitors.Visitor} visitor + */ + accept(visitor) { + visitor.visitCallAndWriteNode(this); } /** * Returns all child nodes of the current node. @@ -6604,7 +15695,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.receiver, this.value]; } /** * Compact and return an array of child nodes. @@ -6612,7 +15703,12 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + const compact = []; + if (this.receiver) { + compact.push(this.receiver); + } + compact.push(this.value); + return compact; } /** * Transforms the Node to a JavaScript object. @@ -6621,14 +15717,20 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ClassVariableReadNode", + type: "CallAndWriteNode", location: this.location, flags: this.#flags, - name: this.name + receiver: this.receiver, + callOperatorLoc: this.callOperatorLoc, + messageLoc: this.messageLoc, + readName: this.readName, + writeName: this.writeName, + operatorLoc: this.operatorLoc, + value: this.value }; } }; - var ClassVariableTargetNode = class { + var CallNode = class { /** * @type number */ @@ -6641,23 +15743,103 @@ var HerbLinter = (() => { * @type number */ #flags; + /** + * @type Node | null + */ + receiver; + /** + * @type Location | null + */ + callOperatorLoc; /** * @type string */ name; /** - * Construct a new ClassVariableTargetNode. + * @type Location | null + */ + messageLoc; + /** + * @type Location | null + */ + openingLoc; + /** + * @type ArgumentsNode | null + */ + arguments_; + /** + * @type Location | null + */ + closingLoc; + /** + * @type Location | null + */ + equalLoc; + /** + * @type Node | null + */ + block; + /** + * Construct a new CallNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {Node | null} receiver + * @param {Location | null} callOperatorLoc * @param {string} name + * @param {Location | null} messageLoc + * @param {Location | null} openingLoc + * @param {ArgumentsNode | null} arguments_ + * @param {Location | null} closingLoc + * @param {Location | null} equalLoc + * @param {Node | null} block */ - constructor(nodeID, location, flags, name2) { + constructor(nodeID, location, flags, receiver, callOperatorLoc, name2, messageLoc, openingLoc, arguments_, closingLoc, equalLoc, block) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.receiver = receiver; + this.callOperatorLoc = callOperatorLoc; this.name = name2; + this.messageLoc = messageLoc; + this.openingLoc = openingLoc; + this.arguments_ = arguments_; + this.closingLoc = closingLoc; + this.equalLoc = equalLoc; + this.block = block; + } + /** + * True if this node has the SAFE_NAVIGATION flag. + * + * @returns {boolean} + */ + isSafeNavigation() { + return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; + } + /** + * True if this node has the VARIABLE_CALL flag. + * + * @returns {boolean} + */ + isVariableCall() { + return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; + } + /** + * True if this node has the ATTRIBUTE_WRITE flag. + * + * @returns {boolean} + */ + isAttributeWrite() { + return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; + } + /** + * True if this node has the IGNORE_VISIBILITY flag. + * + * @returns {boolean} + */ + isIgnoreVisibility() { + return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; } /** * Accept a visitor for this node. @@ -6665,7 +15847,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitClassVariableTargetNode(this); + visitor.visitCallNode(this); } /** * Returns all child nodes of the current node. @@ -6673,7 +15855,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.receiver, this.arguments_, this.block]; } /** * Compact and return an array of child nodes. @@ -6681,7 +15863,17 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + const compact = []; + if (this.receiver) { + compact.push(this.receiver); + } + if (this.arguments_) { + compact.push(this.arguments_); + } + if (this.block) { + compact.push(this.block); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -6690,14 +15882,22 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ClassVariableTargetNode", + type: "CallNode", location: this.location, flags: this.#flags, - name: this.name + receiver: this.receiver, + callOperatorLoc: this.callOperatorLoc, + name: this.name, + messageLoc: this.messageLoc, + openingLoc: this.openingLoc, + arguments: this.arguments_, + closingLoc: this.closingLoc, + equalLoc: this.equalLoc, + block: this.block }; } }; - var ClassVariableWriteNode = class { + var CallOperatorWriteNode = class { /** * @type number */ @@ -6710,41 +15910,97 @@ var HerbLinter = (() => { * @type number */ #flags; + /** + * @type Node | null + */ + receiver; + /** + * @type Location | null + */ + callOperatorLoc; + /** + * @type Location | null + */ + messageLoc; /** * @type string */ - name; + readName; /** - * @type Location + * @type string */ - nameLoc; + writeName; /** - * @type Node + * @type string */ - value; + binaryOperator; /** * @type Location */ - operatorLoc; + binaryOperatorLoc; /** - * Construct a new ClassVariableWriteNode. + * @type Node + */ + value; + /** + * Construct a new CallOperatorWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name - * @param {Location} nameLoc + * @param {Node | null} receiver + * @param {Location | null} callOperatorLoc + * @param {Location | null} messageLoc + * @param {string} readName + * @param {string} writeName + * @param {string} binaryOperator + * @param {Location} binaryOperatorLoc * @param {Node} value - * @param {Location} operatorLoc */ - constructor(nodeID, location, flags, name2, nameLoc, value, operatorLoc) { + constructor(nodeID, location, flags, receiver, callOperatorLoc, messageLoc, readName, writeName, binaryOperator, binaryOperatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; - this.nameLoc = nameLoc; + this.receiver = receiver; + this.callOperatorLoc = callOperatorLoc; + this.messageLoc = messageLoc; + this.readName = readName; + this.writeName = writeName; + this.binaryOperator = binaryOperator; + this.binaryOperatorLoc = binaryOperatorLoc; this.value = value; - this.operatorLoc = operatorLoc; + } + /** + * True if this node has the SAFE_NAVIGATION flag. + * + * @returns {boolean} + */ + isSafeNavigation() { + return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; + } + /** + * True if this node has the VARIABLE_CALL flag. + * + * @returns {boolean} + */ + isVariableCall() { + return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; + } + /** + * True if this node has the ATTRIBUTE_WRITE flag. + * + * @returns {boolean} + */ + isAttributeWrite() { + return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; + } + /** + * True if this node has the IGNORE_VISIBILITY flag. + * + * @returns {boolean} + */ + isIgnoreVisibility() { + return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; } /** * Accept a visitor for this node. @@ -6752,7 +16008,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitClassVariableWriteNode(this); + visitor.visitCallOperatorWriteNode(this); } /** * Returns all child nodes of the current node. @@ -6760,7 +16016,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return [this.receiver, this.value]; } /** * Compact and return an array of child nodes. @@ -6768,7 +16024,12 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + const compact = []; + if (this.receiver) { + compact.push(this.receiver); + } + compact.push(this.value); + return compact; } /** * Transforms the Node to a JavaScript object. @@ -6777,17 +16038,21 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ClassVariableWriteNode", + type: "CallOperatorWriteNode", location: this.location, flags: this.#flags, - name: this.name, - nameLoc: this.nameLoc, - value: this.value, - operatorLoc: this.operatorLoc + receiver: this.receiver, + callOperatorLoc: this.callOperatorLoc, + messageLoc: this.messageLoc, + readName: this.readName, + writeName: this.writeName, + binaryOperator: this.binaryOperator, + binaryOperatorLoc: this.binaryOperatorLoc, + value: this.value }; } }; - var ConstantAndWriteNode = class { + var CallOrWriteNode = class { /** * @type number */ @@ -6800,14 +16065,26 @@ var HerbLinter = (() => { * @type number */ #flags; + /** + * @type Node | null + */ + receiver; + /** + * @type Location | null + */ + callOperatorLoc; + /** + * @type Location | null + */ + messageLoc; /** * @type string */ - name; + readName; /** - * @type Location + * @type string */ - nameLoc; + writeName; /** * @type Location */ @@ -6817,32 +16094,70 @@ var HerbLinter = (() => { */ value; /** - * Construct a new ConstantAndWriteNode. + * Construct a new CallOrWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name - * @param {Location} nameLoc + * @param {Node | null} receiver + * @param {Location | null} callOperatorLoc + * @param {Location | null} messageLoc + * @param {string} readName + * @param {string} writeName * @param {Location} operatorLoc * @param {Node} value */ - constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { + constructor(nodeID, location, flags, receiver, callOperatorLoc, messageLoc, readName, writeName, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; - this.nameLoc = nameLoc; + this.receiver = receiver; + this.callOperatorLoc = callOperatorLoc; + this.messageLoc = messageLoc; + this.readName = readName; + this.writeName = writeName; this.operatorLoc = operatorLoc; this.value = value; } + /** + * True if this node has the SAFE_NAVIGATION flag. + * + * @returns {boolean} + */ + isSafeNavigation() { + return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; + } + /** + * True if this node has the VARIABLE_CALL flag. + * + * @returns {boolean} + */ + isVariableCall() { + return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; + } + /** + * True if this node has the ATTRIBUTE_WRITE flag. + * + * @returns {boolean} + */ + isAttributeWrite() { + return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; + } + /** + * True if this node has the IGNORE_VISIBILITY flag. + * + * @returns {boolean} + */ + isIgnoreVisibility() { + return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; + } /** * Accept a visitor for this node. * * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitConstantAndWriteNode(this); + visitor.visitCallOrWriteNode(this); } /** * Returns all child nodes of the current node. @@ -6850,7 +16165,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return [this.receiver, this.value]; } /** * Compact and return an array of child nodes. @@ -6858,7 +16173,12 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + const compact = []; + if (this.receiver) { + compact.push(this.receiver); + } + compact.push(this.value); + return compact; } /** * Transforms the Node to a JavaScript object. @@ -6867,17 +16187,20 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ConstantAndWriteNode", + type: "CallOrWriteNode", location: this.location, flags: this.#flags, - name: this.name, - nameLoc: this.nameLoc, + receiver: this.receiver, + callOperatorLoc: this.callOperatorLoc, + messageLoc: this.messageLoc, + readName: this.readName, + writeName: this.writeName, operatorLoc: this.operatorLoc, value: this.value }; } }; - var ConstantOperatorWriteNode = class { + var CallTargetNode = class { /** * @type number */ @@ -6891,46 +16214,72 @@ var HerbLinter = (() => { */ #flags; /** - * @type string - */ - name; - /** - * @type Location + * @type Node */ - nameLoc; + receiver; /** * @type Location */ - binaryOperatorLoc; + callOperatorLoc; /** - * @type Node + * @type string */ - value; + name; /** - * @type string + * @type Location */ - binaryOperator; + messageLoc; /** - * Construct a new ConstantOperatorWriteNode. + * Construct a new CallTargetNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {Node} receiver + * @param {Location} callOperatorLoc * @param {string} name - * @param {Location} nameLoc - * @param {Location} binaryOperatorLoc - * @param {Node} value - * @param {string} binaryOperator + * @param {Location} messageLoc */ - constructor(nodeID, location, flags, name2, nameLoc, binaryOperatorLoc, value, binaryOperator) { + constructor(nodeID, location, flags, receiver, callOperatorLoc, name2, messageLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.receiver = receiver; + this.callOperatorLoc = callOperatorLoc; this.name = name2; - this.nameLoc = nameLoc; - this.binaryOperatorLoc = binaryOperatorLoc; - this.value = value; - this.binaryOperator = binaryOperator; + this.messageLoc = messageLoc; + } + /** + * True if this node has the SAFE_NAVIGATION flag. + * + * @returns {boolean} + */ + isSafeNavigation() { + return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; + } + /** + * True if this node has the VARIABLE_CALL flag. + * + * @returns {boolean} + */ + isVariableCall() { + return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; + } + /** + * True if this node has the ATTRIBUTE_WRITE flag. + * + * @returns {boolean} + */ + isAttributeWrite() { + return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; + } + /** + * True if this node has the IGNORE_VISIBILITY flag. + * + * @returns {boolean} + */ + isIgnoreVisibility() { + return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; } /** * Accept a visitor for this node. @@ -6938,7 +16287,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitConstantOperatorWriteNode(this); + visitor.visitCallTargetNode(this); } /** * Returns all child nodes of the current node. @@ -6946,7 +16295,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return [this.receiver]; } /** * Compact and return an array of child nodes. @@ -6954,7 +16303,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + return [this.receiver]; } /** * Transforms the Node to a JavaScript object. @@ -6963,18 +16312,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ConstantOperatorWriteNode", + type: "CallTargetNode", location: this.location, flags: this.#flags, + receiver: this.receiver, + callOperatorLoc: this.callOperatorLoc, name: this.name, - nameLoc: this.nameLoc, - binaryOperatorLoc: this.binaryOperatorLoc, - value: this.value, - binaryOperator: this.binaryOperator + messageLoc: this.messageLoc }; } }; - var ConstantOrWriteNode = class { + var CapturePatternNode = class { /** * @type number */ @@ -6988,40 +16336,34 @@ var HerbLinter = (() => { */ #flags; /** - * @type string + * @type Node */ - name; + value; /** - * @type Location + * @type LocalVariableTargetNode */ - nameLoc; + target; /** * @type Location */ operatorLoc; /** - * @type Node - */ - value; - /** - * Construct a new ConstantOrWriteNode. + * Construct a new CapturePatternNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name - * @param {Location} nameLoc - * @param {Location} operatorLoc * @param {Node} value + * @param {LocalVariableTargetNode} target + * @param {Location} operatorLoc */ - constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { + constructor(nodeID, location, flags, value, target, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; - this.nameLoc = nameLoc; - this.operatorLoc = operatorLoc; this.value = value; + this.target = target; + this.operatorLoc = operatorLoc; } /** * Accept a visitor for this node. @@ -7029,7 +16371,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitConstantOrWriteNode(this); + visitor.visitCapturePatternNode(this); } /** * Returns all child nodes of the current node. @@ -7037,7 +16379,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return [this.value, this.target]; } /** * Compact and return an array of child nodes. @@ -7045,7 +16387,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + return [this.value, this.target]; } /** * Transforms the Node to a JavaScript object. @@ -7054,17 +16396,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ConstantOrWriteNode", + type: "CapturePatternNode", location: this.location, flags: this.#flags, - name: this.name, - nameLoc: this.nameLoc, - operatorLoc: this.operatorLoc, - value: this.value + value: this.value, + target: this.target, + operatorLoc: this.operatorLoc }; } }; - var ConstantPathAndWriteNode = class { + var CaseMatchNode = class { /** * @type number */ @@ -7078,34 +16419,46 @@ var HerbLinter = (() => { */ #flags; /** - * @type ConstantPathNode + * @type Node | null */ - target; + predicate; /** - * @type Location + * @type Node[] */ - operatorLoc; + conditions; /** - * @type Node + * @type ElseNode | null */ - value; + elseClause; /** - * Construct a new ConstantPathAndWriteNode. - * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {ConstantPathNode} target - * @param {Location} operatorLoc - * @param {Node} value + * @type Location + */ + caseKeywordLoc; + /** + * @type Location + */ + endKeywordLoc; + /** + * Construct a new CaseMatchNode. + * + * @param {number} nodeID + * @param {Location} location + * @param {number} flags + * @param {Node | null} predicate + * @param {Node[]} conditions + * @param {ElseNode | null} elseClause + * @param {Location} caseKeywordLoc + * @param {Location} endKeywordLoc */ - constructor(nodeID, location, flags, target2, operatorLoc, value) { + constructor(nodeID, location, flags, predicate, conditions, elseClause, caseKeywordLoc, endKeywordLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.target = target2; - this.operatorLoc = operatorLoc; - this.value = value; + this.predicate = predicate; + this.conditions = conditions; + this.elseClause = elseClause; + this.caseKeywordLoc = caseKeywordLoc; + this.endKeywordLoc = endKeywordLoc; } /** * Accept a visitor for this node. @@ -7113,7 +16466,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitConstantPathAndWriteNode(this); + visitor.visitCaseMatchNode(this); } /** * Returns all child nodes of the current node. @@ -7121,7 +16474,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.target, this.value]; + return [this.predicate, ...this.conditions, this.elseClause]; } /** * Compact and return an array of child nodes. @@ -7129,7 +16482,15 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.target, this.value]; + const compact = []; + if (this.predicate) { + compact.push(this.predicate); + } + compact.concat(this.conditions); + if (this.elseClause) { + compact.push(this.elseClause); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -7138,16 +16499,18 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ConstantPathAndWriteNode", + type: "CaseMatchNode", location: this.location, flags: this.#flags, - target: this.target, - operatorLoc: this.operatorLoc, - value: this.value + predicate: this.predicate, + conditions: this.conditions, + elseClause: this.elseClause, + caseKeywordLoc: this.caseKeywordLoc, + endKeywordLoc: this.endKeywordLoc }; } }; - var ConstantPathNode = class { + var CaseNode = class { /** * @type number */ @@ -7163,38 +16526,44 @@ var HerbLinter = (() => { /** * @type Node | null */ - parent; + predicate; /** - * @type string | null + * @type Node[] */ - name; + conditions; + /** + * @type ElseNode | null + */ + elseClause; /** * @type Location */ - delimiterLoc; + caseKeywordLoc; /** * @type Location */ - nameLoc; + endKeywordLoc; /** - * Construct a new ConstantPathNode. + * Construct a new CaseNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node | null} parent - * @param {string | null} name - * @param {Location} delimiterLoc - * @param {Location} nameLoc + * @param {Node | null} predicate + * @param {Node[]} conditions + * @param {ElseNode | null} elseClause + * @param {Location} caseKeywordLoc + * @param {Location} endKeywordLoc */ - constructor(nodeID, location, flags, parent, name2, delimiterLoc, nameLoc) { + constructor(nodeID, location, flags, predicate, conditions, elseClause, caseKeywordLoc, endKeywordLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.parent = parent; - this.name = name2; - this.delimiterLoc = delimiterLoc; - this.nameLoc = nameLoc; + this.predicate = predicate; + this.conditions = conditions; + this.elseClause = elseClause; + this.caseKeywordLoc = caseKeywordLoc; + this.endKeywordLoc = endKeywordLoc; } /** * Accept a visitor for this node. @@ -7202,7 +16571,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitConstantPathNode(this); + visitor.visitCaseNode(this); } /** * Returns all child nodes of the current node. @@ -7210,7 +16579,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.parent]; + return [this.predicate, ...this.conditions, this.elseClause]; } /** * Compact and return an array of child nodes. @@ -7219,8 +16588,12 @@ var HerbLinter = (() => { */ compactChildNodes() { const compact = []; - if (this.parent) { - compact.push(this.parent); + if (this.predicate) { + compact.push(this.predicate); + } + compact.concat(this.conditions); + if (this.elseClause) { + compact.push(this.elseClause); } return compact; } @@ -7231,17 +16604,18 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ConstantPathNode", + type: "CaseNode", location: this.location, flags: this.#flags, - parent: this.parent, - name: this.name, - delimiterLoc: this.delimiterLoc, - nameLoc: this.nameLoc + predicate: this.predicate, + conditions: this.conditions, + elseClause: this.elseClause, + caseKeywordLoc: this.caseKeywordLoc, + endKeywordLoc: this.endKeywordLoc }; } }; - var ConstantPathOperatorWriteNode = class { + var ClassNode = class { /** * @type number */ @@ -7255,40 +16629,64 @@ var HerbLinter = (() => { */ #flags; /** - * @type ConstantPathNode + * @type string[] */ - target; + locals; /** * @type Location */ - binaryOperatorLoc; + classKeywordLoc; /** * @type Node */ - value; + constantPath; + /** + * @type Location | null + */ + inheritanceOperatorLoc; + /** + * @type Node | null + */ + superclass; + /** + * @type Node | null + */ + body; + /** + * @type Location + */ + endKeywordLoc; /** * @type string */ - binaryOperator; + name; /** - * Construct a new ConstantPathOperatorWriteNode. + * Construct a new ClassNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {ConstantPathNode} target - * @param {Location} binaryOperatorLoc - * @param {Node} value - * @param {string} binaryOperator + * @param {string[]} locals + * @param {Location} classKeywordLoc + * @param {Node} constantPath + * @param {Location | null} inheritanceOperatorLoc + * @param {Node | null} superclass + * @param {Node | null} body + * @param {Location} endKeywordLoc + * @param {string} name */ - constructor(nodeID, location, flags, target2, binaryOperatorLoc, value, binaryOperator) { + constructor(nodeID, location, flags, locals, classKeywordLoc, constantPath, inheritanceOperatorLoc, superclass, body, endKeywordLoc, name2) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.target = target2; - this.binaryOperatorLoc = binaryOperatorLoc; - this.value = value; - this.binaryOperator = binaryOperator; + this.locals = locals; + this.classKeywordLoc = classKeywordLoc; + this.constantPath = constantPath; + this.inheritanceOperatorLoc = inheritanceOperatorLoc; + this.superclass = superclass; + this.body = body; + this.endKeywordLoc = endKeywordLoc; + this.name = name2; } /** * Accept a visitor for this node. @@ -7296,7 +16694,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitConstantPathOperatorWriteNode(this); + visitor.visitClassNode(this); } /** * Returns all child nodes of the current node. @@ -7304,7 +16702,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.target, this.value]; + return [this.constantPath, this.superclass, this.body]; } /** * Compact and return an array of child nodes. @@ -7312,7 +16710,15 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.target, this.value]; + const compact = []; + compact.push(this.constantPath); + if (this.superclass) { + compact.push(this.superclass); + } + if (this.body) { + compact.push(this.body); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -7321,17 +16727,21 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ConstantPathOperatorWriteNode", + type: "ClassNode", location: this.location, flags: this.#flags, - target: this.target, - binaryOperatorLoc: this.binaryOperatorLoc, - value: this.value, - binaryOperator: this.binaryOperator + locals: this.locals, + classKeywordLoc: this.classKeywordLoc, + constantPath: this.constantPath, + inheritanceOperatorLoc: this.inheritanceOperatorLoc, + superclass: this.superclass, + body: this.body, + endKeywordLoc: this.endKeywordLoc, + name: this.name }; } }; - var ConstantPathOrWriteNode = class { + var ClassVariableAndWriteNode = class { /** * @type number */ @@ -7345,9 +16755,13 @@ var HerbLinter = (() => { */ #flags; /** - * @type ConstantPathNode + * @type string */ - target; + name; + /** + * @type Location + */ + nameLoc; /** * @type Location */ @@ -7357,20 +16771,22 @@ var HerbLinter = (() => { */ value; /** - * Construct a new ConstantPathOrWriteNode. + * Construct a new ClassVariableAndWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {ConstantPathNode} target + * @param {string} name + * @param {Location} nameLoc * @param {Location} operatorLoc * @param {Node} value */ - constructor(nodeID, location, flags, target2, operatorLoc, value) { + constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.target = target2; + this.name = name2; + this.nameLoc = nameLoc; this.operatorLoc = operatorLoc; this.value = value; } @@ -7380,7 +16796,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitConstantPathOrWriteNode(this); + visitor.visitClassVariableAndWriteNode(this); } /** * Returns all child nodes of the current node. @@ -7388,7 +16804,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.target, this.value]; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -7396,7 +16812,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.target, this.value]; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -7405,16 +16821,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ConstantPathOrWriteNode", + type: "ClassVariableAndWriteNode", location: this.location, flags: this.#flags, - target: this.target, + name: this.name, + nameLoc: this.nameLoc, operatorLoc: this.operatorLoc, value: this.value }; } }; - var ConstantPathTargetNode = class { + var ClassVariableOperatorWriteNode = class { /** * @type number */ @@ -7428,40 +16845,46 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node | null - */ - parent; - /** - * @type string | null + * @type string */ name; /** * @type Location */ - delimiterLoc; + nameLoc; /** * @type Location */ - nameLoc; + binaryOperatorLoc; /** - * Construct a new ConstantPathTargetNode. + * @type Node + */ + value; + /** + * @type string + */ + binaryOperator; + /** + * Construct a new ClassVariableOperatorWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node | null} parent - * @param {string | null} name - * @param {Location} delimiterLoc + * @param {string} name * @param {Location} nameLoc + * @param {Location} binaryOperatorLoc + * @param {Node} value + * @param {string} binaryOperator */ - constructor(nodeID, location, flags, parent, name2, delimiterLoc, nameLoc) { + constructor(nodeID, location, flags, name2, nameLoc, binaryOperatorLoc, value, binaryOperator) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.parent = parent; this.name = name2; - this.delimiterLoc = delimiterLoc; this.nameLoc = nameLoc; + this.binaryOperatorLoc = binaryOperatorLoc; + this.value = value; + this.binaryOperator = binaryOperator; } /** * Accept a visitor for this node. @@ -7469,7 +16892,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitConstantPathTargetNode(this); + visitor.visitClassVariableOperatorWriteNode(this); } /** * Returns all child nodes of the current node. @@ -7477,7 +16900,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.parent]; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -7485,11 +16908,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.parent) { - compact.push(this.parent); - } - return compact; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -7498,17 +16917,18 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ConstantPathTargetNode", + type: "ClassVariableOperatorWriteNode", location: this.location, flags: this.#flags, - parent: this.parent, name: this.name, - delimiterLoc: this.delimiterLoc, - nameLoc: this.nameLoc + nameLoc: this.nameLoc, + binaryOperatorLoc: this.binaryOperatorLoc, + value: this.value, + binaryOperator: this.binaryOperator }; } }; - var ConstantPathWriteNode = class { + var ClassVariableOrWriteNode = class { /** * @type number */ @@ -7522,9 +16942,13 @@ var HerbLinter = (() => { */ #flags; /** - * @type ConstantPathNode + * @type string */ - target; + name; + /** + * @type Location + */ + nameLoc; /** * @type Location */ @@ -7534,20 +16958,22 @@ var HerbLinter = (() => { */ value; /** - * Construct a new ConstantPathWriteNode. + * Construct a new ClassVariableOrWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {ConstantPathNode} target + * @param {string} name + * @param {Location} nameLoc * @param {Location} operatorLoc * @param {Node} value */ - constructor(nodeID, location, flags, target2, operatorLoc, value) { + constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.target = target2; + this.name = name2; + this.nameLoc = nameLoc; this.operatorLoc = operatorLoc; this.value = value; } @@ -7557,7 +16983,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitConstantPathWriteNode(this); + visitor.visitClassVariableOrWriteNode(this); } /** * Returns all child nodes of the current node. @@ -7565,7 +16991,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.target, this.value]; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -7573,7 +16999,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.target, this.value]; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -7582,16 +17008,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ConstantPathWriteNode", + type: "ClassVariableOrWriteNode", location: this.location, flags: this.#flags, - target: this.target, + name: this.name, + nameLoc: this.nameLoc, operatorLoc: this.operatorLoc, value: this.value }; } }; - var ConstantReadNode = class { + var ClassVariableReadNode = class { /** * @type number */ @@ -7609,7 +17036,7 @@ var HerbLinter = (() => { */ name; /** - * Construct a new ConstantReadNode. + * Construct a new ClassVariableReadNode. * * @param {number} nodeID * @param {Location} location @@ -7628,7 +17055,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitConstantReadNode(this); + visitor.visitClassVariableReadNode(this); } /** * Returns all child nodes of the current node. @@ -7653,14 +17080,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ConstantReadNode", + type: "ClassVariableReadNode", location: this.location, flags: this.#flags, name: this.name }; } }; - var ConstantTargetNode = class { + var ClassVariableTargetNode = class { /** * @type number */ @@ -7678,7 +17105,7 @@ var HerbLinter = (() => { */ name; /** - * Construct a new ConstantTargetNode. + * Construct a new ClassVariableTargetNode. * * @param {number} nodeID * @param {Location} location @@ -7697,7 +17124,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitConstantTargetNode(this); + visitor.visitClassVariableTargetNode(this); } /** * Returns all child nodes of the current node. @@ -7722,14 +17149,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ConstantTargetNode", + type: "ClassVariableTargetNode", location: this.location, flags: this.#flags, name: this.name }; } }; - var ConstantWriteNode = class { + var ClassVariableWriteNode = class { /** * @type number */ @@ -7759,7 +17186,7 @@ var HerbLinter = (() => { */ operatorLoc; /** - * Construct a new ConstantWriteNode. + * Construct a new ClassVariableWriteNode. * * @param {number} nodeID * @param {Location} location @@ -7784,7 +17211,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitConstantWriteNode(this); + visitor.visitClassVariableWriteNode(this); } /** * Returns all child nodes of the current node. @@ -7809,7 +17236,7 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ConstantWriteNode", + type: "ClassVariableWriteNode", location: this.location, flags: this.#flags, name: this.name, @@ -7819,7 +17246,7 @@ var HerbLinter = (() => { }; } }; - var DefNode = class { + var ConstantAndWriteNode = class { /** * @type number */ @@ -7840,81 +17267,33 @@ var HerbLinter = (() => { * @type Location */ nameLoc; - /** - * @type Node | null - */ - receiver; - /** - * @type ParametersNode | null - */ - parameters; - /** - * @type Node | null - */ - body; - /** - * @type string[] - */ - locals; /** * @type Location */ - defKeywordLoc; - /** - * @type Location | null - */ operatorLoc; /** - * @type Location | null - */ - lparenLoc; - /** - * @type Location | null - */ - rparenLoc; - /** - * @type Location | null - */ - equalLoc; - /** - * @type Location | null + * @type Node */ - endKeywordLoc; + value; /** - * Construct a new DefNode. + * Construct a new ConstantAndWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags * @param {string} name * @param {Location} nameLoc - * @param {Node | null} receiver - * @param {ParametersNode | null} parameters - * @param {Node | null} body - * @param {string[]} locals - * @param {Location} defKeywordLoc - * @param {Location | null} operatorLoc - * @param {Location | null} lparenLoc - * @param {Location | null} rparenLoc - * @param {Location | null} equalLoc - * @param {Location | null} endKeywordLoc + * @param {Location} operatorLoc + * @param {Node} value */ - constructor(nodeID, location, flags, name2, nameLoc, receiver, parameters, body, locals, defKeywordLoc, operatorLoc, lparenLoc, rparenLoc, equalLoc, endKeywordLoc) { + constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; this.name = name2; this.nameLoc = nameLoc; - this.receiver = receiver; - this.parameters = parameters; - this.body = body; - this.locals = locals; - this.defKeywordLoc = defKeywordLoc; this.operatorLoc = operatorLoc; - this.lparenLoc = lparenLoc; - this.rparenLoc = rparenLoc; - this.equalLoc = equalLoc; - this.endKeywordLoc = endKeywordLoc; + this.value = value; } /** * Accept a visitor for this node. @@ -7922,7 +17301,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitDefNode(this); + visitor.visitConstantAndWriteNode(this); } /** * Returns all child nodes of the current node. @@ -7930,7 +17309,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.receiver, this.parameters, this.body]; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -7938,17 +17317,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.receiver) { - compact.push(this.receiver); - } - if (this.parameters) { - compact.push(this.parameters); - } - if (this.body) { - compact.push(this.body); - } - return compact; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -7957,25 +17326,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "DefNode", + type: "ConstantAndWriteNode", location: this.location, flags: this.#flags, name: this.name, nameLoc: this.nameLoc, - receiver: this.receiver, - parameters: this.parameters, - body: this.body, - locals: this.locals, - defKeywordLoc: this.defKeywordLoc, operatorLoc: this.operatorLoc, - lparenLoc: this.lparenLoc, - rparenLoc: this.rparenLoc, - equalLoc: this.equalLoc, - endKeywordLoc: this.endKeywordLoc + value: this.value }; } }; - var DefinedNode = class { + var ConstantOperatorWriteNode = class { /** * @type number */ @@ -7989,40 +17350,46 @@ var HerbLinter = (() => { */ #flags; /** - * @type Location | null + * @type string */ - lparenLoc; + name; /** - * @type Node + * @type Location */ - value; + nameLoc; /** - * @type Location | null + * @type Location */ - rparenLoc; + binaryOperatorLoc; /** - * @type Location + * @type Node */ - keywordLoc; + value; /** - * Construct a new DefinedNode. + * @type string + */ + binaryOperator; + /** + * Construct a new ConstantOperatorWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location | null} lparenLoc + * @param {string} name + * @param {Location} nameLoc + * @param {Location} binaryOperatorLoc * @param {Node} value - * @param {Location | null} rparenLoc - * @param {Location} keywordLoc + * @param {string} binaryOperator */ - constructor(nodeID, location, flags, lparenLoc, value, rparenLoc, keywordLoc) { + constructor(nodeID, location, flags, name2, nameLoc, binaryOperatorLoc, value, binaryOperator) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.lparenLoc = lparenLoc; + this.name = name2; + this.nameLoc = nameLoc; + this.binaryOperatorLoc = binaryOperatorLoc; this.value = value; - this.rparenLoc = rparenLoc; - this.keywordLoc = keywordLoc; + this.binaryOperator = binaryOperator; } /** * Accept a visitor for this node. @@ -8030,7 +17397,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitDefinedNode(this); + visitor.visitConstantOperatorWriteNode(this); } /** * Returns all child nodes of the current node. @@ -8055,17 +17422,18 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "DefinedNode", + type: "ConstantOperatorWriteNode", location: this.location, flags: this.#flags, - lparenLoc: this.lparenLoc, + name: this.name, + nameLoc: this.nameLoc, + binaryOperatorLoc: this.binaryOperatorLoc, value: this.value, - rparenLoc: this.rparenLoc, - keywordLoc: this.keywordLoc + binaryOperator: this.binaryOperator }; } }; - var ElseNode = class { + var ConstantOrWriteNode = class { /** * @type number */ @@ -8078,35 +17446,41 @@ var HerbLinter = (() => { * @type number */ #flags; + /** + * @type string + */ + name; /** * @type Location */ - elseKeywordLoc; + nameLoc; /** - * @type StatementsNode | null + * @type Location */ - statements; + operatorLoc; /** - * @type Location | null + * @type Node */ - endKeywordLoc; + value; /** - * Construct a new ElseNode. + * Construct a new ConstantOrWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} elseKeywordLoc - * @param {StatementsNode | null} statements - * @param {Location | null} endKeywordLoc + * @param {string} name + * @param {Location} nameLoc + * @param {Location} operatorLoc + * @param {Node} value */ - constructor(nodeID, location, flags, elseKeywordLoc, statements, endKeywordLoc) { + constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.elseKeywordLoc = elseKeywordLoc; - this.statements = statements; - this.endKeywordLoc = endKeywordLoc; + this.name = name2; + this.nameLoc = nameLoc; + this.operatorLoc = operatorLoc; + this.value = value; } /** * Accept a visitor for this node. @@ -8114,7 +17488,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitElseNode(this); + visitor.visitConstantOrWriteNode(this); } /** * Returns all child nodes of the current node. @@ -8122,7 +17496,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.statements]; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -8130,11 +17504,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.statements) { - compact.push(this.statements); - } - return compact; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -8143,16 +17513,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ElseNode", + type: "ConstantOrWriteNode", location: this.location, flags: this.#flags, - elseKeywordLoc: this.elseKeywordLoc, - statements: this.statements, - endKeywordLoc: this.endKeywordLoc + name: this.name, + nameLoc: this.nameLoc, + operatorLoc: this.operatorLoc, + value: this.value }; } }; - var EmbeddedStatementsNode = class { + var ConstantPathAndWriteNode = class { /** * @type number */ @@ -8166,34 +17537,34 @@ var HerbLinter = (() => { */ #flags; /** - * @type Location + * @type ConstantPathNode */ - openingLoc; + target; /** - * @type StatementsNode | null + * @type Location */ - statements; + operatorLoc; /** - * @type Location + * @type Node */ - closingLoc; + value; /** - * Construct a new EmbeddedStatementsNode. + * Construct a new ConstantPathAndWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} openingLoc - * @param {StatementsNode | null} statements - * @param {Location} closingLoc + * @param {ConstantPathNode} target + * @param {Location} operatorLoc + * @param {Node} value */ - constructor(nodeID, location, flags, openingLoc, statements, closingLoc) { + constructor(nodeID, location, flags, target, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.openingLoc = openingLoc; - this.statements = statements; - this.closingLoc = closingLoc; + this.target = target; + this.operatorLoc = operatorLoc; + this.value = value; } /** * Accept a visitor for this node. @@ -8201,7 +17572,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitEmbeddedStatementsNode(this); + visitor.visitConstantPathAndWriteNode(this); } /** * Returns all child nodes of the current node. @@ -8209,7 +17580,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.statements]; + return [this.target, this.value]; } /** * Compact and return an array of child nodes. @@ -8217,11 +17588,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.statements) { - compact.push(this.statements); - } - return compact; + return [this.target, this.value]; } /** * Transforms the Node to a JavaScript object. @@ -8230,16 +17597,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "EmbeddedStatementsNode", + type: "ConstantPathAndWriteNode", location: this.location, flags: this.#flags, - openingLoc: this.openingLoc, - statements: this.statements, - closingLoc: this.closingLoc + target: this.target, + operatorLoc: this.operatorLoc, + value: this.value }; } }; - var EmbeddedVariableNode = class { + var ConstantPathNode = class { /** * @type number */ @@ -8252,29 +17619,41 @@ var HerbLinter = (() => { * @type number */ #flags; + /** + * @type Node | null + */ + parent; + /** + * @type string | null + */ + name; /** * @type Location */ - operatorLoc; + delimiterLoc; /** - * @type Node + * @type Location */ - variable; + nameLoc; /** - * Construct a new EmbeddedVariableNode. + * Construct a new ConstantPathNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} operatorLoc - * @param {Node} variable + * @param {Node | null} parent + * @param {string | null} name + * @param {Location} delimiterLoc + * @param {Location} nameLoc */ - constructor(nodeID, location, flags, operatorLoc, variable) { + constructor(nodeID, location, flags, parent, name2, delimiterLoc, nameLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.operatorLoc = operatorLoc; - this.variable = variable; + this.parent = parent; + this.name = name2; + this.delimiterLoc = delimiterLoc; + this.nameLoc = nameLoc; } /** * Accept a visitor for this node. @@ -8282,7 +17661,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitEmbeddedVariableNode(this); + visitor.visitConstantPathNode(this); } /** * Returns all child nodes of the current node. @@ -8290,7 +17669,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.variable]; + return [this.parent]; } /** * Compact and return an array of child nodes. @@ -8298,7 +17677,11 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.variable]; + const compact = []; + if (this.parent) { + compact.push(this.parent); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -8307,15 +17690,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "EmbeddedVariableNode", + type: "ConstantPathNode", location: this.location, flags: this.#flags, - operatorLoc: this.operatorLoc, - variable: this.variable + parent: this.parent, + name: this.name, + delimiterLoc: this.delimiterLoc, + nameLoc: this.nameLoc }; } }; - var EnsureNode = class { + var ConstantPathOperatorWriteNode = class { /** * @type number */ @@ -8328,35 +17713,41 @@ var HerbLinter = (() => { * @type number */ #flags; + /** + * @type ConstantPathNode + */ + target; /** * @type Location */ - ensureKeywordLoc; + binaryOperatorLoc; /** - * @type StatementsNode | null + * @type Node */ - statements; + value; /** - * @type Location + * @type string */ - endKeywordLoc; + binaryOperator; /** - * Construct a new EnsureNode. + * Construct a new ConstantPathOperatorWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} ensureKeywordLoc - * @param {StatementsNode | null} statements - * @param {Location} endKeywordLoc + * @param {ConstantPathNode} target + * @param {Location} binaryOperatorLoc + * @param {Node} value + * @param {string} binaryOperator */ - constructor(nodeID, location, flags, ensureKeywordLoc, statements, endKeywordLoc) { + constructor(nodeID, location, flags, target, binaryOperatorLoc, value, binaryOperator) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.ensureKeywordLoc = ensureKeywordLoc; - this.statements = statements; - this.endKeywordLoc = endKeywordLoc; + this.target = target; + this.binaryOperatorLoc = binaryOperatorLoc; + this.value = value; + this.binaryOperator = binaryOperator; } /** * Accept a visitor for this node. @@ -8364,7 +17755,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitEnsureNode(this); + visitor.visitConstantPathOperatorWriteNode(this); } /** * Returns all child nodes of the current node. @@ -8372,7 +17763,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.statements]; + return [this.target, this.value]; } /** * Compact and return an array of child nodes. @@ -8380,11 +17771,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.statements) { - compact.push(this.statements); - } - return compact; + return [this.target, this.value]; } /** * Transforms the Node to a JavaScript object. @@ -8393,16 +17780,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "EnsureNode", + type: "ConstantPathOperatorWriteNode", location: this.location, flags: this.#flags, - ensureKeywordLoc: this.ensureKeywordLoc, - statements: this.statements, - endKeywordLoc: this.endKeywordLoc + target: this.target, + binaryOperatorLoc: this.binaryOperatorLoc, + value: this.value, + binaryOperator: this.binaryOperator }; } }; - var FalseNode = class { + var ConstantPathOrWriteNode = class { /** * @type number */ @@ -8416,16 +17804,34 @@ var HerbLinter = (() => { */ #flags; /** - * Construct a new FalseNode. + * @type ConstantPathNode + */ + target; + /** + * @type Location + */ + operatorLoc; + /** + * @type Node + */ + value; + /** + * Construct a new ConstantPathOrWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {ConstantPathNode} target + * @param {Location} operatorLoc + * @param {Node} value */ - constructor(nodeID, location, flags) { + constructor(nodeID, location, flags, target, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.target = target; + this.operatorLoc = operatorLoc; + this.value = value; } /** * Accept a visitor for this node. @@ -8433,7 +17839,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitFalseNode(this); + visitor.visitConstantPathOrWriteNode(this); } /** * Returns all child nodes of the current node. @@ -8441,7 +17847,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.target, this.value]; } /** * Compact and return an array of child nodes. @@ -8449,7 +17855,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + return [this.target, this.value]; } /** * Transforms the Node to a JavaScript object. @@ -8458,13 +17864,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "FalseNode", + type: "ConstantPathOrWriteNode", location: this.location, - flags: this.#flags + flags: this.#flags, + target: this.target, + operatorLoc: this.operatorLoc, + value: this.value }; } }; - var FindPatternNode = class { + var ConstantPathTargetNode = class { /** * @type number */ @@ -8480,50 +17889,38 @@ var HerbLinter = (() => { /** * @type Node | null */ - constant; - /** - * @type SplatNode - */ - left; - /** - * @type Node[] - */ - requireds; + parent; /** - * @type Node + * @type string | null */ - right; + name; /** - * @type Location | null + * @type Location */ - openingLoc; + delimiterLoc; /** - * @type Location | null + * @type Location */ - closingLoc; + nameLoc; /** - * Construct a new FindPatternNode. + * Construct a new ConstantPathTargetNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node | null} constant - * @param {SplatNode} left - * @param {Node[]} requireds - * @param {Node} right - * @param {Location | null} openingLoc - * @param {Location | null} closingLoc + * @param {Node | null} parent + * @param {string | null} name + * @param {Location} delimiterLoc + * @param {Location} nameLoc */ - constructor(nodeID, location, flags, constant, left, requireds, right, openingLoc, closingLoc) { + constructor(nodeID, location, flags, parent, name2, delimiterLoc, nameLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.constant = constant; - this.left = left; - this.requireds = requireds; - this.right = right; - this.openingLoc = openingLoc; - this.closingLoc = closingLoc; + this.parent = parent; + this.name = name2; + this.delimiterLoc = delimiterLoc; + this.nameLoc = nameLoc; } /** * Accept a visitor for this node. @@ -8531,7 +17928,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitFindPatternNode(this); + visitor.visitConstantPathTargetNode(this); } /** * Returns all child nodes of the current node. @@ -8539,7 +17936,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.constant, this.left, ...this.requireds, this.right]; + return [this.parent]; } /** * Compact and return an array of child nodes. @@ -8548,12 +17945,9 @@ var HerbLinter = (() => { */ compactChildNodes() { const compact = []; - if (this.constant) { - compact.push(this.constant); + if (this.parent) { + compact.push(this.parent); } - compact.push(this.left); - compact.concat(this.requireds); - compact.push(this.right); return compact; } /** @@ -8563,19 +17957,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "FindPatternNode", + type: "ConstantPathTargetNode", location: this.location, flags: this.#flags, - constant: this.constant, - left: this.left, - requireds: this.requireds, - right: this.right, - openingLoc: this.openingLoc, - closingLoc: this.closingLoc + parent: this.parent, + name: this.name, + delimiterLoc: this.delimiterLoc, + nameLoc: this.nameLoc }; } }; - var FlipFlopNode = class { + var ConstantPathWriteNode = class { /** * @type number */ @@ -8589,42 +17981,34 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node | null - */ - left; - /** - * @type Node | null + * @type ConstantPathNode */ - right; + target; /** * @type Location */ operatorLoc; /** - * Construct a new FlipFlopNode. + * @type Node + */ + value; + /** + * Construct a new ConstantPathWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node | null} left - * @param {Node | null} right + * @param {ConstantPathNode} target * @param {Location} operatorLoc + * @param {Node} value */ - constructor(nodeID, location, flags, left, right, operatorLoc) { + constructor(nodeID, location, flags, target, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.left = left; - this.right = right; + this.target = target; this.operatorLoc = operatorLoc; - } - /** - * True if this node has the EXCLUDE_END flag. - * - * @returns {boolean} - */ - isExcludeEnd() { - return (this.#flags & RangeFlags.EXCLUDE_END) !== 0; + this.value = value; } /** * Accept a visitor for this node. @@ -8632,7 +18016,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitFlipFlopNode(this); + visitor.visitConstantPathWriteNode(this); } /** * Returns all child nodes of the current node. @@ -8640,7 +18024,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.left, this.right]; + return [this.target, this.value]; } /** * Compact and return an array of child nodes. @@ -8648,14 +18032,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.left) { - compact.push(this.left); - } - if (this.right) { - compact.push(this.right); - } - return compact; + return [this.target, this.value]; } /** * Transforms the Node to a JavaScript object. @@ -8664,16 +18041,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "FlipFlopNode", + type: "ConstantPathWriteNode", location: this.location, flags: this.#flags, - left: this.left, - right: this.right, - operatorLoc: this.operatorLoc + target: this.target, + operatorLoc: this.operatorLoc, + value: this.value }; } }; - var FloatNode = class { + var ConstantReadNode = class { /** * @type number */ @@ -8687,22 +18064,22 @@ var HerbLinter = (() => { */ #flags; /** - * @type number + * @type string */ - value; + name; /** - * Construct a new FloatNode. + * Construct a new ConstantReadNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {number} value + * @param {string} name */ - constructor(nodeID, location, flags, value) { + constructor(nodeID, location, flags, name2) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.value = value; + this.name = name2; } /** * Accept a visitor for this node. @@ -8710,7 +18087,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitFloatNode(this); + visitor.visitConstantReadNode(this); } /** * Returns all child nodes of the current node. @@ -8735,14 +18112,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "FloatNode", + type: "ConstantReadNode", location: this.location, flags: this.#flags, - value: this.value + name: this.name }; } }; - var ForNode = class { + var ConstantTargetNode = class { /** * @type number */ @@ -8756,58 +18133,22 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node - */ - index; - /** - * @type Node - */ - collection; - /** - * @type StatementsNode | null - */ - statements; - /** - * @type Location - */ - forKeywordLoc; - /** - * @type Location - */ - inKeywordLoc; - /** - * @type Location | null - */ - doKeywordLoc; - /** - * @type Location + * @type string */ - endKeywordLoc; + name; /** - * Construct a new ForNode. + * Construct a new ConstantTargetNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node} index - * @param {Node} collection - * @param {StatementsNode | null} statements - * @param {Location} forKeywordLoc - * @param {Location} inKeywordLoc - * @param {Location | null} doKeywordLoc - * @param {Location} endKeywordLoc + * @param {string} name */ - constructor(nodeID, location, flags, index, collection, statements, forKeywordLoc, inKeywordLoc, doKeywordLoc, endKeywordLoc) { + constructor(nodeID, location, flags, name2) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.index = index; - this.collection = collection; - this.statements = statements; - this.forKeywordLoc = forKeywordLoc; - this.inKeywordLoc = inKeywordLoc; - this.doKeywordLoc = doKeywordLoc; - this.endKeywordLoc = endKeywordLoc; + this.name = name2; } /** * Accept a visitor for this node. @@ -8815,7 +18156,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitForNode(this); + visitor.visitConstantTargetNode(this); } /** * Returns all child nodes of the current node. @@ -8823,7 +18164,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.index, this.collection, this.statements]; + return []; } /** * Compact and return an array of child nodes. @@ -8831,13 +18172,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - compact.push(this.index); - compact.push(this.collection); - if (this.statements) { - compact.push(this.statements); - } - return compact; + return []; } /** * Transforms the Node to a JavaScript object. @@ -8846,20 +18181,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ForNode", + type: "ConstantTargetNode", location: this.location, flags: this.#flags, - index: this.index, - collection: this.collection, - statements: this.statements, - forKeywordLoc: this.forKeywordLoc, - inKeywordLoc: this.inKeywordLoc, - doKeywordLoc: this.doKeywordLoc, - endKeywordLoc: this.endKeywordLoc + name: this.name }; } }; - var ForwardingArgumentsNode = class { + var ConstantWriteNode = class { /** * @type number */ @@ -8873,16 +18202,40 @@ var HerbLinter = (() => { */ #flags; /** - * Construct a new ForwardingArgumentsNode. + * @type string + */ + name; + /** + * @type Location + */ + nameLoc; + /** + * @type Node + */ + value; + /** + * @type Location + */ + operatorLoc; + /** + * Construct a new ConstantWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {string} name + * @param {Location} nameLoc + * @param {Node} value + * @param {Location} operatorLoc */ - constructor(nodeID, location, flags) { + constructor(nodeID, location, flags, name2, nameLoc, value, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.name = name2; + this.nameLoc = nameLoc; + this.value = value; + this.operatorLoc = operatorLoc; } /** * Accept a visitor for this node. @@ -8890,7 +18243,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitForwardingArgumentsNode(this); + visitor.visitConstantWriteNode(this); } /** * Returns all child nodes of the current node. @@ -8898,7 +18251,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -8906,7 +18259,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -8915,13 +18268,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ForwardingArgumentsNode", + type: "ConstantWriteNode", location: this.location, - flags: this.#flags + flags: this.#flags, + name: this.name, + nameLoc: this.nameLoc, + value: this.value, + operatorLoc: this.operatorLoc }; } }; - var ForwardingParameterNode = class { + var DefNode = class { /** * @type number */ @@ -8935,16 +18292,88 @@ var HerbLinter = (() => { */ #flags; /** - * Construct a new ForwardingParameterNode. + * @type string + */ + name; + /** + * @type Location + */ + nameLoc; + /** + * @type Node | null + */ + receiver; + /** + * @type ParametersNode | null + */ + parameters; + /** + * @type Node | null + */ + body; + /** + * @type string[] + */ + locals; + /** + * @type Location + */ + defKeywordLoc; + /** + * @type Location | null + */ + operatorLoc; + /** + * @type Location | null + */ + lparenLoc; + /** + * @type Location | null + */ + rparenLoc; + /** + * @type Location | null + */ + equalLoc; + /** + * @type Location | null + */ + endKeywordLoc; + /** + * Construct a new DefNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {string} name + * @param {Location} nameLoc + * @param {Node | null} receiver + * @param {ParametersNode | null} parameters + * @param {Node | null} body + * @param {string[]} locals + * @param {Location} defKeywordLoc + * @param {Location | null} operatorLoc + * @param {Location | null} lparenLoc + * @param {Location | null} rparenLoc + * @param {Location | null} equalLoc + * @param {Location | null} endKeywordLoc */ - constructor(nodeID, location, flags) { + constructor(nodeID, location, flags, name2, nameLoc, receiver, parameters, body, locals, defKeywordLoc, operatorLoc, lparenLoc, rparenLoc, equalLoc, endKeywordLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.name = name2; + this.nameLoc = nameLoc; + this.receiver = receiver; + this.parameters = parameters; + this.body = body; + this.locals = locals; + this.defKeywordLoc = defKeywordLoc; + this.operatorLoc = operatorLoc; + this.lparenLoc = lparenLoc; + this.rparenLoc = rparenLoc; + this.equalLoc = equalLoc; + this.endKeywordLoc = endKeywordLoc; } /** * Accept a visitor for this node. @@ -8952,7 +18381,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitForwardingParameterNode(this); + visitor.visitDefNode(this); } /** * Returns all child nodes of the current node. @@ -8960,7 +18389,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.receiver, this.parameters, this.body]; } /** * Compact and return an array of child nodes. @@ -8968,7 +18397,17 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + const compact = []; + if (this.receiver) { + compact.push(this.receiver); + } + if (this.parameters) { + compact.push(this.parameters); + } + if (this.body) { + compact.push(this.body); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -8977,13 +18416,25 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ForwardingParameterNode", + type: "DefNode", location: this.location, - flags: this.#flags + flags: this.#flags, + name: this.name, + nameLoc: this.nameLoc, + receiver: this.receiver, + parameters: this.parameters, + body: this.body, + locals: this.locals, + defKeywordLoc: this.defKeywordLoc, + operatorLoc: this.operatorLoc, + lparenLoc: this.lparenLoc, + rparenLoc: this.rparenLoc, + equalLoc: this.equalLoc, + endKeywordLoc: this.endKeywordLoc }; } }; - var ForwardingSuperNode = class { + var DefinedNode = class { /** * @type number */ @@ -8997,22 +18448,40 @@ var HerbLinter = (() => { */ #flags; /** - * @type BlockNode | null + * @type Location | null */ - block; + lparenLoc; /** - * Construct a new ForwardingSuperNode. + * @type Node + */ + value; + /** + * @type Location | null + */ + rparenLoc; + /** + * @type Location + */ + keywordLoc; + /** + * Construct a new DefinedNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {BlockNode | null} block + * @param {Location | null} lparenLoc + * @param {Node} value + * @param {Location | null} rparenLoc + * @param {Location} keywordLoc */ - constructor(nodeID, location, flags, block2) { + constructor(nodeID, location, flags, lparenLoc, value, rparenLoc, keywordLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.block = block2; + this.lparenLoc = lparenLoc; + this.value = value; + this.rparenLoc = rparenLoc; + this.keywordLoc = keywordLoc; } /** * Accept a visitor for this node. @@ -9020,7 +18489,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitForwardingSuperNode(this); + visitor.visitDefinedNode(this); } /** * Returns all child nodes of the current node. @@ -9028,7 +18497,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.block]; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -9036,11 +18505,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.block) { - compact.push(this.block); - } - return compact; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -9049,14 +18514,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ForwardingSuperNode", + type: "DefinedNode", location: this.location, flags: this.#flags, - block: this.block + lparenLoc: this.lparenLoc, + value: this.value, + rparenLoc: this.rparenLoc, + keywordLoc: this.keywordLoc }; } }; - var GlobalVariableAndWriteNode = class { + var ElseNode = class { /** * @type number */ @@ -9069,41 +18537,35 @@ var HerbLinter = (() => { * @type number */ #flags; - /** - * @type string - */ - name; /** * @type Location */ - nameLoc; + elseKeywordLoc; /** - * @type Location + * @type StatementsNode | null */ - operatorLoc; + statements; /** - * @type Node + * @type Location | null */ - value; + endKeywordLoc; /** - * Construct a new GlobalVariableAndWriteNode. + * Construct a new ElseNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name - * @param {Location} nameLoc - * @param {Location} operatorLoc - * @param {Node} value + * @param {Location} elseKeywordLoc + * @param {StatementsNode | null} statements + * @param {Location | null} endKeywordLoc */ - constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { + constructor(nodeID, location, flags, elseKeywordLoc, statements, endKeywordLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; - this.nameLoc = nameLoc; - this.operatorLoc = operatorLoc; - this.value = value; + this.elseKeywordLoc = elseKeywordLoc; + this.statements = statements; + this.endKeywordLoc = endKeywordLoc; } /** * Accept a visitor for this node. @@ -9111,7 +18573,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitGlobalVariableAndWriteNode(this); + visitor.visitElseNode(this); } /** * Returns all child nodes of the current node. @@ -9119,7 +18581,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return [this.statements]; } /** * Compact and return an array of child nodes. @@ -9127,7 +18589,11 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + const compact = []; + if (this.statements) { + compact.push(this.statements); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -9136,17 +18602,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "GlobalVariableAndWriteNode", + type: "ElseNode", location: this.location, flags: this.#flags, - name: this.name, - nameLoc: this.nameLoc, - operatorLoc: this.operatorLoc, - value: this.value + elseKeywordLoc: this.elseKeywordLoc, + statements: this.statements, + endKeywordLoc: this.endKeywordLoc }; } }; - var GlobalVariableOperatorWriteNode = class { + var EmbeddedStatementsNode = class { /** * @type number */ @@ -9159,47 +18624,35 @@ var HerbLinter = (() => { * @type number */ #flags; - /** - * @type string - */ - name; - /** - * @type Location - */ - nameLoc; /** * @type Location */ - binaryOperatorLoc; + openingLoc; /** - * @type Node + * @type StatementsNode | null */ - value; + statements; /** - * @type string + * @type Location */ - binaryOperator; + closingLoc; /** - * Construct a new GlobalVariableOperatorWriteNode. + * Construct a new EmbeddedStatementsNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name - * @param {Location} nameLoc - * @param {Location} binaryOperatorLoc - * @param {Node} value - * @param {string} binaryOperator + * @param {Location} openingLoc + * @param {StatementsNode | null} statements + * @param {Location} closingLoc */ - constructor(nodeID, location, flags, name2, nameLoc, binaryOperatorLoc, value, binaryOperator) { + constructor(nodeID, location, flags, openingLoc, statements, closingLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; - this.nameLoc = nameLoc; - this.binaryOperatorLoc = binaryOperatorLoc; - this.value = value; - this.binaryOperator = binaryOperator; + this.openingLoc = openingLoc; + this.statements = statements; + this.closingLoc = closingLoc; } /** * Accept a visitor for this node. @@ -9207,7 +18660,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitGlobalVariableOperatorWriteNode(this); + visitor.visitEmbeddedStatementsNode(this); } /** * Returns all child nodes of the current node. @@ -9215,7 +18668,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return [this.statements]; } /** * Compact and return an array of child nodes. @@ -9223,7 +18676,11 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + const compact = []; + if (this.statements) { + compact.push(this.statements); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -9232,18 +18689,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "GlobalVariableOperatorWriteNode", + type: "EmbeddedStatementsNode", location: this.location, flags: this.#flags, - name: this.name, - nameLoc: this.nameLoc, - binaryOperatorLoc: this.binaryOperatorLoc, - value: this.value, - binaryOperator: this.binaryOperator + openingLoc: this.openingLoc, + statements: this.statements, + closingLoc: this.closingLoc }; } }; - var GlobalVariableOrWriteNode = class { + var EmbeddedVariableNode = class { /** * @type number */ @@ -9256,14 +18711,6 @@ var HerbLinter = (() => { * @type number */ #flags; - /** - * @type string - */ - name; - /** - * @type Location - */ - nameLoc; /** * @type Location */ @@ -9271,26 +18718,22 @@ var HerbLinter = (() => { /** * @type Node */ - value; + variable; /** - * Construct a new GlobalVariableOrWriteNode. + * Construct a new EmbeddedVariableNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name - * @param {Location} nameLoc * @param {Location} operatorLoc - * @param {Node} value + * @param {Node} variable */ - constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { + constructor(nodeID, location, flags, operatorLoc, variable) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; - this.nameLoc = nameLoc; this.operatorLoc = operatorLoc; - this.value = value; + this.variable = variable; } /** * Accept a visitor for this node. @@ -9298,7 +18741,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitGlobalVariableOrWriteNode(this); + visitor.visitEmbeddedVariableNode(this); } /** * Returns all child nodes of the current node. @@ -9306,7 +18749,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return [this.variable]; } /** * Compact and return an array of child nodes. @@ -9314,7 +18757,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + return [this.variable]; } /** * Transforms the Node to a JavaScript object. @@ -9323,17 +18766,15 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "GlobalVariableOrWriteNode", + type: "EmbeddedVariableNode", location: this.location, flags: this.#flags, - name: this.name, - nameLoc: this.nameLoc, operatorLoc: this.operatorLoc, - value: this.value + variable: this.variable }; } }; - var GlobalVariableReadNode = class { + var EnsureNode = class { /** * @type number */ @@ -9347,22 +18788,34 @@ var HerbLinter = (() => { */ #flags; /** - * @type string + * @type Location */ - name; + ensureKeywordLoc; /** - * Construct a new GlobalVariableReadNode. + * @type StatementsNode | null + */ + statements; + /** + * @type Location + */ + endKeywordLoc; + /** + * Construct a new EnsureNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name + * @param {Location} ensureKeywordLoc + * @param {StatementsNode | null} statements + * @param {Location} endKeywordLoc */ - constructor(nodeID, location, flags, name2) { + constructor(nodeID, location, flags, ensureKeywordLoc, statements, endKeywordLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; + this.ensureKeywordLoc = ensureKeywordLoc; + this.statements = statements; + this.endKeywordLoc = endKeywordLoc; } /** * Accept a visitor for this node. @@ -9370,7 +18823,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitGlobalVariableReadNode(this); + visitor.visitEnsureNode(this); } /** * Returns all child nodes of the current node. @@ -9378,7 +18831,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.statements]; } /** * Compact and return an array of child nodes. @@ -9386,7 +18839,11 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + const compact = []; + if (this.statements) { + compact.push(this.statements); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -9395,14 +18852,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "GlobalVariableReadNode", + type: "EnsureNode", location: this.location, flags: this.#flags, - name: this.name + ensureKeywordLoc: this.ensureKeywordLoc, + statements: this.statements, + endKeywordLoc: this.endKeywordLoc }; } }; - var GlobalVariableTargetNode = class { + var FalseNode = class { /** * @type number */ @@ -9416,22 +18875,16 @@ var HerbLinter = (() => { */ #flags; /** - * @type string - */ - name; - /** - * Construct a new GlobalVariableTargetNode. + * Construct a new FalseNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name */ - constructor(nodeID, location, flags, name2) { + constructor(nodeID, location, flags) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; } /** * Accept a visitor for this node. @@ -9439,7 +18892,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitGlobalVariableTargetNode(this); + visitor.visitFalseNode(this); } /** * Returns all child nodes of the current node. @@ -9464,14 +18917,13 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "GlobalVariableTargetNode", + type: "FalseNode", location: this.location, - flags: this.#flags, - name: this.name + flags: this.#flags }; } }; - var GlobalVariableWriteNode = class { + var FindPatternNode = class { /** * @type number */ @@ -9485,40 +18937,52 @@ var HerbLinter = (() => { */ #flags; /** - * @type string + * @type Node | null */ - name; + constant; /** - * @type Location + * @type SplatNode */ - nameLoc; + left; /** - * @type Node + * @type Node[] */ - value; + requireds; /** - * @type Location + * @type Node */ - operatorLoc; + right; /** - * Construct a new GlobalVariableWriteNode. + * @type Location | null + */ + openingLoc; + /** + * @type Location | null + */ + closingLoc; + /** + * Construct a new FindPatternNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name - * @param {Location} nameLoc - * @param {Node} value - * @param {Location} operatorLoc + * @param {Node | null} constant + * @param {SplatNode} left + * @param {Node[]} requireds + * @param {Node} right + * @param {Location | null} openingLoc + * @param {Location | null} closingLoc */ - constructor(nodeID, location, flags, name2, nameLoc, value, operatorLoc) { + constructor(nodeID, location, flags, constant, left, requireds, right, openingLoc, closingLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; - this.nameLoc = nameLoc; - this.value = value; - this.operatorLoc = operatorLoc; + this.constant = constant; + this.left = left; + this.requireds = requireds; + this.right = right; + this.openingLoc = openingLoc; + this.closingLoc = closingLoc; } /** * Accept a visitor for this node. @@ -9526,7 +18990,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitGlobalVariableWriteNode(this); + visitor.visitFindPatternNode(this); } /** * Returns all child nodes of the current node. @@ -9534,7 +18998,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return [this.constant, this.left, ...this.requireds, this.right]; } /** * Compact and return an array of child nodes. @@ -9542,7 +19006,14 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + const compact = []; + if (this.constant) { + compact.push(this.constant); + } + compact.push(this.left); + compact.concat(this.requireds); + compact.push(this.right); + return compact; } /** * Transforms the Node to a JavaScript object. @@ -9551,17 +19022,19 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "GlobalVariableWriteNode", + type: "FindPatternNode", location: this.location, flags: this.#flags, - name: this.name, - nameLoc: this.nameLoc, - value: this.value, - operatorLoc: this.operatorLoc + constant: this.constant, + left: this.left, + requireds: this.requireds, + right: this.right, + openingLoc: this.openingLoc, + closingLoc: this.closingLoc }; } }; - var HashNode = class { + var FlipFlopNode = class { /** * @type number */ @@ -9575,34 +19048,42 @@ var HerbLinter = (() => { */ #flags; /** - * @type Location + * @type Node | null */ - openingLoc; + left; /** - * @type Node[] + * @type Node | null */ - elements; + right; /** * @type Location */ - closingLoc; + operatorLoc; /** - * Construct a new HashNode. + * Construct a new FlipFlopNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} openingLoc - * @param {Node[]} elements - * @param {Location} closingLoc + * @param {Node | null} left + * @param {Node | null} right + * @param {Location} operatorLoc */ - constructor(nodeID, location, flags, openingLoc, elements, closingLoc) { + constructor(nodeID, location, flags, left, right, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.openingLoc = openingLoc; - this.elements = elements; - this.closingLoc = closingLoc; + this.left = left; + this.right = right; + this.operatorLoc = operatorLoc; + } + /** + * True if this node has the EXCLUDE_END flag. + * + * @returns {boolean} + */ + isExcludeEnd() { + return (this.#flags & RangeFlags.EXCLUDE_END) !== 0; } /** * Accept a visitor for this node. @@ -9610,7 +19091,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitHashNode(this); + visitor.visitFlipFlopNode(this); } /** * Returns all child nodes of the current node. @@ -9618,7 +19099,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [...this.elements]; + return [this.left, this.right]; } /** * Compact and return an array of child nodes. @@ -9626,7 +19107,14 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [...this.elements]; + const compact = []; + if (this.left) { + compact.push(this.left); + } + if (this.right) { + compact.push(this.right); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -9635,16 +19123,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "HashNode", + type: "FlipFlopNode", location: this.location, flags: this.#flags, - openingLoc: this.openingLoc, - elements: this.elements, - closingLoc: this.closingLoc + left: this.left, + right: this.right, + operatorLoc: this.operatorLoc }; } }; - var HashPatternNode = class { + var FloatNode = class { /** * @type number */ @@ -9658,46 +19146,22 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node | null - */ - constant; - /** - * @type Node[] - */ - elements; - /** - * @type Node | null - */ - rest; - /** - * @type Location | null - */ - openingLoc; - /** - * @type Location | null + * @type number */ - closingLoc; + value; /** - * Construct a new HashPatternNode. + * Construct a new FloatNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node | null} constant - * @param {Node[]} elements - * @param {Node | null} rest - * @param {Location | null} openingLoc - * @param {Location | null} closingLoc + * @param {number} value */ - constructor(nodeID, location, flags, constant, elements, rest, openingLoc, closingLoc) { + constructor(nodeID, location, flags, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.constant = constant; - this.elements = elements; - this.rest = rest; - this.openingLoc = openingLoc; - this.closingLoc = closingLoc; + this.value = value; } /** * Accept a visitor for this node. @@ -9705,7 +19169,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitHashPatternNode(this); + visitor.visitFloatNode(this); } /** * Returns all child nodes of the current node. @@ -9713,7 +19177,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.constant, ...this.elements, this.rest]; + return []; } /** * Compact and return an array of child nodes. @@ -9721,15 +19185,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.constant) { - compact.push(this.constant); - } - compact.concat(this.elements); - if (this.rest) { - compact.push(this.rest); - } - return compact; + return []; } /** * Transforms the Node to a JavaScript object. @@ -9738,18 +19194,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "HashPatternNode", + type: "FloatNode", location: this.location, flags: this.#flags, - constant: this.constant, - elements: this.elements, - rest: this.rest, - openingLoc: this.openingLoc, - closingLoc: this.closingLoc + value: this.value }; } }; - var IfNode = class { + var ForNode = class { /** * @type number */ @@ -9762,52 +19214,58 @@ var HerbLinter = (() => { * @type number */ #flags; - /** - * @type Location | null - */ - ifKeywordLoc; /** * @type Node */ - predicate; + index; /** - * @type Location | null + * @type Node */ - thenKeywordLoc; + collection; /** * @type StatementsNode | null */ statements; /** - * @type Node | null + * @type Location */ - subsequent; + forKeywordLoc; + /** + * @type Location + */ + inKeywordLoc; /** * @type Location | null */ + doKeywordLoc; + /** + * @type Location + */ endKeywordLoc; /** - * Construct a new IfNode. + * Construct a new ForNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location | null} ifKeywordLoc - * @param {Node} predicate - * @param {Location | null} thenKeywordLoc + * @param {Node} index + * @param {Node} collection * @param {StatementsNode | null} statements - * @param {Node | null} subsequent - * @param {Location | null} endKeywordLoc + * @param {Location} forKeywordLoc + * @param {Location} inKeywordLoc + * @param {Location | null} doKeywordLoc + * @param {Location} endKeywordLoc */ - constructor(nodeID, location, flags, ifKeywordLoc, predicate, thenKeywordLoc, statements, subsequent, endKeywordLoc) { + constructor(nodeID, location, flags, index, collection, statements, forKeywordLoc, inKeywordLoc, doKeywordLoc, endKeywordLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.ifKeywordLoc = ifKeywordLoc; - this.predicate = predicate; - this.thenKeywordLoc = thenKeywordLoc; + this.index = index; + this.collection = collection; this.statements = statements; - this.subsequent = subsequent; + this.forKeywordLoc = forKeywordLoc; + this.inKeywordLoc = inKeywordLoc; + this.doKeywordLoc = doKeywordLoc; this.endKeywordLoc = endKeywordLoc; } /** @@ -9816,7 +19274,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitIfNode(this); + visitor.visitForNode(this); } /** * Returns all child nodes of the current node. @@ -9824,7 +19282,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.predicate, this.statements, this.subsequent]; + return [this.index, this.collection, this.statements]; } /** * Compact and return an array of child nodes. @@ -9833,13 +19291,11 @@ var HerbLinter = (() => { */ compactChildNodes() { const compact = []; - compact.push(this.predicate); + compact.push(this.index); + compact.push(this.collection); if (this.statements) { compact.push(this.statements); } - if (this.subsequent) { - compact.push(this.subsequent); - } return compact; } /** @@ -9849,19 +19305,20 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "IfNode", + type: "ForNode", location: this.location, flags: this.#flags, - ifKeywordLoc: this.ifKeywordLoc, - predicate: this.predicate, - thenKeywordLoc: this.thenKeywordLoc, + index: this.index, + collection: this.collection, statements: this.statements, - subsequent: this.subsequent, + forKeywordLoc: this.forKeywordLoc, + inKeywordLoc: this.inKeywordLoc, + doKeywordLoc: this.doKeywordLoc, endKeywordLoc: this.endKeywordLoc }; } }; - var ImaginaryNode = class { + var ForwardingArgumentsNode = class { /** * @type number */ @@ -9875,22 +19332,16 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node - */ - numeric; - /** - * Construct a new ImaginaryNode. + * Construct a new ForwardingArgumentsNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node} numeric */ - constructor(nodeID, location, flags, numeric) { + constructor(nodeID, location, flags) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.numeric = numeric; } /** * Accept a visitor for this node. @@ -9898,7 +19349,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitImaginaryNode(this); + visitor.visitForwardingArgumentsNode(this); } /** * Returns all child nodes of the current node. @@ -9906,7 +19357,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.numeric]; + return []; } /** * Compact and return an array of child nodes. @@ -9914,7 +19365,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.numeric]; + return []; } /** * Transforms the Node to a JavaScript object. @@ -9923,14 +19374,13 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ImaginaryNode", + type: "ForwardingArgumentsNode", location: this.location, - flags: this.#flags, - numeric: this.numeric + flags: this.#flags }; } }; - var ImplicitNode = class { + var ForwardingParameterNode = class { /** * @type number */ @@ -9944,22 +19394,16 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node - */ - value; - /** - * Construct a new ImplicitNode. + * Construct a new ForwardingParameterNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node} value */ - constructor(nodeID, location, flags, value) { + constructor(nodeID, location, flags) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.value = value; } /** * Accept a visitor for this node. @@ -9967,7 +19411,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitImplicitNode(this); + visitor.visitForwardingParameterNode(this); } /** * Returns all child nodes of the current node. @@ -9975,7 +19419,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return []; } /** * Compact and return an array of child nodes. @@ -9983,7 +19427,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + return []; } /** * Transforms the Node to a JavaScript object. @@ -9992,14 +19436,13 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ImplicitNode", + type: "ForwardingParameterNode", location: this.location, - flags: this.#flags, - value: this.value + flags: this.#flags }; } }; - var ImplicitRestNode = class { + var ForwardingSuperNode = class { /** * @type number */ @@ -10013,16 +19456,22 @@ var HerbLinter = (() => { */ #flags; /** - * Construct a new ImplicitRestNode. + * @type BlockNode | null + */ + block; + /** + * Construct a new ForwardingSuperNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {BlockNode | null} block */ - constructor(nodeID, location, flags) { + constructor(nodeID, location, flags, block) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.block = block; } /** * Accept a visitor for this node. @@ -10030,7 +19479,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitImplicitRestNode(this); + visitor.visitForwardingSuperNode(this); } /** * Returns all child nodes of the current node. @@ -10038,7 +19487,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.block]; } /** * Compact and return an array of child nodes. @@ -10046,7 +19495,11 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + const compact = []; + if (this.block) { + compact.push(this.block); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -10055,13 +19508,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ImplicitRestNode", + type: "ForwardingSuperNode", location: this.location, - flags: this.#flags + flags: this.#flags, + block: this.block }; } }; - var InNode = class { + var GlobalVariableAndWriteNode = class { /** * @type number */ @@ -10075,40 +19529,40 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node + * @type string */ - pattern; + name; /** - * @type StatementsNode | null + * @type Location */ - statements; + nameLoc; /** * @type Location */ - inLoc; + operatorLoc; /** - * @type Location | null + * @type Node */ - thenLoc; + value; /** - * Construct a new InNode. + * Construct a new GlobalVariableAndWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node} pattern - * @param {StatementsNode | null} statements - * @param {Location} inLoc - * @param {Location | null} thenLoc + * @param {string} name + * @param {Location} nameLoc + * @param {Location} operatorLoc + * @param {Node} value */ - constructor(nodeID, location, flags, pattern, statements, inLoc, thenLoc) { + constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.pattern = pattern; - this.statements = statements; - this.inLoc = inLoc; - this.thenLoc = thenLoc; + this.name = name2; + this.nameLoc = nameLoc; + this.operatorLoc = operatorLoc; + this.value = value; } /** * Accept a visitor for this node. @@ -10116,7 +19570,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitInNode(this); + visitor.visitGlobalVariableAndWriteNode(this); } /** * Returns all child nodes of the current node. @@ -10124,7 +19578,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.pattern, this.statements]; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -10132,12 +19586,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - compact.push(this.pattern); - if (this.statements) { - compact.push(this.statements); - } - return compact; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -10146,17 +19595,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "InNode", + type: "GlobalVariableAndWriteNode", location: this.location, flags: this.#flags, - pattern: this.pattern, - statements: this.statements, - inLoc: this.inLoc, - thenLoc: this.thenLoc + name: this.name, + nameLoc: this.nameLoc, + operatorLoc: this.operatorLoc, + value: this.value }; } }; - var IndexAndWriteNode = class { + var GlobalVariableOperatorWriteNode = class { /** * @type number */ @@ -10170,96 +19619,46 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node | null - */ - receiver; - /** - * @type Location | null - */ - callOperatorLoc; - /** - * @type Location - */ - openingLoc; - /** - * @type ArgumentsNode | null + * @type string */ - arguments_; + name; /** * @type Location */ - closingLoc; - /** - * @type BlockArgumentNode | null - */ - block; + nameLoc; /** * @type Location */ - operatorLoc; + binaryOperatorLoc; /** * @type Node */ value; /** - * Construct a new IndexAndWriteNode. + * @type string + */ + binaryOperator; + /** + * Construct a new GlobalVariableOperatorWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node | null} receiver - * @param {Location | null} callOperatorLoc - * @param {Location} openingLoc - * @param {ArgumentsNode | null} arguments_ - * @param {Location} closingLoc - * @param {BlockArgumentNode | null} block - * @param {Location} operatorLoc + * @param {string} name + * @param {Location} nameLoc + * @param {Location} binaryOperatorLoc * @param {Node} value + * @param {string} binaryOperator */ - constructor(nodeID, location, flags, receiver, callOperatorLoc, openingLoc, arguments_, closingLoc, block2, operatorLoc, value) { + constructor(nodeID, location, flags, name2, nameLoc, binaryOperatorLoc, value, binaryOperator) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.receiver = receiver; - this.callOperatorLoc = callOperatorLoc; - this.openingLoc = openingLoc; - this.arguments_ = arguments_; - this.closingLoc = closingLoc; - this.block = block2; - this.operatorLoc = operatorLoc; + this.name = name2; + this.nameLoc = nameLoc; + this.binaryOperatorLoc = binaryOperatorLoc; this.value = value; - } - /** - * True if this node has the SAFE_NAVIGATION flag. - * - * @returns {boolean} - */ - isSafeNavigation() { - return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; - } - /** - * True if this node has the VARIABLE_CALL flag. - * - * @returns {boolean} - */ - isVariableCall() { - return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; - } - /** - * True if this node has the ATTRIBUTE_WRITE flag. - * - * @returns {boolean} - */ - isAttributeWrite() { - return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; - } - /** - * True if this node has the IGNORE_VISIBILITY flag. - * - * @returns {boolean} - */ - isIgnoreVisibility() { - return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; + this.binaryOperator = binaryOperator; } /** * Accept a visitor for this node. @@ -10267,7 +19666,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitIndexAndWriteNode(this); + visitor.visitGlobalVariableOperatorWriteNode(this); } /** * Returns all child nodes of the current node. @@ -10275,7 +19674,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.receiver, this.arguments_, this.block, this.value]; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -10283,18 +19682,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.receiver) { - compact.push(this.receiver); - } - if (this.arguments_) { - compact.push(this.arguments_); - } - if (this.block) { - compact.push(this.block); - } - compact.push(this.value); - return compact; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -10303,21 +19691,18 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "IndexAndWriteNode", + type: "GlobalVariableOperatorWriteNode", location: this.location, flags: this.#flags, - receiver: this.receiver, - callOperatorLoc: this.callOperatorLoc, - openingLoc: this.openingLoc, - arguments: this.arguments_, - closingLoc: this.closingLoc, - block: this.block, - operatorLoc: this.operatorLoc, - value: this.value + name: this.name, + nameLoc: this.nameLoc, + binaryOperatorLoc: this.binaryOperatorLoc, + value: this.value, + binaryOperator: this.binaryOperator }; } }; - var IndexOperatorWriteNode = class { + var GlobalVariableOrWriteNode = class { /** * @type number */ @@ -10331,110 +19716,48 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node | null - */ - receiver; - /** - * @type Location | null + * @type string */ - callOperatorLoc; + name; /** * @type Location */ - openingLoc; - /** - * @type ArgumentsNode | null - */ - arguments_; + nameLoc; /** * @type Location */ - closingLoc; + operatorLoc; /** - * @type BlockArgumentNode | null + * @type Node */ - block; + value; /** - * @type string - */ - binaryOperator; - /** - * @type Location - */ - binaryOperatorLoc; - /** - * @type Node - */ - value; - /** - * Construct a new IndexOperatorWriteNode. + * Construct a new GlobalVariableOrWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node | null} receiver - * @param {Location | null} callOperatorLoc - * @param {Location} openingLoc - * @param {ArgumentsNode | null} arguments_ - * @param {Location} closingLoc - * @param {BlockArgumentNode | null} block - * @param {string} binaryOperator - * @param {Location} binaryOperatorLoc + * @param {string} name + * @param {Location} nameLoc + * @param {Location} operatorLoc * @param {Node} value */ - constructor(nodeID, location, flags, receiver, callOperatorLoc, openingLoc, arguments_, closingLoc, block2, binaryOperator, binaryOperatorLoc, value) { + constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.receiver = receiver; - this.callOperatorLoc = callOperatorLoc; - this.openingLoc = openingLoc; - this.arguments_ = arguments_; - this.closingLoc = closingLoc; - this.block = block2; - this.binaryOperator = binaryOperator; - this.binaryOperatorLoc = binaryOperatorLoc; + this.name = name2; + this.nameLoc = nameLoc; + this.operatorLoc = operatorLoc; this.value = value; } - /** - * True if this node has the SAFE_NAVIGATION flag. - * - * @returns {boolean} - */ - isSafeNavigation() { - return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; - } - /** - * True if this node has the VARIABLE_CALL flag. - * - * @returns {boolean} - */ - isVariableCall() { - return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; - } - /** - * True if this node has the ATTRIBUTE_WRITE flag. - * - * @returns {boolean} - */ - isAttributeWrite() { - return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; - } - /** - * True if this node has the IGNORE_VISIBILITY flag. - * - * @returns {boolean} - */ - isIgnoreVisibility() { - return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; - } /** * Accept a visitor for this node. * * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitIndexOperatorWriteNode(this); + visitor.visitGlobalVariableOrWriteNode(this); } /** * Returns all child nodes of the current node. @@ -10442,7 +19765,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.receiver, this.arguments_, this.block, this.value]; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -10450,18 +19773,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.receiver) { - compact.push(this.receiver); - } - if (this.arguments_) { - compact.push(this.arguments_); - } - if (this.block) { - compact.push(this.block); - } - compact.push(this.value); - return compact; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -10470,22 +19782,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "IndexOperatorWriteNode", + type: "GlobalVariableOrWriteNode", location: this.location, flags: this.#flags, - receiver: this.receiver, - callOperatorLoc: this.callOperatorLoc, - openingLoc: this.openingLoc, - arguments: this.arguments_, - closingLoc: this.closingLoc, - block: this.block, - binaryOperator: this.binaryOperator, - binaryOperatorLoc: this.binaryOperatorLoc, + name: this.name, + nameLoc: this.nameLoc, + operatorLoc: this.operatorLoc, value: this.value }; } }; - var IndexOrWriteNode = class { + var GlobalVariableReadNode = class { /** * @type number */ @@ -10499,96 +19806,22 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node | null - */ - receiver; - /** - * @type Location | null - */ - callOperatorLoc; - /** - * @type Location - */ - openingLoc; - /** - * @type ArgumentsNode | null - */ - arguments_; - /** - * @type Location - */ - closingLoc; - /** - * @type BlockArgumentNode | null - */ - block; - /** - * @type Location - */ - operatorLoc; - /** - * @type Node + * @type string */ - value; + name; /** - * Construct a new IndexOrWriteNode. + * Construct a new GlobalVariableReadNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node | null} receiver - * @param {Location | null} callOperatorLoc - * @param {Location} openingLoc - * @param {ArgumentsNode | null} arguments_ - * @param {Location} closingLoc - * @param {BlockArgumentNode | null} block - * @param {Location} operatorLoc - * @param {Node} value + * @param {string} name */ - constructor(nodeID, location, flags, receiver, callOperatorLoc, openingLoc, arguments_, closingLoc, block2, operatorLoc, value) { + constructor(nodeID, location, flags, name2) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.receiver = receiver; - this.callOperatorLoc = callOperatorLoc; - this.openingLoc = openingLoc; - this.arguments_ = arguments_; - this.closingLoc = closingLoc; - this.block = block2; - this.operatorLoc = operatorLoc; - this.value = value; - } - /** - * True if this node has the SAFE_NAVIGATION flag. - * - * @returns {boolean} - */ - isSafeNavigation() { - return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; - } - /** - * True if this node has the VARIABLE_CALL flag. - * - * @returns {boolean} - */ - isVariableCall() { - return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; - } - /** - * True if this node has the ATTRIBUTE_WRITE flag. - * - * @returns {boolean} - */ - isAttributeWrite() { - return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; - } - /** - * True if this node has the IGNORE_VISIBILITY flag. - * - * @returns {boolean} - */ - isIgnoreVisibility() { - return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; + this.name = name2; } /** * Accept a visitor for this node. @@ -10596,7 +19829,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitIndexOrWriteNode(this); + visitor.visitGlobalVariableReadNode(this); } /** * Returns all child nodes of the current node. @@ -10604,7 +19837,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.receiver, this.arguments_, this.block, this.value]; + return []; } /** * Compact and return an array of child nodes. @@ -10612,18 +19845,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.receiver) { - compact.push(this.receiver); - } - if (this.arguments_) { - compact.push(this.arguments_); - } - if (this.block) { - compact.push(this.block); - } - compact.push(this.value); - return compact; + return []; } /** * Transforms the Node to a JavaScript object. @@ -10632,21 +19854,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "IndexOrWriteNode", + type: "GlobalVariableReadNode", location: this.location, flags: this.#flags, - receiver: this.receiver, - callOperatorLoc: this.callOperatorLoc, - openingLoc: this.openingLoc, - arguments: this.arguments_, - closingLoc: this.closingLoc, - block: this.block, - operatorLoc: this.operatorLoc, - value: this.value + name: this.name }; } }; - var IndexTargetNode = class { + var GlobalVariableTargetNode = class { /** * @type number */ @@ -10660,78 +19875,22 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node - */ - receiver; - /** - * @type Location - */ - openingLoc; - /** - * @type ArgumentsNode | null - */ - arguments_; - /** - * @type Location - */ - closingLoc; - /** - * @type BlockArgumentNode | null + * @type string */ - block; + name; /** - * Construct a new IndexTargetNode. + * Construct a new GlobalVariableTargetNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node} receiver - * @param {Location} openingLoc - * @param {ArgumentsNode | null} arguments_ - * @param {Location} closingLoc - * @param {BlockArgumentNode | null} block + * @param {string} name */ - constructor(nodeID, location, flags, receiver, openingLoc, arguments_, closingLoc, block2) { + constructor(nodeID, location, flags, name2) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.receiver = receiver; - this.openingLoc = openingLoc; - this.arguments_ = arguments_; - this.closingLoc = closingLoc; - this.block = block2; - } - /** - * True if this node has the SAFE_NAVIGATION flag. - * - * @returns {boolean} - */ - isSafeNavigation() { - return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; - } - /** - * True if this node has the VARIABLE_CALL flag. - * - * @returns {boolean} - */ - isVariableCall() { - return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; - } - /** - * True if this node has the ATTRIBUTE_WRITE flag. - * - * @returns {boolean} - */ - isAttributeWrite() { - return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; - } - /** - * True if this node has the IGNORE_VISIBILITY flag. - * - * @returns {boolean} - */ - isIgnoreVisibility() { - return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; + this.name = name2; } /** * Accept a visitor for this node. @@ -10739,7 +19898,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitIndexTargetNode(this); + visitor.visitGlobalVariableTargetNode(this); } /** * Returns all child nodes of the current node. @@ -10747,7 +19906,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.receiver, this.arguments_, this.block]; + return []; } /** * Compact and return an array of child nodes. @@ -10755,15 +19914,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - compact.push(this.receiver); - if (this.arguments_) { - compact.push(this.arguments_); - } - if (this.block) { - compact.push(this.block); - } - return compact; + return []; } /** * Transforms the Node to a JavaScript object. @@ -10772,18 +19923,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "IndexTargetNode", + type: "GlobalVariableTargetNode", location: this.location, flags: this.#flags, - receiver: this.receiver, - openingLoc: this.openingLoc, - arguments: this.arguments_, - closingLoc: this.closingLoc, - block: this.block + name: this.name }; } }; - var InstanceVariableAndWriteNode = class { + var GlobalVariableWriteNode = class { /** * @type number */ @@ -10804,33 +19951,33 @@ var HerbLinter = (() => { * @type Location */ nameLoc; - /** - * @type Location - */ - operatorLoc; /** * @type Node */ value; /** - * Construct a new InstanceVariableAndWriteNode. + * @type Location + */ + operatorLoc; + /** + * Construct a new GlobalVariableWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags * @param {string} name * @param {Location} nameLoc - * @param {Location} operatorLoc * @param {Node} value + * @param {Location} operatorLoc */ - constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { + constructor(nodeID, location, flags, name2, nameLoc, value, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; this.name = name2; this.nameLoc = nameLoc; - this.operatorLoc = operatorLoc; this.value = value; + this.operatorLoc = operatorLoc; } /** * Accept a visitor for this node. @@ -10838,7 +19985,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitInstanceVariableAndWriteNode(this); + visitor.visitGlobalVariableWriteNode(this); } /** * Returns all child nodes of the current node. @@ -10863,17 +20010,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "InstanceVariableAndWriteNode", + type: "GlobalVariableWriteNode", location: this.location, flags: this.#flags, name: this.name, nameLoc: this.nameLoc, - operatorLoc: this.operatorLoc, - value: this.value + value: this.value, + operatorLoc: this.operatorLoc }; } }; - var InstanceVariableOperatorWriteNode = class { + var HashNode = class { /** * @type number */ @@ -10886,47 +20033,35 @@ var HerbLinter = (() => { * @type number */ #flags; - /** - * @type string - */ - name; - /** - * @type Location - */ - nameLoc; /** * @type Location */ - binaryOperatorLoc; + openingLoc; /** - * @type Node + * @type Node[] */ - value; + elements; /** - * @type string + * @type Location */ - binaryOperator; + closingLoc; /** - * Construct a new InstanceVariableOperatorWriteNode. + * Construct a new HashNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name - * @param {Location} nameLoc - * @param {Location} binaryOperatorLoc - * @param {Node} value - * @param {string} binaryOperator + * @param {Location} openingLoc + * @param {Node[]} elements + * @param {Location} closingLoc */ - constructor(nodeID, location, flags, name2, nameLoc, binaryOperatorLoc, value, binaryOperator) { + constructor(nodeID, location, flags, openingLoc, elements2, closingLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; - this.nameLoc = nameLoc; - this.binaryOperatorLoc = binaryOperatorLoc; - this.value = value; - this.binaryOperator = binaryOperator; + this.openingLoc = openingLoc; + this.elements = elements2; + this.closingLoc = closingLoc; } /** * Accept a visitor for this node. @@ -10934,7 +20069,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitInstanceVariableOperatorWriteNode(this); + visitor.visitHashNode(this); } /** * Returns all child nodes of the current node. @@ -10942,7 +20077,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return [...this.elements]; } /** * Compact and return an array of child nodes. @@ -10950,7 +20085,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + return [...this.elements]; } /** * Transforms the Node to a JavaScript object. @@ -10959,18 +20094,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "InstanceVariableOperatorWriteNode", + type: "HashNode", location: this.location, flags: this.#flags, - name: this.name, - nameLoc: this.nameLoc, - binaryOperatorLoc: this.binaryOperatorLoc, - value: this.value, - binaryOperator: this.binaryOperator + openingLoc: this.openingLoc, + elements: this.elements, + closingLoc: this.closingLoc }; } }; - var InstanceVariableOrWriteNode = class { + var HashPatternNode = class { /** * @type number */ @@ -10984,40 +20117,46 @@ var HerbLinter = (() => { */ #flags; /** - * @type string + * @type Node | null */ - name; + constant; /** - * @type Location + * @type Node[] */ - nameLoc; + elements; /** - * @type Location + * @type Node | null */ - operatorLoc; + rest; /** - * @type Node + * @type Location | null */ - value; + openingLoc; /** - * Construct a new InstanceVariableOrWriteNode. + * @type Location | null + */ + closingLoc; + /** + * Construct a new HashPatternNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name - * @param {Location} nameLoc - * @param {Location} operatorLoc - * @param {Node} value + * @param {Node | null} constant + * @param {Node[]} elements + * @param {Node | null} rest + * @param {Location | null} openingLoc + * @param {Location | null} closingLoc */ - constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { + constructor(nodeID, location, flags, constant, elements2, rest, openingLoc, closingLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; - this.nameLoc = nameLoc; - this.operatorLoc = operatorLoc; - this.value = value; + this.constant = constant; + this.elements = elements2; + this.rest = rest; + this.openingLoc = openingLoc; + this.closingLoc = closingLoc; } /** * Accept a visitor for this node. @@ -11025,7 +20164,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitInstanceVariableOrWriteNode(this); + visitor.visitHashPatternNode(this); } /** * Returns all child nodes of the current node. @@ -11033,7 +20172,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return [this.constant, ...this.elements, this.rest]; } /** * Compact and return an array of child nodes. @@ -11041,7 +20180,15 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + const compact = []; + if (this.constant) { + compact.push(this.constant); + } + compact.concat(this.elements); + if (this.rest) { + compact.push(this.rest); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -11050,17 +20197,18 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "InstanceVariableOrWriteNode", + type: "HashPatternNode", location: this.location, flags: this.#flags, - name: this.name, - nameLoc: this.nameLoc, - operatorLoc: this.operatorLoc, - value: this.value + constant: this.constant, + elements: this.elements, + rest: this.rest, + openingLoc: this.openingLoc, + closingLoc: this.closingLoc }; } }; - var InstanceVariableReadNode = class { + var IfNode = class { /** * @type number */ @@ -11074,22 +20222,52 @@ var HerbLinter = (() => { */ #flags; /** - * @type string + * @type Location | null */ - name; + ifKeywordLoc; /** - * Construct a new InstanceVariableReadNode. + * @type Node + */ + predicate; + /** + * @type Location | null + */ + thenKeywordLoc; + /** + * @type StatementsNode | null + */ + statements; + /** + * @type Node | null + */ + subsequent; + /** + * @type Location | null + */ + endKeywordLoc; + /** + * Construct a new IfNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name + * @param {Location | null} ifKeywordLoc + * @param {Node} predicate + * @param {Location | null} thenKeywordLoc + * @param {StatementsNode | null} statements + * @param {Node | null} subsequent + * @param {Location | null} endKeywordLoc */ - constructor(nodeID, location, flags, name2) { + constructor(nodeID, location, flags, ifKeywordLoc, predicate, thenKeywordLoc, statements, subsequent, endKeywordLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; + this.ifKeywordLoc = ifKeywordLoc; + this.predicate = predicate; + this.thenKeywordLoc = thenKeywordLoc; + this.statements = statements; + this.subsequent = subsequent; + this.endKeywordLoc = endKeywordLoc; } /** * Accept a visitor for this node. @@ -11097,7 +20275,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitInstanceVariableReadNode(this); + visitor.visitIfNode(this); } /** * Returns all child nodes of the current node. @@ -11105,7 +20283,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.predicate, this.statements, this.subsequent]; } /** * Compact and return an array of child nodes. @@ -11113,7 +20291,15 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + const compact = []; + compact.push(this.predicate); + if (this.statements) { + compact.push(this.statements); + } + if (this.subsequent) { + compact.push(this.subsequent); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -11122,14 +20308,19 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "InstanceVariableReadNode", + type: "IfNode", location: this.location, flags: this.#flags, - name: this.name - }; - } + ifKeywordLoc: this.ifKeywordLoc, + predicate: this.predicate, + thenKeywordLoc: this.thenKeywordLoc, + statements: this.statements, + subsequent: this.subsequent, + endKeywordLoc: this.endKeywordLoc + }; + } }; - var InstanceVariableTargetNode = class { + var ImaginaryNode = class { /** * @type number */ @@ -11143,22 +20334,22 @@ var HerbLinter = (() => { */ #flags; /** - * @type string + * @type Node */ - name; + numeric; /** - * Construct a new InstanceVariableTargetNode. + * Construct a new ImaginaryNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name + * @param {Node} numeric */ - constructor(nodeID, location, flags, name2) { + constructor(nodeID, location, flags, numeric) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; + this.numeric = numeric; } /** * Accept a visitor for this node. @@ -11166,7 +20357,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitInstanceVariableTargetNode(this); + visitor.visitImaginaryNode(this); } /** * Returns all child nodes of the current node. @@ -11174,7 +20365,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.numeric]; } /** * Compact and return an array of child nodes. @@ -11182,7 +20373,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + return [this.numeric]; } /** * Transforms the Node to a JavaScript object. @@ -11191,14 +20382,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "InstanceVariableTargetNode", + type: "ImaginaryNode", location: this.location, flags: this.#flags, - name: this.name + numeric: this.numeric }; } }; - var InstanceVariableWriteNode = class { + var ImplicitNode = class { /** * @type number */ @@ -11211,41 +20402,23 @@ var HerbLinter = (() => { * @type number */ #flags; - /** - * @type string - */ - name; - /** - * @type Location - */ - nameLoc; /** * @type Node */ value; /** - * @type Location - */ - operatorLoc; - /** - * Construct a new InstanceVariableWriteNode. + * Construct a new ImplicitNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name - * @param {Location} nameLoc * @param {Node} value - * @param {Location} operatorLoc */ - constructor(nodeID, location, flags, name2, nameLoc, value, operatorLoc) { + constructor(nodeID, location, flags, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; - this.nameLoc = nameLoc; this.value = value; - this.operatorLoc = operatorLoc; } /** * Accept a visitor for this node. @@ -11253,7 +20426,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitInstanceVariableWriteNode(this); + visitor.visitImplicitNode(this); } /** * Returns all child nodes of the current node. @@ -11278,17 +20451,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "InstanceVariableWriteNode", + type: "ImplicitNode", location: this.location, flags: this.#flags, - name: this.name, - nameLoc: this.nameLoc, - value: this.value, - operatorLoc: this.operatorLoc + value: this.value }; } }; - var IntegerNode = class { + var ImplicitRestNode = class { /** * @type number */ @@ -11302,54 +20472,16 @@ var HerbLinter = (() => { */ #flags; /** - * @type number - */ - value; - /** - * Construct a new IntegerNode. + * Construct a new ImplicitRestNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {number} value */ - constructor(nodeID, location, flags, value) { + constructor(nodeID, location, flags) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.value = value; - } - /** - * True if this node has the BINARY flag. - * - * @returns {boolean} - */ - isBinary() { - return (this.#flags & IntegerBaseFlags.BINARY) !== 0; - } - /** - * True if this node has the DECIMAL flag. - * - * @returns {boolean} - */ - isDecimal() { - return (this.#flags & IntegerBaseFlags.DECIMAL) !== 0; - } - /** - * True if this node has the OCTAL flag. - * - * @returns {boolean} - */ - isOctal() { - return (this.#flags & IntegerBaseFlags.OCTAL) !== 0; - } - /** - * True if this node has the HEXADECIMAL flag. - * - * @returns {boolean} - */ - isHexadecimal() { - return (this.#flags & IntegerBaseFlags.HEXADECIMAL) !== 0; } /** * Accept a visitor for this node. @@ -11357,7 +20489,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitIntegerNode(this); + visitor.visitImplicitRestNode(this); } /** * Returns all child nodes of the current node. @@ -11382,14 +20514,13 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "IntegerNode", + type: "ImplicitRestNode", location: this.location, - flags: this.#flags, - value: this.value + flags: this.#flags }; } }; - var InterpolatedMatchLastLineNode = class { + var InNode = class { /** * @type number */ @@ -11403,122 +20534,40 @@ var HerbLinter = (() => { */ #flags; /** - * @type Location + * @type Node */ - openingLoc; + pattern; /** - * @type Node[] + * @type StatementsNode | null */ - parts; + statements; /** * @type Location */ - closingLoc; + inLoc; /** - * Construct a new InterpolatedMatchLastLineNode. + * @type Location | null + */ + thenLoc; + /** + * Construct a new InNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} openingLoc - * @param {Node[]} parts - * @param {Location} closingLoc + * @param {Node} pattern + * @param {StatementsNode | null} statements + * @param {Location} inLoc + * @param {Location | null} thenLoc */ - constructor(nodeID, location, flags, openingLoc, parts, closingLoc) { + constructor(nodeID, location, flags, pattern, statements, inLoc, thenLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.openingLoc = openingLoc; - this.parts = parts; - this.closingLoc = closingLoc; - } - /** - * True if this node has the IGNORE_CASE flag. - * - * @returns {boolean} - */ - isIgnoreCase() { - return (this.#flags & RegularExpressionFlags.IGNORE_CASE) !== 0; - } - /** - * True if this node has the EXTENDED flag. - * - * @returns {boolean} - */ - isExtended() { - return (this.#flags & RegularExpressionFlags.EXTENDED) !== 0; - } - /** - * True if this node has the MULTI_LINE flag. - * - * @returns {boolean} - */ - isMultiLine() { - return (this.#flags & RegularExpressionFlags.MULTI_LINE) !== 0; - } - /** - * True if this node has the ONCE flag. - * - * @returns {boolean} - */ - isOnce() { - return (this.#flags & RegularExpressionFlags.ONCE) !== 0; - } - /** - * True if this node has the EUC_JP flag. - * - * @returns {boolean} - */ - isEucJp() { - return (this.#flags & RegularExpressionFlags.EUC_JP) !== 0; - } - /** - * True if this node has the ASCII_8BIT flag. - * - * @returns {boolean} - */ - isAscii8bit() { - return (this.#flags & RegularExpressionFlags.ASCII_8BIT) !== 0; - } - /** - * True if this node has the WINDOWS_31J flag. - * - * @returns {boolean} - */ - isWindows31j() { - return (this.#flags & RegularExpressionFlags.WINDOWS_31J) !== 0; - } - /** - * True if this node has the UTF_8 flag. - * - * @returns {boolean} - */ - isUtf8() { - return (this.#flags & RegularExpressionFlags.UTF_8) !== 0; - } - /** - * True if this node has the FORCED_UTF8_ENCODING flag. - * - * @returns {boolean} - */ - isForcedUtf8Encoding() { - return (this.#flags & RegularExpressionFlags.FORCED_UTF8_ENCODING) !== 0; - } - /** - * True if this node has the FORCED_BINARY_ENCODING flag. - * - * @returns {boolean} - */ - isForcedBinaryEncoding() { - return (this.#flags & RegularExpressionFlags.FORCED_BINARY_ENCODING) !== 0; - } - /** - * True if this node has the FORCED_US_ASCII_ENCODING flag. - * - * @returns {boolean} - */ - isForcedUsAsciiEncoding() { - return (this.#flags & RegularExpressionFlags.FORCED_US_ASCII_ENCODING) !== 0; + this.pattern = pattern; + this.statements = statements; + this.inLoc = inLoc; + this.thenLoc = thenLoc; } /** * Accept a visitor for this node. @@ -11526,7 +20575,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitInterpolatedMatchLastLineNode(this); + visitor.visitInNode(this); } /** * Returns all child nodes of the current node. @@ -11534,7 +20583,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [...this.parts]; + return [this.pattern, this.statements]; } /** * Compact and return an array of child nodes. @@ -11542,7 +20591,12 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [...this.parts]; + const compact = []; + compact.push(this.pattern); + if (this.statements) { + compact.push(this.statements); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -11551,16 +20605,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "InterpolatedMatchLastLineNode", + type: "InNode", location: this.location, flags: this.#flags, - openingLoc: this.openingLoc, - parts: this.parts, - closingLoc: this.closingLoc + pattern: this.pattern, + statements: this.statements, + inLoc: this.inLoc, + thenLoc: this.thenLoc }; } }; - var InterpolatedRegularExpressionNode = class { + var IndexAndWriteNode = class { /** * @type number */ @@ -11573,123 +20628,97 @@ var HerbLinter = (() => { * @type number */ #flags; + /** + * @type Node | null + */ + receiver; + /** + * @type Location | null + */ + callOperatorLoc; /** * @type Location */ openingLoc; /** - * @type Node[] + * @type ArgumentsNode | null */ - parts; + arguments_; /** * @type Location */ closingLoc; /** - * Construct a new InterpolatedRegularExpressionNode. + * @type BlockArgumentNode | null + */ + block; + /** + * @type Location + */ + operatorLoc; + /** + * @type Node + */ + value; + /** + * Construct a new IndexAndWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {Node | null} receiver + * @param {Location | null} callOperatorLoc * @param {Location} openingLoc - * @param {Node[]} parts + * @param {ArgumentsNode | null} arguments_ * @param {Location} closingLoc + * @param {BlockArgumentNode | null} block + * @param {Location} operatorLoc + * @param {Node} value */ - constructor(nodeID, location, flags, openingLoc, parts, closingLoc) { + constructor(nodeID, location, flags, receiver, callOperatorLoc, openingLoc, arguments_, closingLoc, block, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.receiver = receiver; + this.callOperatorLoc = callOperatorLoc; this.openingLoc = openingLoc; - this.parts = parts; + this.arguments_ = arguments_; this.closingLoc = closingLoc; + this.block = block; + this.operatorLoc = operatorLoc; + this.value = value; } /** - * True if this node has the IGNORE_CASE flag. - * - * @returns {boolean} - */ - isIgnoreCase() { - return (this.#flags & RegularExpressionFlags.IGNORE_CASE) !== 0; - } - /** - * True if this node has the EXTENDED flag. - * - * @returns {boolean} - */ - isExtended() { - return (this.#flags & RegularExpressionFlags.EXTENDED) !== 0; - } - /** - * True if this node has the MULTI_LINE flag. - * - * @returns {boolean} - */ - isMultiLine() { - return (this.#flags & RegularExpressionFlags.MULTI_LINE) !== 0; - } - /** - * True if this node has the ONCE flag. - * - * @returns {boolean} - */ - isOnce() { - return (this.#flags & RegularExpressionFlags.ONCE) !== 0; - } - /** - * True if this node has the EUC_JP flag. - * - * @returns {boolean} - */ - isEucJp() { - return (this.#flags & RegularExpressionFlags.EUC_JP) !== 0; - } - /** - * True if this node has the ASCII_8BIT flag. - * - * @returns {boolean} - */ - isAscii8bit() { - return (this.#flags & RegularExpressionFlags.ASCII_8BIT) !== 0; - } - /** - * True if this node has the WINDOWS_31J flag. - * - * @returns {boolean} - */ - isWindows31j() { - return (this.#flags & RegularExpressionFlags.WINDOWS_31J) !== 0; - } - /** - * True if this node has the UTF_8 flag. + * True if this node has the SAFE_NAVIGATION flag. * * @returns {boolean} */ - isUtf8() { - return (this.#flags & RegularExpressionFlags.UTF_8) !== 0; + isSafeNavigation() { + return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; } /** - * True if this node has the FORCED_UTF8_ENCODING flag. + * True if this node has the VARIABLE_CALL flag. * * @returns {boolean} */ - isForcedUtf8Encoding() { - return (this.#flags & RegularExpressionFlags.FORCED_UTF8_ENCODING) !== 0; + isVariableCall() { + return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; } /** - * True if this node has the FORCED_BINARY_ENCODING flag. + * True if this node has the ATTRIBUTE_WRITE flag. * * @returns {boolean} */ - isForcedBinaryEncoding() { - return (this.#flags & RegularExpressionFlags.FORCED_BINARY_ENCODING) !== 0; + isAttributeWrite() { + return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; } /** - * True if this node has the FORCED_US_ASCII_ENCODING flag. + * True if this node has the IGNORE_VISIBILITY flag. * * @returns {boolean} */ - isForcedUsAsciiEncoding() { - return (this.#flags & RegularExpressionFlags.FORCED_US_ASCII_ENCODING) !== 0; + isIgnoreVisibility() { + return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; } /** * Accept a visitor for this node. @@ -11697,7 +20726,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitInterpolatedRegularExpressionNode(this); + visitor.visitIndexAndWriteNode(this); } /** * Returns all child nodes of the current node. @@ -11705,7 +20734,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [...this.parts]; + return [this.receiver, this.arguments_, this.block, this.value]; } /** * Compact and return an array of child nodes. @@ -11713,7 +20742,18 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [...this.parts]; + const compact = []; + if (this.receiver) { + compact.push(this.receiver); + } + if (this.arguments_) { + compact.push(this.arguments_); + } + if (this.block) { + compact.push(this.block); + } + compact.push(this.value); + return compact; } /** * Transforms the Node to a JavaScript object. @@ -11722,16 +20762,21 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "InterpolatedRegularExpressionNode", + type: "IndexAndWriteNode", location: this.location, flags: this.#flags, + receiver: this.receiver, + callOperatorLoc: this.callOperatorLoc, openingLoc: this.openingLoc, - parts: this.parts, - closingLoc: this.closingLoc + arguments: this.arguments_, + closingLoc: this.closingLoc, + block: this.block, + operatorLoc: this.operatorLoc, + value: this.value }; } }; - var InterpolatedStringNode = class { + var IndexOperatorWriteNode = class { /** * @type number */ @@ -11744,51 +20789,103 @@ var HerbLinter = (() => { * @type number */ #flags; + /** + * @type Node | null + */ + receiver; /** * @type Location | null */ + callOperatorLoc; + /** + * @type Location + */ openingLoc; /** - * @type Node[] + * @type ArgumentsNode | null */ - parts; + arguments_; /** - * @type Location | null + * @type Location */ closingLoc; /** - * Construct a new InterpolatedStringNode. + * @type BlockArgumentNode | null + */ + block; + /** + * @type string + */ + binaryOperator; + /** + * @type Location + */ + binaryOperatorLoc; + /** + * @type Node + */ + value; + /** + * Construct a new IndexOperatorWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location | null} openingLoc - * @param {Node[]} parts - * @param {Location | null} closingLoc + * @param {Node | null} receiver + * @param {Location | null} callOperatorLoc + * @param {Location} openingLoc + * @param {ArgumentsNode | null} arguments_ + * @param {Location} closingLoc + * @param {BlockArgumentNode | null} block + * @param {string} binaryOperator + * @param {Location} binaryOperatorLoc + * @param {Node} value */ - constructor(nodeID, location, flags, openingLoc, parts, closingLoc) { + constructor(nodeID, location, flags, receiver, callOperatorLoc, openingLoc, arguments_, closingLoc, block, binaryOperator, binaryOperatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.receiver = receiver; + this.callOperatorLoc = callOperatorLoc; this.openingLoc = openingLoc; - this.parts = parts; + this.arguments_ = arguments_; this.closingLoc = closingLoc; + this.block = block; + this.binaryOperator = binaryOperator; + this.binaryOperatorLoc = binaryOperatorLoc; + this.value = value; } /** - * True if this node has the FROZEN flag. + * True if this node has the SAFE_NAVIGATION flag. * * @returns {boolean} */ - isFrozen() { - return (this.#flags & InterpolatedStringNodeFlags.FROZEN) !== 0; + isSafeNavigation() { + return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; } /** - * True if this node has the MUTABLE flag. + * True if this node has the VARIABLE_CALL flag. * * @returns {boolean} */ - isMutable() { - return (this.#flags & InterpolatedStringNodeFlags.MUTABLE) !== 0; + isVariableCall() { + return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; + } + /** + * True if this node has the ATTRIBUTE_WRITE flag. + * + * @returns {boolean} + */ + isAttributeWrite() { + return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; + } + /** + * True if this node has the IGNORE_VISIBILITY flag. + * + * @returns {boolean} + */ + isIgnoreVisibility() { + return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; } /** * Accept a visitor for this node. @@ -11796,7 +20893,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitInterpolatedStringNode(this); + visitor.visitIndexOperatorWriteNode(this); } /** * Returns all child nodes of the current node. @@ -11804,7 +20901,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [...this.parts]; + return [this.receiver, this.arguments_, this.block, this.value]; } /** * Compact and return an array of child nodes. @@ -11812,7 +20909,18 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [...this.parts]; + const compact = []; + if (this.receiver) { + compact.push(this.receiver); + } + if (this.arguments_) { + compact.push(this.arguments_); + } + if (this.block) { + compact.push(this.block); + } + compact.push(this.value); + return compact; } /** * Transforms the Node to a JavaScript object. @@ -11821,16 +20929,22 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "InterpolatedStringNode", + type: "IndexOperatorWriteNode", location: this.location, flags: this.#flags, + receiver: this.receiver, + callOperatorLoc: this.callOperatorLoc, openingLoc: this.openingLoc, - parts: this.parts, - closingLoc: this.closingLoc + arguments: this.arguments_, + closingLoc: this.closingLoc, + block: this.block, + binaryOperator: this.binaryOperator, + binaryOperatorLoc: this.binaryOperatorLoc, + value: this.value }; } }; - var InterpolatedSymbolNode = class { + var IndexOrWriteNode = class { /** * @type number */ @@ -11843,35 +20957,97 @@ var HerbLinter = (() => { * @type number */ #flags; + /** + * @type Node | null + */ + receiver; /** * @type Location | null */ + callOperatorLoc; + /** + * @type Location + */ openingLoc; /** - * @type Node[] + * @type ArgumentsNode | null */ - parts; + arguments_; /** - * @type Location | null + * @type Location */ closingLoc; /** - * Construct a new InterpolatedSymbolNode. + * @type BlockArgumentNode | null + */ + block; + /** + * @type Location + */ + operatorLoc; + /** + * @type Node + */ + value; + /** + * Construct a new IndexOrWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location | null} openingLoc - * @param {Node[]} parts - * @param {Location | null} closingLoc + * @param {Node | null} receiver + * @param {Location | null} callOperatorLoc + * @param {Location} openingLoc + * @param {ArgumentsNode | null} arguments_ + * @param {Location} closingLoc + * @param {BlockArgumentNode | null} block + * @param {Location} operatorLoc + * @param {Node} value */ - constructor(nodeID, location, flags, openingLoc, parts, closingLoc) { + constructor(nodeID, location, flags, receiver, callOperatorLoc, openingLoc, arguments_, closingLoc, block, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.receiver = receiver; + this.callOperatorLoc = callOperatorLoc; this.openingLoc = openingLoc; - this.parts = parts; + this.arguments_ = arguments_; this.closingLoc = closingLoc; + this.block = block; + this.operatorLoc = operatorLoc; + this.value = value; + } + /** + * True if this node has the SAFE_NAVIGATION flag. + * + * @returns {boolean} + */ + isSafeNavigation() { + return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; + } + /** + * True if this node has the VARIABLE_CALL flag. + * + * @returns {boolean} + */ + isVariableCall() { + return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; + } + /** + * True if this node has the ATTRIBUTE_WRITE flag. + * + * @returns {boolean} + */ + isAttributeWrite() { + return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; + } + /** + * True if this node has the IGNORE_VISIBILITY flag. + * + * @returns {boolean} + */ + isIgnoreVisibility() { + return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; } /** * Accept a visitor for this node. @@ -11879,7 +21055,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitInterpolatedSymbolNode(this); + visitor.visitIndexOrWriteNode(this); } /** * Returns all child nodes of the current node. @@ -11887,7 +21063,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [...this.parts]; + return [this.receiver, this.arguments_, this.block, this.value]; } /** * Compact and return an array of child nodes. @@ -11895,7 +21071,18 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [...this.parts]; + const compact = []; + if (this.receiver) { + compact.push(this.receiver); + } + if (this.arguments_) { + compact.push(this.arguments_); + } + if (this.block) { + compact.push(this.block); + } + compact.push(this.value); + return compact; } /** * Transforms the Node to a JavaScript object. @@ -11904,16 +21091,21 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "InterpolatedSymbolNode", + type: "IndexOrWriteNode", location: this.location, flags: this.#flags, + receiver: this.receiver, + callOperatorLoc: this.callOperatorLoc, openingLoc: this.openingLoc, - parts: this.parts, - closingLoc: this.closingLoc + arguments: this.arguments_, + closingLoc: this.closingLoc, + block: this.block, + operatorLoc: this.operatorLoc, + value: this.value }; } }; - var InterpolatedXStringNode = class { + var IndexTargetNode = class { /** * @type number */ @@ -11926,35 +21118,79 @@ var HerbLinter = (() => { * @type number */ #flags; + /** + * @type Node + */ + receiver; /** * @type Location */ openingLoc; /** - * @type Node[] + * @type ArgumentsNode | null */ - parts; + arguments_; /** * @type Location */ closingLoc; /** - * Construct a new InterpolatedXStringNode. + * @type BlockArgumentNode | null + */ + block; + /** + * Construct a new IndexTargetNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {Node} receiver * @param {Location} openingLoc - * @param {Node[]} parts + * @param {ArgumentsNode | null} arguments_ * @param {Location} closingLoc + * @param {BlockArgumentNode | null} block */ - constructor(nodeID, location, flags, openingLoc, parts, closingLoc) { + constructor(nodeID, location, flags, receiver, openingLoc, arguments_, closingLoc, block) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.receiver = receiver; this.openingLoc = openingLoc; - this.parts = parts; + this.arguments_ = arguments_; this.closingLoc = closingLoc; + this.block = block; + } + /** + * True if this node has the SAFE_NAVIGATION flag. + * + * @returns {boolean} + */ + isSafeNavigation() { + return (this.#flags & CallNodeFlags.SAFE_NAVIGATION) !== 0; + } + /** + * True if this node has the VARIABLE_CALL flag. + * + * @returns {boolean} + */ + isVariableCall() { + return (this.#flags & CallNodeFlags.VARIABLE_CALL) !== 0; + } + /** + * True if this node has the ATTRIBUTE_WRITE flag. + * + * @returns {boolean} + */ + isAttributeWrite() { + return (this.#flags & CallNodeFlags.ATTRIBUTE_WRITE) !== 0; + } + /** + * True if this node has the IGNORE_VISIBILITY flag. + * + * @returns {boolean} + */ + isIgnoreVisibility() { + return (this.#flags & CallNodeFlags.IGNORE_VISIBILITY) !== 0; } /** * Accept a visitor for this node. @@ -11962,7 +21198,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitInterpolatedXStringNode(this); + visitor.visitIndexTargetNode(this); } /** * Returns all child nodes of the current node. @@ -11970,7 +21206,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [...this.parts]; + return [this.receiver, this.arguments_, this.block]; } /** * Compact and return an array of child nodes. @@ -11978,7 +21214,15 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [...this.parts]; + const compact = []; + compact.push(this.receiver); + if (this.arguments_) { + compact.push(this.arguments_); + } + if (this.block) { + compact.push(this.block); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -11987,16 +21231,18 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "InterpolatedXStringNode", + type: "IndexTargetNode", location: this.location, flags: this.#flags, + receiver: this.receiver, openingLoc: this.openingLoc, - parts: this.parts, - closingLoc: this.closingLoc + arguments: this.arguments_, + closingLoc: this.closingLoc, + block: this.block }; } }; - var ItLocalVariableReadNode = class { + var InstanceVariableAndWriteNode = class { /** * @type number */ @@ -12010,16 +21256,40 @@ var HerbLinter = (() => { */ #flags; /** - * Construct a new ItLocalVariableReadNode. + * @type string + */ + name; + /** + * @type Location + */ + nameLoc; + /** + * @type Location + */ + operatorLoc; + /** + * @type Node + */ + value; + /** + * Construct a new InstanceVariableAndWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {string} name + * @param {Location} nameLoc + * @param {Location} operatorLoc + * @param {Node} value */ - constructor(nodeID, location, flags) { + constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.name = name2; + this.nameLoc = nameLoc; + this.operatorLoc = operatorLoc; + this.value = value; } /** * Accept a visitor for this node. @@ -12027,7 +21297,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitItLocalVariableReadNode(this); + visitor.visitInstanceVariableAndWriteNode(this); } /** * Returns all child nodes of the current node. @@ -12035,7 +21305,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -12043,7 +21313,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -12052,13 +21322,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ItLocalVariableReadNode", + type: "InstanceVariableAndWriteNode", location: this.location, - flags: this.#flags + flags: this.#flags, + name: this.name, + nameLoc: this.nameLoc, + operatorLoc: this.operatorLoc, + value: this.value }; } }; - var ItParametersNode = class { + var InstanceVariableOperatorWriteNode = class { /** * @type number */ @@ -12072,16 +21346,46 @@ var HerbLinter = (() => { */ #flags; /** - * Construct a new ItParametersNode. + * @type string + */ + name; + /** + * @type Location + */ + nameLoc; + /** + * @type Location + */ + binaryOperatorLoc; + /** + * @type Node + */ + value; + /** + * @type string + */ + binaryOperator; + /** + * Construct a new InstanceVariableOperatorWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {string} name + * @param {Location} nameLoc + * @param {Location} binaryOperatorLoc + * @param {Node} value + * @param {string} binaryOperator */ - constructor(nodeID, location, flags) { + constructor(nodeID, location, flags, name2, nameLoc, binaryOperatorLoc, value, binaryOperator) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.name = name2; + this.nameLoc = nameLoc; + this.binaryOperatorLoc = binaryOperatorLoc; + this.value = value; + this.binaryOperator = binaryOperator; } /** * Accept a visitor for this node. @@ -12089,7 +21393,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitItParametersNode(this); + visitor.visitInstanceVariableOperatorWriteNode(this); } /** * Returns all child nodes of the current node. @@ -12097,7 +21401,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -12105,7 +21409,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -12114,13 +21418,18 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ItParametersNode", + type: "InstanceVariableOperatorWriteNode", location: this.location, - flags: this.#flags + flags: this.#flags, + name: this.name, + nameLoc: this.nameLoc, + binaryOperatorLoc: this.binaryOperatorLoc, + value: this.value, + binaryOperator: this.binaryOperator }; } }; - var KeywordHashNode = class { + var InstanceVariableOrWriteNode = class { /** * @type number */ @@ -12134,30 +21443,40 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node[] + * @type string */ - elements; + name; /** - * Construct a new KeywordHashNode. + * @type Location + */ + nameLoc; + /** + * @type Location + */ + operatorLoc; + /** + * @type Node + */ + value; + /** + * Construct a new InstanceVariableOrWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node[]} elements + * @param {string} name + * @param {Location} nameLoc + * @param {Location} operatorLoc + * @param {Node} value */ - constructor(nodeID, location, flags, elements) { + constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.elements = elements; - } - /** - * True if this node has the SYMBOL_KEYS flag. - * - * @returns {boolean} - */ - isSymbolKeys() { - return (this.#flags & KeywordHashNodeFlags.SYMBOL_KEYS) !== 0; + this.name = name2; + this.nameLoc = nameLoc; + this.operatorLoc = operatorLoc; + this.value = value; } /** * Accept a visitor for this node. @@ -12165,7 +21484,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitKeywordHashNode(this); + visitor.visitInstanceVariableOrWriteNode(this); } /** * Returns all child nodes of the current node. @@ -12173,7 +21492,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [...this.elements]; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -12181,7 +21500,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [...this.elements]; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -12190,14 +21509,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "KeywordHashNode", + type: "InstanceVariableOrWriteNode", location: this.location, flags: this.#flags, - elements: this.elements + name: this.name, + nameLoc: this.nameLoc, + operatorLoc: this.operatorLoc, + value: this.value }; } }; - var KeywordRestParameterNode = class { + var InstanceVariableReadNode = class { /** * @type number */ @@ -12211,42 +21533,22 @@ var HerbLinter = (() => { */ #flags; /** - * @type string | null + * @type string */ name; /** - * @type Location | null - */ - nameLoc; - /** - * @type Location - */ - operatorLoc; - /** - * Construct a new KeywordRestParameterNode. + * Construct a new InstanceVariableReadNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string | null} name - * @param {Location | null} nameLoc - * @param {Location} operatorLoc + * @param {string} name */ - constructor(nodeID, location, flags, name2, nameLoc, operatorLoc) { + constructor(nodeID, location, flags, name2) { this.nodeID = nodeID; this.location = location; this.#flags = flags; this.name = name2; - this.nameLoc = nameLoc; - this.operatorLoc = operatorLoc; - } - /** - * True if this node has the REPEATED_PARAMETER flag. - * - * @returns {boolean} - */ - isRepeatedParameter() { - return (this.#flags & ParameterFlags.REPEATED_PARAMETER) !== 0; } /** * Accept a visitor for this node. @@ -12254,7 +21556,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitKeywordRestParameterNode(this); + visitor.visitInstanceVariableReadNode(this); } /** * Returns all child nodes of the current node. @@ -12279,16 +21581,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "KeywordRestParameterNode", + type: "InstanceVariableReadNode", location: this.location, flags: this.#flags, - name: this.name, - nameLoc: this.nameLoc, - operatorLoc: this.operatorLoc + name: this.name }; } }; - var LambdaNode = class { + var InstanceVariableTargetNode = class { /** * @type number */ @@ -12302,52 +21602,22 @@ var HerbLinter = (() => { */ #flags; /** - * @type string[] - */ - locals; - /** - * @type Location - */ - operatorLoc; - /** - * @type Location - */ - openingLoc; - /** - * @type Location - */ - closingLoc; - /** - * @type Node | null - */ - parameters; - /** - * @type Node | null + * @type string */ - body; + name; /** - * Construct a new LambdaNode. + * Construct a new InstanceVariableTargetNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string[]} locals - * @param {Location} operatorLoc - * @param {Location} openingLoc - * @param {Location} closingLoc - * @param {Node | null} parameters - * @param {Node | null} body + * @param {string} name */ - constructor(nodeID, location, flags, locals, operatorLoc, openingLoc, closingLoc, parameters, body) { + constructor(nodeID, location, flags, name2) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.locals = locals; - this.operatorLoc = operatorLoc; - this.openingLoc = openingLoc; - this.closingLoc = closingLoc; - this.parameters = parameters; - this.body = body; + this.name = name2; } /** * Accept a visitor for this node. @@ -12355,7 +21625,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitLambdaNode(this); + visitor.visitInstanceVariableTargetNode(this); } /** * Returns all child nodes of the current node. @@ -12363,7 +21633,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.parameters, this.body]; + return []; } /** * Compact and return an array of child nodes. @@ -12371,14 +21641,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.parameters) { - compact.push(this.parameters); - } - if (this.body) { - compact.push(this.body); - } - return compact; + return []; } /** * Transforms the Node to a JavaScript object. @@ -12387,19 +21650,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "LambdaNode", + type: "InstanceVariableTargetNode", location: this.location, flags: this.#flags, - locals: this.locals, - operatorLoc: this.operatorLoc, - openingLoc: this.openingLoc, - closingLoc: this.closingLoc, - parameters: this.parameters, - body: this.body + name: this.name }; } }; - var LocalVariableAndWriteNode = class { + var InstanceVariableWriteNode = class { /** * @type number */ @@ -12413,46 +21671,40 @@ var HerbLinter = (() => { */ #flags; /** - * @type Location + * @type string */ - nameLoc; + name; /** * @type Location */ - operatorLoc; + nameLoc; /** * @type Node */ value; /** - * @type string - */ - name; - /** - * @type number + * @type Location */ - depth; + operatorLoc; /** - * Construct a new LocalVariableAndWriteNode. + * Construct a new InstanceVariableWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {string} name * @param {Location} nameLoc - * @param {Location} operatorLoc * @param {Node} value - * @param {string} name - * @param {number} depth + * @param {Location} operatorLoc */ - constructor(nodeID, location, flags, nameLoc, operatorLoc, value, name2, depth) { + constructor(nodeID, location, flags, name2, nameLoc, value, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.name = name2; this.nameLoc = nameLoc; - this.operatorLoc = operatorLoc; this.value = value; - this.name = name2; - this.depth = depth; + this.operatorLoc = operatorLoc; } /** * Accept a visitor for this node. @@ -12460,7 +21712,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitLocalVariableAndWriteNode(this); + visitor.visitInstanceVariableWriteNode(this); } /** * Returns all child nodes of the current node. @@ -12485,18 +21737,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "LocalVariableAndWriteNode", + type: "InstanceVariableWriteNode", location: this.location, flags: this.#flags, + name: this.name, nameLoc: this.nameLoc, - operatorLoc: this.operatorLoc, value: this.value, - name: this.name, - depth: this.depth + operatorLoc: this.operatorLoc }; } }; - var LocalVariableOperatorWriteNode = class { + var IntegerNode = class { /** * @type number */ @@ -12509,151 +21760,55 @@ var HerbLinter = (() => { * @type number */ #flags; - /** - * @type Location - */ - nameLoc; - /** - * @type Location - */ - binaryOperatorLoc; - /** - * @type Node - */ - value; - /** - * @type string - */ - name; - /** - * @type string - */ - binaryOperator; /** * @type number */ - depth; + value; /** - * Construct a new LocalVariableOperatorWriteNode. + * Construct a new IntegerNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} nameLoc - * @param {Location} binaryOperatorLoc - * @param {Node} value - * @param {string} name - * @param {string} binaryOperator - * @param {number} depth + * @param {number} value */ - constructor(nodeID, location, flags, nameLoc, binaryOperatorLoc, value, name2, binaryOperator, depth) { + constructor(nodeID, location, flags, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.nameLoc = nameLoc; - this.binaryOperatorLoc = binaryOperatorLoc; this.value = value; - this.name = name2; - this.binaryOperator = binaryOperator; - this.depth = depth; - } - /** - * Accept a visitor for this node. - * - * @param {visitors.Visitor} visitor - */ - accept(visitor) { - visitor.visitLocalVariableOperatorWriteNode(this); } /** - * Returns all child nodes of the current node. + * True if this node has the BINARY flag. * - * @returns {(Node | null)[]} An array of child nodes. + * @returns {boolean} */ - childNodes() { - return [this.value]; + isBinary() { + return (this.#flags & IntegerBaseFlags.BINARY) !== 0; } /** - * Compact and return an array of child nodes. + * True if this node has the DECIMAL flag. * - * @returns {Node[]} An array of compacted child nodes. + * @returns {boolean} */ - compactChildNodes() { - return [this.value]; + isDecimal() { + return (this.#flags & IntegerBaseFlags.DECIMAL) !== 0; } /** - * Transforms the Node to a JavaScript object. + * True if this node has the OCTAL flag. * - * @returns {Object} + * @returns {boolean} */ - toJSON() { - return { - type: "LocalVariableOperatorWriteNode", - location: this.location, - flags: this.#flags, - nameLoc: this.nameLoc, - binaryOperatorLoc: this.binaryOperatorLoc, - value: this.value, - name: this.name, - binaryOperator: this.binaryOperator, - depth: this.depth - }; + isOctal() { + return (this.#flags & IntegerBaseFlags.OCTAL) !== 0; } - }; - var LocalVariableOrWriteNode = class { - /** - * @type number - */ - nodeID; - /** - * @type {Location} - */ - location; - /** - * @type number - */ - #flags; - /** - * @type Location - */ - nameLoc; - /** - * @type Location - */ - operatorLoc; - /** - * @type Node - */ - value; - /** - * @type string - */ - name; - /** - * @type number - */ - depth; /** - * Construct a new LocalVariableOrWriteNode. + * True if this node has the HEXADECIMAL flag. * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {Location} nameLoc - * @param {Location} operatorLoc - * @param {Node} value - * @param {string} name - * @param {number} depth + * @returns {boolean} */ - constructor(nodeID, location, flags, nameLoc, operatorLoc, value, name2, depth) { - this.nodeID = nodeID; - this.location = location; - this.#flags = flags; - this.nameLoc = nameLoc; - this.operatorLoc = operatorLoc; - this.value = value; - this.name = name2; - this.depth = depth; + isHexadecimal() { + return (this.#flags & IntegerBaseFlags.HEXADECIMAL) !== 0; } /** * Accept a visitor for this node. @@ -12661,7 +21816,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitLocalVariableOrWriteNode(this); + visitor.visitIntegerNode(this); } /** * Returns all child nodes of the current node. @@ -12669,7 +21824,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return []; } /** * Compact and return an array of child nodes. @@ -12677,7 +21832,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + return []; } /** * Transforms the Node to a JavaScript object. @@ -12686,18 +21841,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "LocalVariableOrWriteNode", + type: "IntegerNode", location: this.location, flags: this.#flags, - nameLoc: this.nameLoc, - operatorLoc: this.operatorLoc, - value: this.value, - name: this.name, - depth: this.depth + value: this.value }; } }; - var LocalVariableReadNode = class { + var InterpolatedMatchLastLineNode = class { /** * @type number */ @@ -12711,198 +21862,122 @@ var HerbLinter = (() => { */ #flags; /** - * @type string + * @type Location */ - name; + openingLoc; /** - * @type number + * @type Node[] */ - depth; + parts; /** - * Construct a new LocalVariableReadNode. + * @type Location + */ + closingLoc; + /** + * Construct a new InterpolatedMatchLastLineNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string} name - * @param {number} depth + * @param {Location} openingLoc + * @param {Node[]} parts + * @param {Location} closingLoc */ - constructor(nodeID, location, flags, name2, depth) { + constructor(nodeID, location, flags, openingLoc, parts, closingLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; - this.depth = depth; + this.openingLoc = openingLoc; + this.parts = parts; + this.closingLoc = closingLoc; } /** - * Accept a visitor for this node. + * True if this node has the IGNORE_CASE flag. * - * @param {visitors.Visitor} visitor + * @returns {boolean} */ - accept(visitor) { - visitor.visitLocalVariableReadNode(this); + isIgnoreCase() { + return (this.#flags & RegularExpressionFlags.IGNORE_CASE) !== 0; } /** - * Returns all child nodes of the current node. + * True if this node has the EXTENDED flag. * - * @returns {(Node | null)[]} An array of child nodes. + * @returns {boolean} */ - childNodes() { - return []; + isExtended() { + return (this.#flags & RegularExpressionFlags.EXTENDED) !== 0; } /** - * Compact and return an array of child nodes. + * True if this node has the MULTI_LINE flag. * - * @returns {Node[]} An array of compacted child nodes. + * @returns {boolean} */ - compactChildNodes() { - return []; + isMultiLine() { + return (this.#flags & RegularExpressionFlags.MULTI_LINE) !== 0; } /** - * Transforms the Node to a JavaScript object. + * True if this node has the ONCE flag. * - * @returns {Object} + * @returns {boolean} */ - toJSON() { - return { - type: "LocalVariableReadNode", - location: this.location, - flags: this.#flags, - name: this.name, - depth: this.depth - }; + isOnce() { + return (this.#flags & RegularExpressionFlags.ONCE) !== 0; } - }; - var LocalVariableTargetNode = class { - /** - * @type number - */ - nodeID; - /** - * @type {Location} - */ - location; - /** - * @type number - */ - #flags; - /** - * @type string - */ - name; - /** - * @type number - */ - depth; /** - * Construct a new LocalVariableTargetNode. + * True if this node has the EUC_JP flag. * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {string} name - * @param {number} depth + * @returns {boolean} */ - constructor(nodeID, location, flags, name2, depth) { - this.nodeID = nodeID; - this.location = location; - this.#flags = flags; - this.name = name2; - this.depth = depth; + isEucJp() { + return (this.#flags & RegularExpressionFlags.EUC_JP) !== 0; } /** - * Accept a visitor for this node. + * True if this node has the ASCII_8BIT flag. * - * @param {visitors.Visitor} visitor + * @returns {boolean} */ - accept(visitor) { - visitor.visitLocalVariableTargetNode(this); + isAscii8bit() { + return (this.#flags & RegularExpressionFlags.ASCII_8BIT) !== 0; } /** - * Returns all child nodes of the current node. + * True if this node has the WINDOWS_31J flag. * - * @returns {(Node | null)[]} An array of child nodes. + * @returns {boolean} */ - childNodes() { - return []; + isWindows31j() { + return (this.#flags & RegularExpressionFlags.WINDOWS_31J) !== 0; } /** - * Compact and return an array of child nodes. + * True if this node has the UTF_8 flag. * - * @returns {Node[]} An array of compacted child nodes. + * @returns {boolean} */ - compactChildNodes() { - return []; + isUtf8() { + return (this.#flags & RegularExpressionFlags.UTF_8) !== 0; } /** - * Transforms the Node to a JavaScript object. + * True if this node has the FORCED_UTF8_ENCODING flag. * - * @returns {Object} + * @returns {boolean} */ - toJSON() { - return { - type: "LocalVariableTargetNode", - location: this.location, - flags: this.#flags, - name: this.name, - depth: this.depth - }; + isForcedUtf8Encoding() { + return (this.#flags & RegularExpressionFlags.FORCED_UTF8_ENCODING) !== 0; } - }; - var LocalVariableWriteNode = class { - /** - * @type number - */ - nodeID; - /** - * @type {Location} - */ - location; - /** - * @type number - */ - #flags; - /** - * @type string - */ - name; - /** - * @type number - */ - depth; - /** - * @type Location - */ - nameLoc; - /** - * @type Node - */ - value; /** - * @type Location + * True if this node has the FORCED_BINARY_ENCODING flag. + * + * @returns {boolean} */ - operatorLoc; + isForcedBinaryEncoding() { + return (this.#flags & RegularExpressionFlags.FORCED_BINARY_ENCODING) !== 0; + } /** - * Construct a new LocalVariableWriteNode. + * True if this node has the FORCED_US_ASCII_ENCODING flag. * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {string} name - * @param {number} depth - * @param {Location} nameLoc - * @param {Node} value - * @param {Location} operatorLoc + * @returns {boolean} */ - constructor(nodeID, location, flags, name2, depth, nameLoc, value, operatorLoc) { - this.nodeID = nodeID; - this.location = location; - this.#flags = flags; - this.name = name2; - this.depth = depth; - this.nameLoc = nameLoc; - this.value = value; - this.operatorLoc = operatorLoc; + isForcedUsAsciiEncoding() { + return (this.#flags & RegularExpressionFlags.FORCED_US_ASCII_ENCODING) !== 0; } /** * Accept a visitor for this node. @@ -12910,7 +21985,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitLocalVariableWriteNode(this); + visitor.visitInterpolatedMatchLastLineNode(this); } /** * Returns all child nodes of the current node. @@ -12918,7 +21993,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return [...this.parts]; } /** * Compact and return an array of child nodes. @@ -12926,7 +22001,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + return [...this.parts]; } /** * Transforms the Node to a JavaScript object. @@ -12935,18 +22010,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "LocalVariableWriteNode", + type: "InterpolatedMatchLastLineNode", location: this.location, flags: this.#flags, - name: this.name, - depth: this.depth, - nameLoc: this.nameLoc, - value: this.value, - operatorLoc: this.operatorLoc + openingLoc: this.openingLoc, + parts: this.parts, + closingLoc: this.closingLoc }; } }; - var MatchLastLineNode = class { + var InterpolatedRegularExpressionNode = class { /** * @type number */ @@ -12964,36 +22037,30 @@ var HerbLinter = (() => { */ openingLoc; /** - * @type Location + * @type Node[] */ - contentLoc; + parts; /** * @type Location */ closingLoc; /** - * @type RubyString - */ - unescaped; - /** - * Construct a new MatchLastLineNode. + * Construct a new InterpolatedRegularExpressionNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags * @param {Location} openingLoc - * @param {Location} contentLoc + * @param {Node[]} parts * @param {Location} closingLoc - * @param {RubyString} unescaped */ - constructor(nodeID, location, flags, openingLoc, contentLoc, closingLoc, unescaped) { + constructor(nodeID, location, flags, openingLoc, parts, closingLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; this.openingLoc = openingLoc; - this.contentLoc = contentLoc; + this.parts = parts; this.closingLoc = closingLoc; - this.unescaped = unescaped; } /** * True if this node has the IGNORE_CASE flag. @@ -13089,7 +22156,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitMatchLastLineNode(this); + visitor.visitInterpolatedRegularExpressionNode(this); } /** * Returns all child nodes of the current node. @@ -13097,7 +22164,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [...this.parts]; } /** * Compact and return an array of child nodes. @@ -13105,7 +22172,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + return [...this.parts]; } /** * Transforms the Node to a JavaScript object. @@ -13114,17 +22181,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "MatchLastLineNode", + type: "InterpolatedRegularExpressionNode", location: this.location, flags: this.#flags, openingLoc: this.openingLoc, - contentLoc: this.contentLoc, - closingLoc: this.closingLoc, - unescaped: this.unescaped + parts: this.parts, + closingLoc: this.closingLoc }; } }; - var MatchPredicateNode = class { + var InterpolatedStringNode = class { /** * @type number */ @@ -13138,34 +22204,50 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node + * @type Location | null */ - value; + openingLoc; /** - * @type Node + * @type Node[] */ - pattern; + parts; /** - * @type Location + * @type Location | null */ - operatorLoc; + closingLoc; /** - * Construct a new MatchPredicateNode. + * Construct a new InterpolatedStringNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node} value - * @param {Node} pattern - * @param {Location} operatorLoc + * @param {Location | null} openingLoc + * @param {Node[]} parts + * @param {Location | null} closingLoc */ - constructor(nodeID, location, flags, value, pattern, operatorLoc) { + constructor(nodeID, location, flags, openingLoc, parts, closingLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.value = value; - this.pattern = pattern; - this.operatorLoc = operatorLoc; + this.openingLoc = openingLoc; + this.parts = parts; + this.closingLoc = closingLoc; + } + /** + * True if this node has the FROZEN flag. + * + * @returns {boolean} + */ + isFrozen() { + return (this.#flags & InterpolatedStringNodeFlags.FROZEN) !== 0; + } + /** + * True if this node has the MUTABLE flag. + * + * @returns {boolean} + */ + isMutable() { + return (this.#flags & InterpolatedStringNodeFlags.MUTABLE) !== 0; } /** * Accept a visitor for this node. @@ -13173,7 +22255,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitMatchPredicateNode(this); + visitor.visitInterpolatedStringNode(this); } /** * Returns all child nodes of the current node. @@ -13181,7 +22263,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value, this.pattern]; + return [...this.parts]; } /** * Compact and return an array of child nodes. @@ -13189,7 +22271,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value, this.pattern]; + return [...this.parts]; } /** * Transforms the Node to a JavaScript object. @@ -13198,16 +22280,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "MatchPredicateNode", + type: "InterpolatedStringNode", location: this.location, flags: this.#flags, - value: this.value, - pattern: this.pattern, - operatorLoc: this.operatorLoc + openingLoc: this.openingLoc, + parts: this.parts, + closingLoc: this.closingLoc }; } }; - var MatchRequiredNode = class { + var InterpolatedSymbolNode = class { /** * @type number */ @@ -13221,34 +22303,34 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node + * @type Location | null */ - value; + openingLoc; /** - * @type Node + * @type Node[] */ - pattern; + parts; /** - * @type Location + * @type Location | null */ - operatorLoc; + closingLoc; /** - * Construct a new MatchRequiredNode. + * Construct a new InterpolatedSymbolNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node} value - * @param {Node} pattern - * @param {Location} operatorLoc + * @param {Location | null} openingLoc + * @param {Node[]} parts + * @param {Location | null} closingLoc */ - constructor(nodeID, location, flags, value, pattern, operatorLoc) { + constructor(nodeID, location, flags, openingLoc, parts, closingLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.value = value; - this.pattern = pattern; - this.operatorLoc = operatorLoc; + this.openingLoc = openingLoc; + this.parts = parts; + this.closingLoc = closingLoc; } /** * Accept a visitor for this node. @@ -13256,7 +22338,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitMatchRequiredNode(this); + visitor.visitInterpolatedSymbolNode(this); } /** * Returns all child nodes of the current node. @@ -13264,7 +22346,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value, this.pattern]; + return [...this.parts]; } /** * Compact and return an array of child nodes. @@ -13272,7 +22354,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value, this.pattern]; + return [...this.parts]; } /** * Transforms the Node to a JavaScript object. @@ -13281,16 +22363,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "MatchRequiredNode", + type: "InterpolatedSymbolNode", location: this.location, flags: this.#flags, - value: this.value, - pattern: this.pattern, - operatorLoc: this.operatorLoc + openingLoc: this.openingLoc, + parts: this.parts, + closingLoc: this.closingLoc }; } }; - var MatchWriteNode = class { + var InterpolatedXStringNode = class { /** * @type number */ @@ -13304,28 +22386,34 @@ var HerbLinter = (() => { */ #flags; /** - * @type CallNode + * @type Location */ - call; + openingLoc; /** * @type Node[] */ - targets; + parts; /** - * Construct a new MatchWriteNode. + * @type Location + */ + closingLoc; + /** + * Construct a new InterpolatedXStringNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {CallNode} call - * @param {Node[]} targets + * @param {Location} openingLoc + * @param {Node[]} parts + * @param {Location} closingLoc */ - constructor(nodeID, location, flags, call, targets) { + constructor(nodeID, location, flags, openingLoc, parts, closingLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.call = call; - this.targets = targets; + this.openingLoc = openingLoc; + this.parts = parts; + this.closingLoc = closingLoc; } /** * Accept a visitor for this node. @@ -13333,7 +22421,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitMatchWriteNode(this); + visitor.visitInterpolatedXStringNode(this); } /** * Returns all child nodes of the current node. @@ -13341,7 +22429,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.call, ...this.targets]; + return [...this.parts]; } /** * Compact and return an array of child nodes. @@ -13349,7 +22437,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.call, ...this.targets]; + return [...this.parts]; } /** * Transforms the Node to a JavaScript object. @@ -13358,15 +22446,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "MatchWriteNode", + type: "InterpolatedXStringNode", location: this.location, flags: this.#flags, - call: this.call, - targets: this.targets + openingLoc: this.openingLoc, + parts: this.parts, + closingLoc: this.closingLoc }; } }; - var MissingNode = class { + var ItLocalVariableReadNode = class { /** * @type number */ @@ -13380,7 +22469,7 @@ var HerbLinter = (() => { */ #flags; /** - * Construct a new MissingNode. + * Construct a new ItLocalVariableReadNode. * * @param {number} nodeID * @param {Location} location @@ -13397,7 +22486,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitMissingNode(this); + visitor.visitItLocalVariableReadNode(this); } /** * Returns all child nodes of the current node. @@ -13422,13 +22511,13 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "MissingNode", + type: "ItLocalVariableReadNode", location: this.location, flags: this.#flags }; } }; - var ModuleNode = class { + var ItParametersNode = class { /** * @type number */ @@ -13442,52 +22531,16 @@ var HerbLinter = (() => { */ #flags; /** - * @type string[] - */ - locals; - /** - * @type Location - */ - moduleKeywordLoc; - /** - * @type Node - */ - constantPath; - /** - * @type Node | null - */ - body; - /** - * @type Location - */ - endKeywordLoc; - /** - * @type string - */ - name; - /** - * Construct a new ModuleNode. + * Construct a new ItParametersNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string[]} locals - * @param {Location} moduleKeywordLoc - * @param {Node} constantPath - * @param {Node | null} body - * @param {Location} endKeywordLoc - * @param {string} name */ - constructor(nodeID, location, flags, locals, moduleKeywordLoc, constantPath, body, endKeywordLoc, name2) { + constructor(nodeID, location, flags) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.locals = locals; - this.moduleKeywordLoc = moduleKeywordLoc; - this.constantPath = constantPath; - this.body = body; - this.endKeywordLoc = endKeywordLoc; - this.name = name2; } /** * Accept a visitor for this node. @@ -13495,7 +22548,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitModuleNode(this); + visitor.visitItParametersNode(this); } /** * Returns all child nodes of the current node. @@ -13503,7 +22556,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.constantPath, this.body]; + return []; } /** * Compact and return an array of child nodes. @@ -13511,12 +22564,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - compact.push(this.constantPath); - if (this.body) { - compact.push(this.body); - } - return compact; + return []; } /** * Transforms the Node to a JavaScript object. @@ -13525,19 +22573,13 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ModuleNode", + type: "ItParametersNode", location: this.location, - flags: this.#flags, - locals: this.locals, - moduleKeywordLoc: this.moduleKeywordLoc, - constantPath: this.constantPath, - body: this.body, - endKeywordLoc: this.endKeywordLoc, - name: this.name + flags: this.#flags }; } }; - var MultiTargetNode = class { + var KeywordHashNode = class { /** * @type number */ @@ -13553,44 +22595,28 @@ var HerbLinter = (() => { /** * @type Node[] */ - lefts; - /** - * @type Node | null - */ - rest; - /** - * @type Node[] - */ - rights; - /** - * @type Location | null - */ - lparenLoc; - /** - * @type Location | null - */ - rparenLoc; + elements; /** - * Construct a new MultiTargetNode. + * Construct a new KeywordHashNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node[]} lefts - * @param {Node | null} rest - * @param {Node[]} rights - * @param {Location | null} lparenLoc - * @param {Location | null} rparenLoc + * @param {Node[]} elements */ - constructor(nodeID, location, flags, lefts, rest, rights, lparenLoc, rparenLoc) { + constructor(nodeID, location, flags, elements2) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.lefts = lefts; - this.rest = rest; - this.rights = rights; - this.lparenLoc = lparenLoc; - this.rparenLoc = rparenLoc; + this.elements = elements2; + } + /** + * True if this node has the SYMBOL_KEYS flag. + * + * @returns {boolean} + */ + isSymbolKeys() { + return (this.#flags & KeywordHashNodeFlags.SYMBOL_KEYS) !== 0; } /** * Accept a visitor for this node. @@ -13598,7 +22624,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitMultiTargetNode(this); + visitor.visitKeywordHashNode(this); } /** * Returns all child nodes of the current node. @@ -13606,7 +22632,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [...this.lefts, this.rest, ...this.rights]; + return [...this.elements]; } /** * Compact and return an array of child nodes. @@ -13614,13 +22640,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - compact.concat(this.lefts); - if (this.rest) { - compact.push(this.rest); - } - compact.concat(this.rights); - return compact; + return [...this.elements]; } /** * Transforms the Node to a JavaScript object. @@ -13629,18 +22649,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "MultiTargetNode", + type: "KeywordHashNode", location: this.location, flags: this.#flags, - lefts: this.lefts, - rest: this.rest, - rights: this.rights, - lparenLoc: this.lparenLoc, - rparenLoc: this.rparenLoc + elements: this.elements }; } }; - var MultiWriteNode = class { + var KeywordRestParameterNode = class { /** * @type number */ @@ -13654,58 +22670,42 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node[] - */ - lefts; - /** - * @type Node | null - */ - rest; - /** - * @type Node[] - */ - rights; - /** - * @type Location | null + * @type string | null */ - lparenLoc; + name; /** * @type Location | null */ - rparenLoc; + nameLoc; /** * @type Location */ operatorLoc; /** - * @type Node - */ - value; - /** - * Construct a new MultiWriteNode. + * Construct a new KeywordRestParameterNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node[]} lefts - * @param {Node | null} rest - * @param {Node[]} rights - * @param {Location | null} lparenLoc - * @param {Location | null} rparenLoc + * @param {string | null} name + * @param {Location | null} nameLoc * @param {Location} operatorLoc - * @param {Node} value */ - constructor(nodeID, location, flags, lefts, rest, rights, lparenLoc, rparenLoc, operatorLoc, value) { + constructor(nodeID, location, flags, name2, nameLoc, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.lefts = lefts; - this.rest = rest; - this.rights = rights; - this.lparenLoc = lparenLoc; - this.rparenLoc = rparenLoc; + this.name = name2; + this.nameLoc = nameLoc; this.operatorLoc = operatorLoc; - this.value = value; + } + /** + * True if this node has the REPEATED_PARAMETER flag. + * + * @returns {boolean} + */ + isRepeatedParameter() { + return (this.#flags & ParameterFlags.REPEATED_PARAMETER) !== 0; } /** * Accept a visitor for this node. @@ -13713,7 +22713,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitMultiWriteNode(this); + visitor.visitKeywordRestParameterNode(this); } /** * Returns all child nodes of the current node. @@ -13721,7 +22721,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [...this.lefts, this.rest, ...this.rights, this.value]; + return []; } /** * Compact and return an array of child nodes. @@ -13729,14 +22729,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - compact.concat(this.lefts); - if (this.rest) { - compact.push(this.rest); - } - compact.concat(this.rights); - compact.push(this.value); - return compact; + return []; } /** * Transforms the Node to a JavaScript object. @@ -13745,20 +22738,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "MultiWriteNode", + type: "KeywordRestParameterNode", location: this.location, flags: this.#flags, - lefts: this.lefts, - rest: this.rest, - rights: this.rights, - lparenLoc: this.lparenLoc, - rparenLoc: this.rparenLoc, - operatorLoc: this.operatorLoc, - value: this.value + name: this.name, + nameLoc: this.nameLoc, + operatorLoc: this.operatorLoc }; } }; - var NextNode = class { + var LambdaNode = class { /** * @type number */ @@ -13772,28 +22761,52 @@ var HerbLinter = (() => { */ #flags; /** - * @type ArgumentsNode | null + * @type string[] */ - arguments_; + locals; /** * @type Location */ - keywordLoc; + operatorLoc; /** - * Construct a new NextNode. + * @type Location + */ + openingLoc; + /** + * @type Location + */ + closingLoc; + /** + * @type Node | null + */ + parameters; + /** + * @type Node | null + */ + body; + /** + * Construct a new LambdaNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {ArgumentsNode | null} arguments_ - * @param {Location} keywordLoc + * @param {string[]} locals + * @param {Location} operatorLoc + * @param {Location} openingLoc + * @param {Location} closingLoc + * @param {Node | null} parameters + * @param {Node | null} body */ - constructor(nodeID, location, flags, arguments_, keywordLoc) { + constructor(nodeID, location, flags, locals, operatorLoc, openingLoc, closingLoc, parameters, body) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.arguments_ = arguments_; - this.keywordLoc = keywordLoc; + this.locals = locals; + this.operatorLoc = operatorLoc; + this.openingLoc = openingLoc; + this.closingLoc = closingLoc; + this.parameters = parameters; + this.body = body; } /** * Accept a visitor for this node. @@ -13801,7 +22814,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitNextNode(this); + visitor.visitLambdaNode(this); } /** * Returns all child nodes of the current node. @@ -13809,7 +22822,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.arguments_]; + return [this.parameters, this.body]; } /** * Compact and return an array of child nodes. @@ -13818,8 +22831,11 @@ var HerbLinter = (() => { */ compactChildNodes() { const compact = []; - if (this.arguments_) { - compact.push(this.arguments_); + if (this.parameters) { + compact.push(this.parameters); + } + if (this.body) { + compact.push(this.body); } return compact; } @@ -13830,15 +22846,19 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "NextNode", + type: "LambdaNode", location: this.location, flags: this.#flags, - arguments: this.arguments_, - keywordLoc: this.keywordLoc + locals: this.locals, + operatorLoc: this.operatorLoc, + openingLoc: this.openingLoc, + closingLoc: this.closingLoc, + parameters: this.parameters, + body: this.body }; } }; - var NilNode = class { + var LocalVariableAndWriteNode = class { /** * @type number */ @@ -13852,16 +22872,46 @@ var HerbLinter = (() => { */ #flags; /** - * Construct a new NilNode. + * @type Location + */ + nameLoc; + /** + * @type Location + */ + operatorLoc; + /** + * @type Node + */ + value; + /** + * @type string + */ + name; + /** + * @type number + */ + depth; + /** + * Construct a new LocalVariableAndWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {Location} nameLoc + * @param {Location} operatorLoc + * @param {Node} value + * @param {string} name + * @param {number} depth */ - constructor(nodeID, location, flags) { + constructor(nodeID, location, flags, nameLoc, operatorLoc, value, name2, depth) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.nameLoc = nameLoc; + this.operatorLoc = operatorLoc; + this.value = value; + this.name = name2; + this.depth = depth; } /** * Accept a visitor for this node. @@ -13869,7 +22919,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitNilNode(this); + visitor.visitLocalVariableAndWriteNode(this); } /** * Returns all child nodes of the current node. @@ -13877,7 +22927,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -13885,7 +22935,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -13894,13 +22944,18 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "NilNode", + type: "LocalVariableAndWriteNode", location: this.location, - flags: this.#flags + flags: this.#flags, + nameLoc: this.nameLoc, + operatorLoc: this.operatorLoc, + value: this.value, + name: this.name, + depth: this.depth }; } }; - var NoKeywordsParameterNode = class { + var LocalVariableOperatorWriteNode = class { /** * @type number */ @@ -13916,26 +22971,50 @@ var HerbLinter = (() => { /** * @type Location */ - operatorLoc; + nameLoc; /** * @type Location */ - keywordLoc; + binaryOperatorLoc; /** - * Construct a new NoKeywordsParameterNode. + * @type Node + */ + value; + /** + * @type string + */ + name; + /** + * @type string + */ + binaryOperator; + /** + * @type number + */ + depth; + /** + * Construct a new LocalVariableOperatorWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} operatorLoc - * @param {Location} keywordLoc + * @param {Location} nameLoc + * @param {Location} binaryOperatorLoc + * @param {Node} value + * @param {string} name + * @param {string} binaryOperator + * @param {number} depth */ - constructor(nodeID, location, flags, operatorLoc, keywordLoc) { + constructor(nodeID, location, flags, nameLoc, binaryOperatorLoc, value, name2, binaryOperator, depth) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.operatorLoc = operatorLoc; - this.keywordLoc = keywordLoc; + this.nameLoc = nameLoc; + this.binaryOperatorLoc = binaryOperatorLoc; + this.value = value; + this.name = name2; + this.binaryOperator = binaryOperator; + this.depth = depth; } /** * Accept a visitor for this node. @@ -13943,7 +23022,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitNoKeywordsParameterNode(this); + visitor.visitLocalVariableOperatorWriteNode(this); } /** * Returns all child nodes of the current node. @@ -13951,7 +23030,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -13959,7 +23038,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -13968,15 +23047,19 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "NoKeywordsParameterNode", + type: "LocalVariableOperatorWriteNode", location: this.location, flags: this.#flags, - operatorLoc: this.operatorLoc, - keywordLoc: this.keywordLoc + nameLoc: this.nameLoc, + binaryOperatorLoc: this.binaryOperatorLoc, + value: this.value, + name: this.name, + binaryOperator: this.binaryOperator, + depth: this.depth }; } }; - var NumberedParametersNode = class { + var LocalVariableOrWriteNode = class { /** * @type number */ @@ -13989,23 +23072,47 @@ var HerbLinter = (() => { * @type number */ #flags; + /** + * @type Location + */ + nameLoc; + /** + * @type Location + */ + operatorLoc; + /** + * @type Node + */ + value; + /** + * @type string + */ + name; /** * @type number */ - maximum; + depth; /** - * Construct a new NumberedParametersNode. + * Construct a new LocalVariableOrWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {number} maximum + * @param {Location} nameLoc + * @param {Location} operatorLoc + * @param {Node} value + * @param {string} name + * @param {number} depth */ - constructor(nodeID, location, flags, maximum) { + constructor(nodeID, location, flags, nameLoc, operatorLoc, value, name2, depth) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.maximum = maximum; + this.nameLoc = nameLoc; + this.operatorLoc = operatorLoc; + this.value = value; + this.name = name2; + this.depth = depth; } /** * Accept a visitor for this node. @@ -14013,7 +23120,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitNumberedParametersNode(this); + visitor.visitLocalVariableOrWriteNode(this); } /** * Returns all child nodes of the current node. @@ -14021,7 +23128,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -14029,7 +23136,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -14038,14 +23145,18 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "NumberedParametersNode", + type: "LocalVariableOrWriteNode", location: this.location, flags: this.#flags, - maximum: this.maximum + nameLoc: this.nameLoc, + operatorLoc: this.operatorLoc, + value: this.value, + name: this.name, + depth: this.depth }; } }; - var NumberedReferenceReadNode = class { + var LocalVariableReadNode = class { /** * @type number */ @@ -14058,23 +23169,29 @@ var HerbLinter = (() => { * @type number */ #flags; + /** + * @type string + */ + name; /** * @type number */ - number; + depth; /** - * Construct a new NumberedReferenceReadNode. + * Construct a new LocalVariableReadNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {number} number + * @param {string} name + * @param {number} depth */ - constructor(nodeID, location, flags, number) { + constructor(nodeID, location, flags, name2, depth) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.number = number; + this.name = name2; + this.depth = depth; } /** * Accept a visitor for this node. @@ -14082,7 +23199,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitNumberedReferenceReadNode(this); + visitor.visitLocalVariableReadNode(this); } /** * Returns all child nodes of the current node. @@ -14107,14 +23224,15 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "NumberedReferenceReadNode", + type: "LocalVariableReadNode", location: this.location, flags: this.#flags, - number: this.number + name: this.name, + depth: this.depth }; } }; - var OptionalKeywordParameterNode = class { + var LocalVariableTargetNode = class { /** * @type number */ @@ -14132,38 +23250,24 @@ var HerbLinter = (() => { */ name; /** - * @type Location - */ - nameLoc; - /** - * @type Node + * @type number */ - value; + depth; /** - * Construct a new OptionalKeywordParameterNode. + * Construct a new LocalVariableTargetNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags * @param {string} name - * @param {Location} nameLoc - * @param {Node} value + * @param {number} depth */ - constructor(nodeID, location, flags, name2, nameLoc, value) { + constructor(nodeID, location, flags, name2, depth) { this.nodeID = nodeID; this.location = location; this.#flags = flags; this.name = name2; - this.nameLoc = nameLoc; - this.value = value; - } - /** - * True if this node has the REPEATED_PARAMETER flag. - * - * @returns {boolean} - */ - isRepeatedParameter() { - return (this.#flags & ParameterFlags.REPEATED_PARAMETER) !== 0; + this.depth = depth; } /** * Accept a visitor for this node. @@ -14171,7 +23275,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitOptionalKeywordParameterNode(this); + visitor.visitLocalVariableTargetNode(this); } /** * Returns all child nodes of the current node. @@ -14179,7 +23283,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.value]; + return []; } /** * Compact and return an array of child nodes. @@ -14187,7 +23291,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.value]; + return []; } /** * Transforms the Node to a JavaScript object. @@ -14196,16 +23300,15 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "OptionalKeywordParameterNode", + type: "LocalVariableTargetNode", location: this.location, flags: this.#flags, name: this.name, - nameLoc: this.nameLoc, - value: this.value + depth: this.depth }; } }; - var OptionalParameterNode = class { + var LocalVariableWriteNode = class { /** * @type number */ @@ -14223,44 +23326,42 @@ var HerbLinter = (() => { */ name; /** - * @type Location + * @type number */ - nameLoc; + depth; /** * @type Location */ - operatorLoc; + nameLoc; /** * @type Node */ value; /** - * Construct a new OptionalParameterNode. - * - * @param {number} nodeID - * @param {Location} location + * @type Location + */ + operatorLoc; + /** + * Construct a new LocalVariableWriteNode. + * + * @param {number} nodeID + * @param {Location} location * @param {number} flags * @param {string} name + * @param {number} depth * @param {Location} nameLoc - * @param {Location} operatorLoc * @param {Node} value + * @param {Location} operatorLoc */ - constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { + constructor(nodeID, location, flags, name2, depth, nameLoc, value, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; this.name = name2; + this.depth = depth; this.nameLoc = nameLoc; - this.operatorLoc = operatorLoc; this.value = value; - } - /** - * True if this node has the REPEATED_PARAMETER flag. - * - * @returns {boolean} - */ - isRepeatedParameter() { - return (this.#flags & ParameterFlags.REPEATED_PARAMETER) !== 0; + this.operatorLoc = operatorLoc; } /** * Accept a visitor for this node. @@ -14268,7 +23369,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitOptionalParameterNode(this); + visitor.visitLocalVariableWriteNode(this); } /** * Returns all child nodes of the current node. @@ -14293,17 +23394,18 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "OptionalParameterNode", + type: "LocalVariableWriteNode", location: this.location, flags: this.#flags, name: this.name, + depth: this.depth, nameLoc: this.nameLoc, - operatorLoc: this.operatorLoc, - value: this.value + value: this.value, + operatorLoc: this.operatorLoc }; } }; - var OrNode = class { + var MatchLastLineNode = class { /** * @type number */ @@ -14317,34 +23419,128 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node + * @type Location */ - left; + openingLoc; /** - * @type Node + * @type Location */ - right; + contentLoc; /** * @type Location */ - operatorLoc; + closingLoc; /** - * Construct a new OrNode. + * @type RubyString + */ + unescaped; + /** + * Construct a new MatchLastLineNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node} left - * @param {Node} right - * @param {Location} operatorLoc + * @param {Location} openingLoc + * @param {Location} contentLoc + * @param {Location} closingLoc + * @param {RubyString} unescaped */ - constructor(nodeID, location, flags, left, right, operatorLoc) { + constructor(nodeID, location, flags, openingLoc, contentLoc, closingLoc, unescaped) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.left = left; - this.right = right; - this.operatorLoc = operatorLoc; + this.openingLoc = openingLoc; + this.contentLoc = contentLoc; + this.closingLoc = closingLoc; + this.unescaped = unescaped; + } + /** + * True if this node has the IGNORE_CASE flag. + * + * @returns {boolean} + */ + isIgnoreCase() { + return (this.#flags & RegularExpressionFlags.IGNORE_CASE) !== 0; + } + /** + * True if this node has the EXTENDED flag. + * + * @returns {boolean} + */ + isExtended() { + return (this.#flags & RegularExpressionFlags.EXTENDED) !== 0; + } + /** + * True if this node has the MULTI_LINE flag. + * + * @returns {boolean} + */ + isMultiLine() { + return (this.#flags & RegularExpressionFlags.MULTI_LINE) !== 0; + } + /** + * True if this node has the ONCE flag. + * + * @returns {boolean} + */ + isOnce() { + return (this.#flags & RegularExpressionFlags.ONCE) !== 0; + } + /** + * True if this node has the EUC_JP flag. + * + * @returns {boolean} + */ + isEucJp() { + return (this.#flags & RegularExpressionFlags.EUC_JP) !== 0; + } + /** + * True if this node has the ASCII_8BIT flag. + * + * @returns {boolean} + */ + isAscii8bit() { + return (this.#flags & RegularExpressionFlags.ASCII_8BIT) !== 0; + } + /** + * True if this node has the WINDOWS_31J flag. + * + * @returns {boolean} + */ + isWindows31j() { + return (this.#flags & RegularExpressionFlags.WINDOWS_31J) !== 0; + } + /** + * True if this node has the UTF_8 flag. + * + * @returns {boolean} + */ + isUtf8() { + return (this.#flags & RegularExpressionFlags.UTF_8) !== 0; + } + /** + * True if this node has the FORCED_UTF8_ENCODING flag. + * + * @returns {boolean} + */ + isForcedUtf8Encoding() { + return (this.#flags & RegularExpressionFlags.FORCED_UTF8_ENCODING) !== 0; + } + /** + * True if this node has the FORCED_BINARY_ENCODING flag. + * + * @returns {boolean} + */ + isForcedBinaryEncoding() { + return (this.#flags & RegularExpressionFlags.FORCED_BINARY_ENCODING) !== 0; + } + /** + * True if this node has the FORCED_US_ASCII_ENCODING flag. + * + * @returns {boolean} + */ + isForcedUsAsciiEncoding() { + return (this.#flags & RegularExpressionFlags.FORCED_US_ASCII_ENCODING) !== 0; } /** * Accept a visitor for this node. @@ -14352,7 +23548,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitOrNode(this); + visitor.visitMatchLastLineNode(this); } /** * Returns all child nodes of the current node. @@ -14360,7 +23556,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.left, this.right]; + return []; } /** * Compact and return an array of child nodes. @@ -14368,7 +23564,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.left, this.right]; + return []; } /** * Transforms the Node to a JavaScript object. @@ -14377,16 +23573,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "OrNode", + type: "MatchLastLineNode", location: this.location, flags: this.#flags, - left: this.left, - right: this.right, - operatorLoc: this.operatorLoc + openingLoc: this.openingLoc, + contentLoc: this.contentLoc, + closingLoc: this.closingLoc, + unescaped: this.unescaped }; } }; - var ParametersNode = class { + var MatchPredicateNode = class { /** * @type number */ @@ -14400,58 +23597,34 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node[] - */ - requireds; - /** - * @type Node[] - */ - optionals; - /** - * @type Node | null - */ - rest; - /** - * @type Node[] - */ - posts; - /** - * @type Node[] + * @type Node */ - keywords; + value; /** - * @type Node | null + * @type Node */ - keywordRest; + pattern; /** - * @type BlockParameterNode | null + * @type Location */ - block; + operatorLoc; /** - * Construct a new ParametersNode. + * Construct a new MatchPredicateNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node[]} requireds - * @param {Node[]} optionals - * @param {Node | null} rest - * @param {Node[]} posts - * @param {Node[]} keywords - * @param {Node | null} keywordRest - * @param {BlockParameterNode | null} block + * @param {Node} value + * @param {Node} pattern + * @param {Location} operatorLoc */ - constructor(nodeID, location, flags, requireds, optionals, rest, posts, keywords, keywordRest, block2) { + constructor(nodeID, location, flags, value, pattern, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.requireds = requireds; - this.optionals = optionals; - this.rest = rest; - this.posts = posts; - this.keywords = keywords; - this.keywordRest = keywordRest; - this.block = block2; + this.value = value; + this.pattern = pattern; + this.operatorLoc = operatorLoc; } /** * Accept a visitor for this node. @@ -14459,7 +23632,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitParametersNode(this); + visitor.visitMatchPredicateNode(this); } /** * Returns all child nodes of the current node. @@ -14467,7 +23640,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [...this.requireds, ...this.optionals, this.rest, ...this.posts, ...this.keywords, this.keywordRest, this.block]; + return [this.value, this.pattern]; } /** * Compact and return an array of child nodes. @@ -14475,21 +23648,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - compact.concat(this.requireds); - compact.concat(this.optionals); - if (this.rest) { - compact.push(this.rest); - } - compact.concat(this.posts); - compact.concat(this.keywords); - if (this.keywordRest) { - compact.push(this.keywordRest); - } - if (this.block) { - compact.push(this.block); - } - return compact; + return [this.value, this.pattern]; } /** * Transforms the Node to a JavaScript object. @@ -14498,20 +23657,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ParametersNode", + type: "MatchPredicateNode", location: this.location, flags: this.#flags, - requireds: this.requireds, - optionals: this.optionals, - rest: this.rest, - posts: this.posts, - keywords: this.keywords, - keywordRest: this.keywordRest, - block: this.block + value: this.value, + pattern: this.pattern, + operatorLoc: this.operatorLoc }; } }; - var ParenthesesNode = class { + var MatchRequiredNode = class { /** * @type number */ @@ -14525,42 +23680,34 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node | null + * @type Node */ - body; + value; /** - * @type Location + * @type Node */ - openingLoc; + pattern; /** * @type Location */ - closingLoc; + operatorLoc; /** - * Construct a new ParenthesesNode. + * Construct a new MatchRequiredNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node | null} body - * @param {Location} openingLoc - * @param {Location} closingLoc + * @param {Node} value + * @param {Node} pattern + * @param {Location} operatorLoc */ - constructor(nodeID, location, flags, body, openingLoc, closingLoc) { + constructor(nodeID, location, flags, value, pattern, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.body = body; - this.openingLoc = openingLoc; - this.closingLoc = closingLoc; - } - /** - * True if this node has the MULTIPLE_STATEMENTS flag. - * - * @returns {boolean} - */ - isMultipleStatements() { - return (this.#flags & ParenthesesNodeFlags.MULTIPLE_STATEMENTS) !== 0; + this.value = value; + this.pattern = pattern; + this.operatorLoc = operatorLoc; } /** * Accept a visitor for this node. @@ -14568,7 +23715,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitParenthesesNode(this); + visitor.visitMatchRequiredNode(this); } /** * Returns all child nodes of the current node. @@ -14576,7 +23723,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.body]; + return [this.value, this.pattern]; } /** * Compact and return an array of child nodes. @@ -14584,11 +23731,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.body) { - compact.push(this.body); - } - return compact; + return [this.value, this.pattern]; } /** * Transforms the Node to a JavaScript object. @@ -14597,16 +23740,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ParenthesesNode", + type: "MatchRequiredNode", location: this.location, flags: this.#flags, - body: this.body, - openingLoc: this.openingLoc, - closingLoc: this.closingLoc + value: this.value, + pattern: this.pattern, + operatorLoc: this.operatorLoc }; } }; - var PinnedExpressionNode = class { + var MatchWriteNode = class { /** * @type number */ @@ -14620,40 +23763,28 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node - */ - expression; - /** - * @type Location - */ - operatorLoc; - /** - * @type Location + * @type CallNode */ - lparenLoc; + call; /** - * @type Location + * @type Node[] */ - rparenLoc; + targets; /** - * Construct a new PinnedExpressionNode. + * Construct a new MatchWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node} expression - * @param {Location} operatorLoc - * @param {Location} lparenLoc - * @param {Location} rparenLoc + * @param {CallNode} call + * @param {Node[]} targets */ - constructor(nodeID, location, flags, expression, operatorLoc, lparenLoc, rparenLoc) { + constructor(nodeID, location, flags, call, targets) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.expression = expression; - this.operatorLoc = operatorLoc; - this.lparenLoc = lparenLoc; - this.rparenLoc = rparenLoc; + this.call = call; + this.targets = targets; } /** * Accept a visitor for this node. @@ -14661,7 +23792,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitPinnedExpressionNode(this); + visitor.visitMatchWriteNode(this); } /** * Returns all child nodes of the current node. @@ -14669,7 +23800,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.expression]; + return [this.call, ...this.targets]; } /** * Compact and return an array of child nodes. @@ -14677,7 +23808,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.expression]; + return [this.call, ...this.targets]; } /** * Transforms the Node to a JavaScript object. @@ -14686,17 +23817,15 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "PinnedExpressionNode", + type: "MatchWriteNode", location: this.location, flags: this.#flags, - expression: this.expression, - operatorLoc: this.operatorLoc, - lparenLoc: this.lparenLoc, - rparenLoc: this.rparenLoc + call: this.call, + targets: this.targets }; } }; - var PinnedVariableNode = class { + var MissingNode = class { /** * @type number */ @@ -14710,28 +23839,16 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node - */ - variable; - /** - * @type Location - */ - operatorLoc; - /** - * Construct a new PinnedVariableNode. + * Construct a new MissingNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node} variable - * @param {Location} operatorLoc */ - constructor(nodeID, location, flags, variable, operatorLoc) { + constructor(nodeID, location, flags) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.variable = variable; - this.operatorLoc = operatorLoc; } /** * Accept a visitor for this node. @@ -14739,7 +23856,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitPinnedVariableNode(this); + visitor.visitMissingNode(this); } /** * Returns all child nodes of the current node. @@ -14747,7 +23864,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.variable]; + return []; } /** * Compact and return an array of child nodes. @@ -14755,7 +23872,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.variable]; + return []; } /** * Transforms the Node to a JavaScript object. @@ -14764,15 +23881,13 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "PinnedVariableNode", + type: "MissingNode", location: this.location, - flags: this.#flags, - variable: this.variable, - operatorLoc: this.operatorLoc + flags: this.#flags }; } }; - var PostExecutionNode = class { + var ModuleNode = class { /** * @type number */ @@ -14786,40 +23901,52 @@ var HerbLinter = (() => { */ #flags; /** - * @type StatementsNode | null + * @type string[] */ - statements; + locals; /** * @type Location */ - keywordLoc; + moduleKeywordLoc; /** - * @type Location + * @type Node */ - openingLoc; + constantPath; + /** + * @type Node | null + */ + body; /** * @type Location */ - closingLoc; + endKeywordLoc; /** - * Construct a new PostExecutionNode. + * @type string + */ + name; + /** + * Construct a new ModuleNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {StatementsNode | null} statements - * @param {Location} keywordLoc - * @param {Location} openingLoc - * @param {Location} closingLoc + * @param {string[]} locals + * @param {Location} moduleKeywordLoc + * @param {Node} constantPath + * @param {Node | null} body + * @param {Location} endKeywordLoc + * @param {string} name */ - constructor(nodeID, location, flags, statements, keywordLoc, openingLoc, closingLoc) { + constructor(nodeID, location, flags, locals, moduleKeywordLoc, constantPath, body, endKeywordLoc, name2) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.statements = statements; - this.keywordLoc = keywordLoc; - this.openingLoc = openingLoc; - this.closingLoc = closingLoc; + this.locals = locals; + this.moduleKeywordLoc = moduleKeywordLoc; + this.constantPath = constantPath; + this.body = body; + this.endKeywordLoc = endKeywordLoc; + this.name = name2; } /** * Accept a visitor for this node. @@ -14827,7 +23954,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitPostExecutionNode(this); + visitor.visitModuleNode(this); } /** * Returns all child nodes of the current node. @@ -14835,7 +23962,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.statements]; + return [this.constantPath, this.body]; } /** * Compact and return an array of child nodes. @@ -14844,8 +23971,9 @@ var HerbLinter = (() => { */ compactChildNodes() { const compact = []; - if (this.statements) { - compact.push(this.statements); + compact.push(this.constantPath); + if (this.body) { + compact.push(this.body); } return compact; } @@ -14856,17 +23984,19 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "PostExecutionNode", + type: "ModuleNode", location: this.location, flags: this.#flags, - statements: this.statements, - keywordLoc: this.keywordLoc, - openingLoc: this.openingLoc, - closingLoc: this.closingLoc + locals: this.locals, + moduleKeywordLoc: this.moduleKeywordLoc, + constantPath: this.constantPath, + body: this.body, + endKeywordLoc: this.endKeywordLoc, + name: this.name }; } }; - var PreExecutionNode = class { + var MultiTargetNode = class { /** * @type number */ @@ -14880,40 +24010,46 @@ var HerbLinter = (() => { */ #flags; /** - * @type StatementsNode | null + * @type Node[] */ - statements; + lefts; /** - * @type Location + * @type Node | null */ - keywordLoc; + rest; /** - * @type Location + * @type Node[] */ - openingLoc; + rights; /** - * @type Location + * @type Location | null */ - closingLoc; + lparenLoc; /** - * Construct a new PreExecutionNode. + * @type Location | null + */ + rparenLoc; + /** + * Construct a new MultiTargetNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {StatementsNode | null} statements - * @param {Location} keywordLoc - * @param {Location} openingLoc - * @param {Location} closingLoc + * @param {Node[]} lefts + * @param {Node | null} rest + * @param {Node[]} rights + * @param {Location | null} lparenLoc + * @param {Location | null} rparenLoc */ - constructor(nodeID, location, flags, statements, keywordLoc, openingLoc, closingLoc) { + constructor(nodeID, location, flags, lefts, rest, rights, lparenLoc, rparenLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.statements = statements; - this.keywordLoc = keywordLoc; - this.openingLoc = openingLoc; - this.closingLoc = closingLoc; + this.lefts = lefts; + this.rest = rest; + this.rights = rights; + this.lparenLoc = lparenLoc; + this.rparenLoc = rparenLoc; } /** * Accept a visitor for this node. @@ -14921,7 +24057,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitPreExecutionNode(this); + visitor.visitMultiTargetNode(this); } /** * Returns all child nodes of the current node. @@ -14929,7 +24065,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.statements]; + return [...this.lefts, this.rest, ...this.rights]; } /** * Compact and return an array of child nodes. @@ -14938,9 +24074,11 @@ var HerbLinter = (() => { */ compactChildNodes() { const compact = []; - if (this.statements) { - compact.push(this.statements); + compact.concat(this.lefts); + if (this.rest) { + compact.push(this.rest); } + compact.concat(this.rights); return compact; } /** @@ -14950,17 +24088,18 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "PreExecutionNode", + type: "MultiTargetNode", location: this.location, flags: this.#flags, - statements: this.statements, - keywordLoc: this.keywordLoc, - openingLoc: this.openingLoc, - closingLoc: this.closingLoc + lefts: this.lefts, + rest: this.rest, + rights: this.rights, + lparenLoc: this.lparenLoc, + rparenLoc: this.rparenLoc }; } }; - var ProgramNode = class { + var MultiWriteNode = class { /** * @type number */ @@ -14974,28 +24113,58 @@ var HerbLinter = (() => { */ #flags; /** - * @type string[] + * @type Node[] */ - locals; + lefts; /** - * @type StatementsNode + * @type Node | null */ - statements; + rest; /** - * Construct a new ProgramNode. + * @type Node[] + */ + rights; + /** + * @type Location | null + */ + lparenLoc; + /** + * @type Location | null + */ + rparenLoc; + /** + * @type Location + */ + operatorLoc; + /** + * @type Node + */ + value; + /** + * Construct a new MultiWriteNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string[]} locals - * @param {StatementsNode} statements + * @param {Node[]} lefts + * @param {Node | null} rest + * @param {Node[]} rights + * @param {Location | null} lparenLoc + * @param {Location | null} rparenLoc + * @param {Location} operatorLoc + * @param {Node} value */ - constructor(nodeID, location, flags, locals, statements) { + constructor(nodeID, location, flags, lefts, rest, rights, lparenLoc, rparenLoc, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.locals = locals; - this.statements = statements; + this.lefts = lefts; + this.rest = rest; + this.rights = rights; + this.lparenLoc = lparenLoc; + this.rparenLoc = rparenLoc; + this.operatorLoc = operatorLoc; + this.value = value; } /** * Accept a visitor for this node. @@ -15003,7 +24172,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitProgramNode(this); + visitor.visitMultiWriteNode(this); } /** * Returns all child nodes of the current node. @@ -15011,7 +24180,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.statements]; + return [...this.lefts, this.rest, ...this.rights, this.value]; } /** * Compact and return an array of child nodes. @@ -15019,7 +24188,14 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.statements]; + const compact = []; + compact.concat(this.lefts); + if (this.rest) { + compact.push(this.rest); + } + compact.concat(this.rights); + compact.push(this.value); + return compact; } /** * Transforms the Node to a JavaScript object. @@ -15028,15 +24204,20 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ProgramNode", + type: "MultiWriteNode", location: this.location, flags: this.#flags, - locals: this.locals, - statements: this.statements + lefts: this.lefts, + rest: this.rest, + rights: this.rights, + lparenLoc: this.lparenLoc, + rparenLoc: this.rparenLoc, + operatorLoc: this.operatorLoc, + value: this.value }; } }; - var RangeNode = class { + var NextNode = class { /** * @type number */ @@ -15050,42 +24231,28 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node | null - */ - left; - /** - * @type Node | null + * @type ArgumentsNode | null */ - right; + arguments_; /** * @type Location */ - operatorLoc; + keywordLoc; /** - * Construct a new RangeNode. + * Construct a new NextNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node | null} left - * @param {Node | null} right - * @param {Location} operatorLoc + * @param {ArgumentsNode | null} arguments_ + * @param {Location} keywordLoc */ - constructor(nodeID, location, flags, left, right, operatorLoc) { + constructor(nodeID, location, flags, arguments_, keywordLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.left = left; - this.right = right; - this.operatorLoc = operatorLoc; - } - /** - * True if this node has the EXCLUDE_END flag. - * - * @returns {boolean} - */ - isExcludeEnd() { - return (this.#flags & RangeFlags.EXCLUDE_END) !== 0; + this.arguments_ = arguments_; + this.keywordLoc = keywordLoc; } /** * Accept a visitor for this node. @@ -15093,7 +24260,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitRangeNode(this); + visitor.visitNextNode(this); } /** * Returns all child nodes of the current node. @@ -15101,7 +24268,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.left, this.right]; + return [this.arguments_]; } /** * Compact and return an array of child nodes. @@ -15110,11 +24277,8 @@ var HerbLinter = (() => { */ compactChildNodes() { const compact = []; - if (this.left) { - compact.push(this.left); - } - if (this.right) { - compact.push(this.right); + if (this.arguments_) { + compact.push(this.arguments_); } return compact; } @@ -15125,16 +24289,15 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "RangeNode", + type: "NextNode", location: this.location, flags: this.#flags, - left: this.left, - right: this.right, - operatorLoc: this.operatorLoc + arguments: this.arguments_, + keywordLoc: this.keywordLoc }; } }; - var RationalNode = class { + var NilNode = class { /** * @type number */ @@ -15148,60 +24311,16 @@ var HerbLinter = (() => { */ #flags; /** - * @type number - */ - numerator; - /** - * @type number - */ - denominator; - /** - * Construct a new RationalNode. + * Construct a new NilNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {number} numerator - * @param {number} denominator */ - constructor(nodeID, location, flags, numerator, denominator) { + constructor(nodeID, location, flags) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.numerator = numerator; - this.denominator = denominator; - } - /** - * True if this node has the BINARY flag. - * - * @returns {boolean} - */ - isBinary() { - return (this.#flags & IntegerBaseFlags.BINARY) !== 0; - } - /** - * True if this node has the DECIMAL flag. - * - * @returns {boolean} - */ - isDecimal() { - return (this.#flags & IntegerBaseFlags.DECIMAL) !== 0; - } - /** - * True if this node has the OCTAL flag. - * - * @returns {boolean} - */ - isOctal() { - return (this.#flags & IntegerBaseFlags.OCTAL) !== 0; - } - /** - * True if this node has the HEXADECIMAL flag. - * - * @returns {boolean} - */ - isHexadecimal() { - return (this.#flags & IntegerBaseFlags.HEXADECIMAL) !== 0; } /** * Accept a visitor for this node. @@ -15209,7 +24328,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitRationalNode(this); + visitor.visitNilNode(this); } /** * Returns all child nodes of the current node. @@ -15234,15 +24353,13 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "RationalNode", + type: "NilNode", location: this.location, - flags: this.#flags, - numerator: this.numerator, - denominator: this.denominator + flags: this.#flags }; } }; - var RedoNode = class { + var NoKeywordsParameterNode = class { /** * @type number */ @@ -15256,16 +24373,28 @@ var HerbLinter = (() => { */ #flags; /** - * Construct a new RedoNode. + * @type Location + */ + operatorLoc; + /** + * @type Location + */ + keywordLoc; + /** + * Construct a new NoKeywordsParameterNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {Location} operatorLoc + * @param {Location} keywordLoc */ - constructor(nodeID, location, flags) { + constructor(nodeID, location, flags, operatorLoc, keywordLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.operatorLoc = operatorLoc; + this.keywordLoc = keywordLoc; } /** * Accept a visitor for this node. @@ -15273,7 +24402,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitRedoNode(this); + visitor.visitNoKeywordsParameterNode(this); } /** * Returns all child nodes of the current node. @@ -15298,13 +24427,15 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "RedoNode", + type: "NoKeywordsParameterNode", location: this.location, - flags: this.#flags + flags: this.#flags, + operatorLoc: this.operatorLoc, + keywordLoc: this.keywordLoc }; } }; - var RegularExpressionNode = class { + var NumberedParametersNode = class { /** * @type number */ @@ -15318,128 +24449,91 @@ var HerbLinter = (() => { */ #flags; /** - * @type Location - */ - openingLoc; - /** - * @type Location - */ - contentLoc; - /** - * @type Location - */ - closingLoc; - /** - * @type RubyString + * @type number */ - unescaped; + maximum; /** - * Construct a new RegularExpressionNode. + * Construct a new NumberedParametersNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} openingLoc - * @param {Location} contentLoc - * @param {Location} closingLoc - * @param {RubyString} unescaped + * @param {number} maximum */ - constructor(nodeID, location, flags, openingLoc, contentLoc, closingLoc, unescaped) { + constructor(nodeID, location, flags, maximum) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.openingLoc = openingLoc; - this.contentLoc = contentLoc; - this.closingLoc = closingLoc; - this.unescaped = unescaped; - } - /** - * True if this node has the IGNORE_CASE flag. - * - * @returns {boolean} - */ - isIgnoreCase() { - return (this.#flags & RegularExpressionFlags.IGNORE_CASE) !== 0; - } - /** - * True if this node has the EXTENDED flag. - * - * @returns {boolean} - */ - isExtended() { - return (this.#flags & RegularExpressionFlags.EXTENDED) !== 0; + this.maximum = maximum; } /** - * True if this node has the MULTI_LINE flag. + * Accept a visitor for this node. * - * @returns {boolean} + * @param {visitors.Visitor} visitor */ - isMultiLine() { - return (this.#flags & RegularExpressionFlags.MULTI_LINE) !== 0; + accept(visitor) { + visitor.visitNumberedParametersNode(this); } /** - * True if this node has the ONCE flag. + * Returns all child nodes of the current node. * - * @returns {boolean} + * @returns {(Node | null)[]} An array of child nodes. */ - isOnce() { - return (this.#flags & RegularExpressionFlags.ONCE) !== 0; + childNodes() { + return []; } /** - * True if this node has the EUC_JP flag. + * Compact and return an array of child nodes. * - * @returns {boolean} + * @returns {Node[]} An array of compacted child nodes. */ - isEucJp() { - return (this.#flags & RegularExpressionFlags.EUC_JP) !== 0; + compactChildNodes() { + return []; } /** - * True if this node has the ASCII_8BIT flag. + * Transforms the Node to a JavaScript object. * - * @returns {boolean} + * @returns {Object} */ - isAscii8bit() { - return (this.#flags & RegularExpressionFlags.ASCII_8BIT) !== 0; + toJSON() { + return { + type: "NumberedParametersNode", + location: this.location, + flags: this.#flags, + maximum: this.maximum + }; } + }; + var NumberedReferenceReadNode = class { /** - * True if this node has the WINDOWS_31J flag. - * - * @returns {boolean} + * @type number */ - isWindows31j() { - return (this.#flags & RegularExpressionFlags.WINDOWS_31J) !== 0; - } + nodeID; /** - * True if this node has the UTF_8 flag. - * - * @returns {boolean} + * @type {Location} */ - isUtf8() { - return (this.#flags & RegularExpressionFlags.UTF_8) !== 0; - } + location; /** - * True if this node has the FORCED_UTF8_ENCODING flag. - * - * @returns {boolean} + * @type number */ - isForcedUtf8Encoding() { - return (this.#flags & RegularExpressionFlags.FORCED_UTF8_ENCODING) !== 0; - } + #flags; /** - * True if this node has the FORCED_BINARY_ENCODING flag. - * - * @returns {boolean} + * @type number */ - isForcedBinaryEncoding() { - return (this.#flags & RegularExpressionFlags.FORCED_BINARY_ENCODING) !== 0; - } + number; /** - * True if this node has the FORCED_US_ASCII_ENCODING flag. + * Construct a new NumberedReferenceReadNode. * - * @returns {boolean} + * @param {number} nodeID + * @param {Location} location + * @param {number} flags + * @param {number} number */ - isForcedUsAsciiEncoding() { - return (this.#flags & RegularExpressionFlags.FORCED_US_ASCII_ENCODING) !== 0; + constructor(nodeID, location, flags, number2) { + this.nodeID = nodeID; + this.location = location; + this.#flags = flags; + this.number = number2; } /** * Accept a visitor for this node. @@ -15447,7 +24541,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitRegularExpressionNode(this); + visitor.visitNumberedReferenceReadNode(this); } /** * Returns all child nodes of the current node. @@ -15472,17 +24566,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "RegularExpressionNode", + type: "NumberedReferenceReadNode", location: this.location, flags: this.#flags, - openingLoc: this.openingLoc, - contentLoc: this.contentLoc, - closingLoc: this.closingLoc, - unescaped: this.unescaped + number: this.number }; } }; - var RequiredKeywordParameterNode = class { + var OptionalKeywordParameterNode = class { /** * @type number */ @@ -15504,20 +24595,26 @@ var HerbLinter = (() => { */ nameLoc; /** - * Construct a new RequiredKeywordParameterNode. + * @type Node + */ + value; + /** + * Construct a new OptionalKeywordParameterNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags * @param {string} name * @param {Location} nameLoc + * @param {Node} value */ - constructor(nodeID, location, flags, name2, nameLoc) { + constructor(nodeID, location, flags, name2, nameLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; this.name = name2; this.nameLoc = nameLoc; + this.value = value; } /** * True if this node has the REPEATED_PARAMETER flag. @@ -15533,7 +24630,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitRequiredKeywordParameterNode(this); + visitor.visitOptionalKeywordParameterNode(this); } /** * Returns all child nodes of the current node. @@ -15541,7 +24638,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -15549,7 +24646,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -15558,15 +24655,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "RequiredKeywordParameterNode", + type: "OptionalKeywordParameterNode", location: this.location, flags: this.#flags, name: this.name, - nameLoc: this.nameLoc + nameLoc: this.nameLoc, + value: this.value }; } }; - var RequiredParameterNode = class { + var OptionalParameterNode = class { /** * @type number */ @@ -15584,18 +24682,36 @@ var HerbLinter = (() => { */ name; /** - * Construct a new RequiredParameterNode. + * @type Location + */ + nameLoc; + /** + * @type Location + */ + operatorLoc; + /** + * @type Node + */ + value; + /** + * Construct a new OptionalParameterNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags * @param {string} name + * @param {Location} nameLoc + * @param {Location} operatorLoc + * @param {Node} value */ - constructor(nodeID, location, flags, name2) { + constructor(nodeID, location, flags, name2, nameLoc, operatorLoc, value) { this.nodeID = nodeID; this.location = location; this.#flags = flags; this.name = name2; + this.nameLoc = nameLoc; + this.operatorLoc = operatorLoc; + this.value = value; } /** * True if this node has the REPEATED_PARAMETER flag. @@ -15611,7 +24727,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitRequiredParameterNode(this); + visitor.visitOptionalParameterNode(this); } /** * Returns all child nodes of the current node. @@ -15619,7 +24735,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.value]; } /** * Compact and return an array of child nodes. @@ -15627,7 +24743,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + return [this.value]; } /** * Transforms the Node to a JavaScript object. @@ -15636,14 +24752,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "RequiredParameterNode", + type: "OptionalParameterNode", location: this.location, flags: this.#flags, - name: this.name + name: this.name, + nameLoc: this.nameLoc, + operatorLoc: this.operatorLoc, + value: this.value }; } }; - var RescueModifierNode = class { + var OrNode = class { /** * @type number */ @@ -15659,32 +24778,32 @@ var HerbLinter = (() => { /** * @type Node */ - expression; + left; /** - * @type Location + * @type Node */ - keywordLoc; + right; /** - * @type Node + * @type Location */ - rescueExpression; + operatorLoc; /** - * Construct a new RescueModifierNode. + * Construct a new OrNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node} expression - * @param {Location} keywordLoc - * @param {Node} rescueExpression + * @param {Node} left + * @param {Node} right + * @param {Location} operatorLoc */ - constructor(nodeID, location, flags, expression, keywordLoc, rescueExpression) { + constructor(nodeID, location, flags, left, right, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.expression = expression; - this.keywordLoc = keywordLoc; - this.rescueExpression = rescueExpression; + this.left = left; + this.right = right; + this.operatorLoc = operatorLoc; } /** * Accept a visitor for this node. @@ -15692,7 +24811,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitRescueModifierNode(this); + visitor.visitOrNode(this); } /** * Returns all child nodes of the current node. @@ -15700,7 +24819,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.expression, this.rescueExpression]; + return [this.left, this.right]; } /** * Compact and return an array of child nodes. @@ -15708,7 +24827,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.expression, this.rescueExpression]; + return [this.left, this.right]; } /** * Transforms the Node to a JavaScript object. @@ -15717,16 +24836,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "RescueModifierNode", + type: "OrNode", location: this.location, flags: this.#flags, - expression: this.expression, - keywordLoc: this.keywordLoc, - rescueExpression: this.rescueExpression + left: this.left, + right: this.right, + operatorLoc: this.operatorLoc }; } }; - var RescueNode = class { + var ParametersNode = class { /** * @type number */ @@ -15740,58 +24859,58 @@ var HerbLinter = (() => { */ #flags; /** - * @type Location + * @type Node[] */ - keywordLoc; + requireds; /** * @type Node[] */ - exceptions; + optionals; /** - * @type Location | null + * @type Node | null */ - operatorLoc; + rest; /** - * @type Node | null + * @type Node[] */ - reference; + posts; /** - * @type Location | null + * @type Node[] */ - thenKeywordLoc; + keywords; /** - * @type StatementsNode | null + * @type Node | null */ - statements; + keywordRest; /** - * @type RescueNode | null + * @type BlockParameterNode | null */ - subsequent; + block; /** - * Construct a new RescueNode. + * Construct a new ParametersNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} keywordLoc - * @param {Node[]} exceptions - * @param {Location | null} operatorLoc - * @param {Node | null} reference - * @param {Location | null} thenKeywordLoc - * @param {StatementsNode | null} statements - * @param {RescueNode | null} subsequent + * @param {Node[]} requireds + * @param {Node[]} optionals + * @param {Node | null} rest + * @param {Node[]} posts + * @param {Node[]} keywords + * @param {Node | null} keywordRest + * @param {BlockParameterNode | null} block */ - constructor(nodeID, location, flags, keywordLoc, exceptions, operatorLoc, reference, thenKeywordLoc, statements, subsequent) { + constructor(nodeID, location, flags, requireds, optionals, rest, posts, keywords, keywordRest, block) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.keywordLoc = keywordLoc; - this.exceptions = exceptions; - this.operatorLoc = operatorLoc; - this.reference = reference; - this.thenKeywordLoc = thenKeywordLoc; - this.statements = statements; - this.subsequent = subsequent; + this.requireds = requireds; + this.optionals = optionals; + this.rest = rest; + this.posts = posts; + this.keywords = keywords; + this.keywordRest = keywordRest; + this.block = block; } /** * Accept a visitor for this node. @@ -15799,7 +24918,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitRescueNode(this); + visitor.visitParametersNode(this); } /** * Returns all child nodes of the current node. @@ -15807,7 +24926,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [...this.exceptions, this.reference, this.statements, this.subsequent]; + return [...this.requireds, ...this.optionals, this.rest, ...this.posts, ...this.keywords, this.keywordRest, this.block]; } /** * Compact and return an array of child nodes. @@ -15816,15 +24935,18 @@ var HerbLinter = (() => { */ compactChildNodes() { const compact = []; - compact.concat(this.exceptions); - if (this.reference) { - compact.push(this.reference); + compact.concat(this.requireds); + compact.concat(this.optionals); + if (this.rest) { + compact.push(this.rest); } - if (this.statements) { - compact.push(this.statements); + compact.concat(this.posts); + compact.concat(this.keywords); + if (this.keywordRest) { + compact.push(this.keywordRest); } - if (this.subsequent) { - compact.push(this.subsequent); + if (this.block) { + compact.push(this.block); } return compact; } @@ -15835,20 +24957,20 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "RescueNode", + type: "ParametersNode", location: this.location, flags: this.#flags, - keywordLoc: this.keywordLoc, - exceptions: this.exceptions, - operatorLoc: this.operatorLoc, - reference: this.reference, - thenKeywordLoc: this.thenKeywordLoc, - statements: this.statements, - subsequent: this.subsequent + requireds: this.requireds, + optionals: this.optionals, + rest: this.rest, + posts: this.posts, + keywords: this.keywords, + keywordRest: this.keywordRest, + block: this.block }; } }; - var RestParameterNode = class { + var ParenthesesNode = class { /** * @type number */ @@ -15862,42 +24984,42 @@ var HerbLinter = (() => { */ #flags; /** - * @type string | null + * @type Node | null */ - name; + body; /** - * @type Location | null + * @type Location */ - nameLoc; + openingLoc; /** * @type Location */ - operatorLoc; + closingLoc; /** - * Construct a new RestParameterNode. + * Construct a new ParenthesesNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {string | null} name - * @param {Location | null} nameLoc - * @param {Location} operatorLoc + * @param {Node | null} body + * @param {Location} openingLoc + * @param {Location} closingLoc */ - constructor(nodeID, location, flags, name2, nameLoc, operatorLoc) { + constructor(nodeID, location, flags, body, openingLoc, closingLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.name = name2; - this.nameLoc = nameLoc; - this.operatorLoc = operatorLoc; + this.body = body; + this.openingLoc = openingLoc; + this.closingLoc = closingLoc; } /** - * True if this node has the REPEATED_PARAMETER flag. + * True if this node has the MULTIPLE_STATEMENTS flag. * * @returns {boolean} */ - isRepeatedParameter() { - return (this.#flags & ParameterFlags.REPEATED_PARAMETER) !== 0; + isMultipleStatements() { + return (this.#flags & ParenthesesNodeFlags.MULTIPLE_STATEMENTS) !== 0; } /** * Accept a visitor for this node. @@ -15905,7 +25027,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitRestParameterNode(this); + visitor.visitParenthesesNode(this); } /** * Returns all child nodes of the current node. @@ -15913,7 +25035,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.body]; } /** * Compact and return an array of child nodes. @@ -15921,7 +25043,11 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + const compact = []; + if (this.body) { + compact.push(this.body); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -15930,16 +25056,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "RestParameterNode", + type: "ParenthesesNode", location: this.location, flags: this.#flags, - name: this.name, - nameLoc: this.nameLoc, - operatorLoc: this.operatorLoc + body: this.body, + openingLoc: this.openingLoc, + closingLoc: this.closingLoc }; } }; - var RetryNode = class { + var PinnedExpressionNode = class { /** * @type number */ @@ -15953,16 +25079,40 @@ var HerbLinter = (() => { */ #flags; /** - * Construct a new RetryNode. + * @type Node + */ + expression; + /** + * @type Location + */ + operatorLoc; + /** + * @type Location + */ + lparenLoc; + /** + * @type Location + */ + rparenLoc; + /** + * Construct a new PinnedExpressionNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {Node} expression + * @param {Location} operatorLoc + * @param {Location} lparenLoc + * @param {Location} rparenLoc */ - constructor(nodeID, location, flags) { + constructor(nodeID, location, flags, expression, operatorLoc, lparenLoc, rparenLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.expression = expression; + this.operatorLoc = operatorLoc; + this.lparenLoc = lparenLoc; + this.rparenLoc = rparenLoc; } /** * Accept a visitor for this node. @@ -15970,7 +25120,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitRetryNode(this); + visitor.visitPinnedExpressionNode(this); } /** * Returns all child nodes of the current node. @@ -15978,7 +25128,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.expression]; } /** * Compact and return an array of child nodes. @@ -15986,7 +25136,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + return [this.expression]; } /** * Transforms the Node to a JavaScript object. @@ -15995,13 +25145,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "RetryNode", + type: "PinnedExpressionNode", location: this.location, - flags: this.#flags + flags: this.#flags, + expression: this.expression, + operatorLoc: this.operatorLoc, + lparenLoc: this.lparenLoc, + rparenLoc: this.rparenLoc }; } }; - var ReturnNode = class { + var PinnedVariableNode = class { /** * @type number */ @@ -16015,28 +25169,28 @@ var HerbLinter = (() => { */ #flags; /** - * @type Location + * @type Node */ - keywordLoc; + variable; /** - * @type ArgumentsNode | null + * @type Location */ - arguments_; + operatorLoc; /** - * Construct a new ReturnNode. + * Construct a new PinnedVariableNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} keywordLoc - * @param {ArgumentsNode | null} arguments_ + * @param {Node} variable + * @param {Location} operatorLoc */ - constructor(nodeID, location, flags, keywordLoc, arguments_) { + constructor(nodeID, location, flags, variable, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.keywordLoc = keywordLoc; - this.arguments_ = arguments_; + this.variable = variable; + this.operatorLoc = operatorLoc; } /** * Accept a visitor for this node. @@ -16044,7 +25198,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitReturnNode(this); + visitor.visitPinnedVariableNode(this); } /** * Returns all child nodes of the current node. @@ -16052,7 +25206,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.arguments_]; + return [this.variable]; } /** * Compact and return an array of child nodes. @@ -16060,11 +25214,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.arguments_) { - compact.push(this.arguments_); - } - return compact; + return [this.variable]; } /** * Transforms the Node to a JavaScript object. @@ -16073,15 +25223,15 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ReturnNode", + type: "PinnedVariableNode", location: this.location, flags: this.#flags, - keywordLoc: this.keywordLoc, - arguments: this.arguments_ + variable: this.variable, + operatorLoc: this.operatorLoc }; } }; - var SelfNode = class { + var PostExecutionNode = class { /** * @type number */ @@ -16095,16 +25245,40 @@ var HerbLinter = (() => { */ #flags; /** - * Construct a new SelfNode. + * @type StatementsNode | null + */ + statements; + /** + * @type Location + */ + keywordLoc; + /** + * @type Location + */ + openingLoc; + /** + * @type Location + */ + closingLoc; + /** + * Construct a new PostExecutionNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {StatementsNode | null} statements + * @param {Location} keywordLoc + * @param {Location} openingLoc + * @param {Location} closingLoc */ - constructor(nodeID, location, flags) { + constructor(nodeID, location, flags, statements, keywordLoc, openingLoc, closingLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.statements = statements; + this.keywordLoc = keywordLoc; + this.openingLoc = openingLoc; + this.closingLoc = closingLoc; } /** * Accept a visitor for this node. @@ -16112,7 +25286,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitSelfNode(this); + visitor.visitPostExecutionNode(this); } /** * Returns all child nodes of the current node. @@ -16120,7 +25294,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.statements]; } /** * Compact and return an array of child nodes. @@ -16128,7 +25302,11 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + const compact = []; + if (this.statements) { + compact.push(this.statements); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -16137,13 +25315,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "SelfNode", + type: "PostExecutionNode", location: this.location, - flags: this.#flags + flags: this.#flags, + statements: this.statements, + keywordLoc: this.keywordLoc, + openingLoc: this.openingLoc, + closingLoc: this.closingLoc }; } }; - var ShareableConstantNode = class { + var PreExecutionNode = class { /** * @type number */ @@ -16157,46 +25339,40 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node + * @type StatementsNode | null */ - write; + statements; /** - * Construct a new ShareableConstantNode. - * - * @param {number} nodeID - * @param {Location} location - * @param {number} flags - * @param {Node} write + * @type Location */ - constructor(nodeID, location, flags, write) { - this.nodeID = nodeID; - this.location = location; - this.#flags = flags; - this.write = write; - } + keywordLoc; /** - * True if this node has the LITERAL flag. - * - * @returns {boolean} + * @type Location */ - isLiteral() { - return (this.#flags & ShareableConstantNodeFlags.LITERAL) !== 0; - } + openingLoc; /** - * True if this node has the EXPERIMENTAL_EVERYTHING flag. - * - * @returns {boolean} + * @type Location */ - isExperimentalEverything() { - return (this.#flags & ShareableConstantNodeFlags.EXPERIMENTAL_EVERYTHING) !== 0; - } + closingLoc; /** - * True if this node has the EXPERIMENTAL_COPY flag. + * Construct a new PreExecutionNode. * - * @returns {boolean} + * @param {number} nodeID + * @param {Location} location + * @param {number} flags + * @param {StatementsNode | null} statements + * @param {Location} keywordLoc + * @param {Location} openingLoc + * @param {Location} closingLoc */ - isExperimentalCopy() { - return (this.#flags & ShareableConstantNodeFlags.EXPERIMENTAL_COPY) !== 0; + constructor(nodeID, location, flags, statements, keywordLoc, openingLoc, closingLoc) { + this.nodeID = nodeID; + this.location = location; + this.#flags = flags; + this.statements = statements; + this.keywordLoc = keywordLoc; + this.openingLoc = openingLoc; + this.closingLoc = closingLoc; } /** * Accept a visitor for this node. @@ -16204,7 +25380,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitShareableConstantNode(this); + visitor.visitPreExecutionNode(this); } /** * Returns all child nodes of the current node. @@ -16212,7 +25388,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.write]; + return [this.statements]; } /** * Compact and return an array of child nodes. @@ -16220,7 +25396,11 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [this.write]; + const compact = []; + if (this.statements) { + compact.push(this.statements); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -16229,14 +25409,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "ShareableConstantNode", + type: "PreExecutionNode", location: this.location, flags: this.#flags, - write: this.write + statements: this.statements, + keywordLoc: this.keywordLoc, + openingLoc: this.openingLoc, + closingLoc: this.closingLoc }; } }; - var SingletonClassNode = class { + var ProgramNode = class { /** * @type number */ @@ -16254,48 +25437,24 @@ var HerbLinter = (() => { */ locals; /** - * @type Location - */ - classKeywordLoc; - /** - * @type Location - */ - operatorLoc; - /** - * @type Node - */ - expression; - /** - * @type Node | null - */ - body; - /** - * @type Location + * @type StatementsNode */ - endKeywordLoc; + statements; /** - * Construct a new SingletonClassNode. + * Construct a new ProgramNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags * @param {string[]} locals - * @param {Location} classKeywordLoc - * @param {Location} operatorLoc - * @param {Node} expression - * @param {Node | null} body - * @param {Location} endKeywordLoc + * @param {StatementsNode} statements */ - constructor(nodeID, location, flags, locals, classKeywordLoc, operatorLoc, expression, body, endKeywordLoc) { + constructor(nodeID, location, flags, locals, statements) { this.nodeID = nodeID; this.location = location; this.#flags = flags; this.locals = locals; - this.classKeywordLoc = classKeywordLoc; - this.operatorLoc = operatorLoc; - this.expression = expression; - this.body = body; - this.endKeywordLoc = endKeywordLoc; + this.statements = statements; } /** * Accept a visitor for this node. @@ -16303,7 +25462,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitSingletonClassNode(this); + visitor.visitProgramNode(this); } /** * Returns all child nodes of the current node. @@ -16311,7 +25470,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.expression, this.body]; + return [this.statements]; } /** * Compact and return an array of child nodes. @@ -16319,12 +25478,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - compact.push(this.expression); - if (this.body) { - compact.push(this.body); - } - return compact; + return [this.statements]; } /** * Transforms the Node to a JavaScript object. @@ -16333,19 +25487,15 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "SingletonClassNode", + type: "ProgramNode", location: this.location, flags: this.#flags, locals: this.locals, - classKeywordLoc: this.classKeywordLoc, - operatorLoc: this.operatorLoc, - expression: this.expression, - body: this.body, - endKeywordLoc: this.endKeywordLoc + statements: this.statements }; } }; - var SourceEncodingNode = class { + var RangeNode = class { /** * @type number */ @@ -16359,16 +25509,42 @@ var HerbLinter = (() => { */ #flags; /** - * Construct a new SourceEncodingNode. + * @type Node | null + */ + left; + /** + * @type Node | null + */ + right; + /** + * @type Location + */ + operatorLoc; + /** + * Construct a new RangeNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {Node | null} left + * @param {Node | null} right + * @param {Location} operatorLoc */ - constructor(nodeID, location, flags) { + constructor(nodeID, location, flags, left, right, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.left = left; + this.right = right; + this.operatorLoc = operatorLoc; + } + /** + * True if this node has the EXCLUDE_END flag. + * + * @returns {boolean} + */ + isExcludeEnd() { + return (this.#flags & RangeFlags.EXCLUDE_END) !== 0; } /** * Accept a visitor for this node. @@ -16376,7 +25552,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitSourceEncodingNode(this); + visitor.visitRangeNode(this); } /** * Returns all child nodes of the current node. @@ -16384,7 +25560,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [this.left, this.right]; } /** * Compact and return an array of child nodes. @@ -16392,7 +25568,14 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + const compact = []; + if (this.left) { + compact.push(this.left); + } + if (this.right) { + compact.push(this.right); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -16401,13 +25584,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "SourceEncodingNode", + type: "RangeNode", location: this.location, - flags: this.#flags + flags: this.#flags, + left: this.left, + right: this.right, + operatorLoc: this.operatorLoc }; } }; - var SourceFileNode = class { + var RationalNode = class { /** * @type number */ @@ -16421,54 +25607,60 @@ var HerbLinter = (() => { */ #flags; /** - * @type RubyString + * @type number */ - filepath; + numerator; /** - * Construct a new SourceFileNode. + * @type number + */ + denominator; + /** + * Construct a new RationalNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {RubyString} filepath + * @param {number} numerator + * @param {number} denominator */ - constructor(nodeID, location, flags, filepath) { + constructor(nodeID, location, flags, numerator, denominator) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.filepath = filepath; + this.numerator = numerator; + this.denominator = denominator; } /** - * True if this node has the FORCED_UTF8_ENCODING flag. + * True if this node has the BINARY flag. * * @returns {boolean} */ - isForcedUtf8Encoding() { - return (this.#flags & StringFlags.FORCED_UTF8_ENCODING) !== 0; + isBinary() { + return (this.#flags & IntegerBaseFlags.BINARY) !== 0; } /** - * True if this node has the FORCED_BINARY_ENCODING flag. + * True if this node has the DECIMAL flag. * * @returns {boolean} */ - isForcedBinaryEncoding() { - return (this.#flags & StringFlags.FORCED_BINARY_ENCODING) !== 0; + isDecimal() { + return (this.#flags & IntegerBaseFlags.DECIMAL) !== 0; } /** - * True if this node has the FROZEN flag. + * True if this node has the OCTAL flag. * * @returns {boolean} */ - isFrozen() { - return (this.#flags & StringFlags.FROZEN) !== 0; + isOctal() { + return (this.#flags & IntegerBaseFlags.OCTAL) !== 0; } /** - * True if this node has the MUTABLE flag. + * True if this node has the HEXADECIMAL flag. * * @returns {boolean} */ - isMutable() { - return (this.#flags & StringFlags.MUTABLE) !== 0; + isHexadecimal() { + return (this.#flags & IntegerBaseFlags.HEXADECIMAL) !== 0; } /** * Accept a visitor for this node. @@ -16476,7 +25668,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitSourceFileNode(this); + visitor.visitRationalNode(this); } /** * Returns all child nodes of the current node. @@ -16501,14 +25693,15 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "SourceFileNode", + type: "RationalNode", location: this.location, flags: this.#flags, - filepath: this.filepath + numerator: this.numerator, + denominator: this.denominator }; } }; - var SourceLineNode = class { + var RedoNode = class { /** * @type number */ @@ -16522,7 +25715,7 @@ var HerbLinter = (() => { */ #flags; /** - * Construct a new SourceLineNode. + * Construct a new RedoNode. * * @param {number} nodeID * @param {Location} location @@ -16539,7 +25732,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitSourceLineNode(this); + visitor.visitRedoNode(this); } /** * Returns all child nodes of the current node. @@ -16564,13 +25757,13 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "SourceLineNode", + type: "RedoNode", location: this.location, flags: this.#flags }; } }; - var SplatNode = class { + var RegularExpressionNode = class { /** * @type number */ @@ -16586,42 +25779,142 @@ var HerbLinter = (() => { /** * @type Location */ - operatorLoc; + openingLoc; /** - * @type Node | null + * @type Location */ - expression; + contentLoc; /** - * Construct a new SplatNode. + * @type Location + */ + closingLoc; + /** + * @type RubyString + */ + unescaped; + /** + * Construct a new RegularExpressionNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} operatorLoc - * @param {Node | null} expression + * @param {Location} openingLoc + * @param {Location} contentLoc + * @param {Location} closingLoc + * @param {RubyString} unescaped */ - constructor(nodeID, location, flags, operatorLoc, expression) { + constructor(nodeID, location, flags, openingLoc, contentLoc, closingLoc, unescaped) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.operatorLoc = operatorLoc; - this.expression = expression; + this.openingLoc = openingLoc; + this.contentLoc = contentLoc; + this.closingLoc = closingLoc; + this.unescaped = unescaped; } /** - * Accept a visitor for this node. + * True if this node has the IGNORE_CASE flag. * - * @param {visitors.Visitor} visitor + * @returns {boolean} */ - accept(visitor) { - visitor.visitSplatNode(this); + isIgnoreCase() { + return (this.#flags & RegularExpressionFlags.IGNORE_CASE) !== 0; } /** - * Returns all child nodes of the current node. + * True if this node has the EXTENDED flag. * - * @returns {(Node | null)[]} An array of child nodes. + * @returns {boolean} */ - childNodes() { - return [this.expression]; + isExtended() { + return (this.#flags & RegularExpressionFlags.EXTENDED) !== 0; + } + /** + * True if this node has the MULTI_LINE flag. + * + * @returns {boolean} + */ + isMultiLine() { + return (this.#flags & RegularExpressionFlags.MULTI_LINE) !== 0; + } + /** + * True if this node has the ONCE flag. + * + * @returns {boolean} + */ + isOnce() { + return (this.#flags & RegularExpressionFlags.ONCE) !== 0; + } + /** + * True if this node has the EUC_JP flag. + * + * @returns {boolean} + */ + isEucJp() { + return (this.#flags & RegularExpressionFlags.EUC_JP) !== 0; + } + /** + * True if this node has the ASCII_8BIT flag. + * + * @returns {boolean} + */ + isAscii8bit() { + return (this.#flags & RegularExpressionFlags.ASCII_8BIT) !== 0; + } + /** + * True if this node has the WINDOWS_31J flag. + * + * @returns {boolean} + */ + isWindows31j() { + return (this.#flags & RegularExpressionFlags.WINDOWS_31J) !== 0; + } + /** + * True if this node has the UTF_8 flag. + * + * @returns {boolean} + */ + isUtf8() { + return (this.#flags & RegularExpressionFlags.UTF_8) !== 0; + } + /** + * True if this node has the FORCED_UTF8_ENCODING flag. + * + * @returns {boolean} + */ + isForcedUtf8Encoding() { + return (this.#flags & RegularExpressionFlags.FORCED_UTF8_ENCODING) !== 0; + } + /** + * True if this node has the FORCED_BINARY_ENCODING flag. + * + * @returns {boolean} + */ + isForcedBinaryEncoding() { + return (this.#flags & RegularExpressionFlags.FORCED_BINARY_ENCODING) !== 0; + } + /** + * True if this node has the FORCED_US_ASCII_ENCODING flag. + * + * @returns {boolean} + */ + isForcedUsAsciiEncoding() { + return (this.#flags & RegularExpressionFlags.FORCED_US_ASCII_ENCODING) !== 0; + } + /** + * Accept a visitor for this node. + * + * @param {visitors.Visitor} visitor + */ + accept(visitor) { + visitor.visitRegularExpressionNode(this); + } + /** + * Returns all child nodes of the current node. + * + * @returns {(Node | null)[]} An array of child nodes. + */ + childNodes() { + return []; } /** * Compact and return an array of child nodes. @@ -16629,11 +25922,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.expression) { - compact.push(this.expression); - } - return compact; + return []; } /** * Transforms the Node to a JavaScript object. @@ -16642,15 +25931,17 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "SplatNode", + type: "RegularExpressionNode", location: this.location, flags: this.#flags, - operatorLoc: this.operatorLoc, - expression: this.expression + openingLoc: this.openingLoc, + contentLoc: this.contentLoc, + closingLoc: this.closingLoc, + unescaped: this.unescaped }; } }; - var StatementsNode = class { + var RequiredKeywordParameterNode = class { /** * @type number */ @@ -16664,22 +25955,36 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node[] + * @type string */ - body; + name; /** - * Construct a new StatementsNode. + * @type Location + */ + nameLoc; + /** + * Construct a new RequiredKeywordParameterNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node[]} body + * @param {string} name + * @param {Location} nameLoc */ - constructor(nodeID, location, flags, body) { + constructor(nodeID, location, flags, name2, nameLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.body = body; + this.name = name2; + this.nameLoc = nameLoc; + } + /** + * True if this node has the REPEATED_PARAMETER flag. + * + * @returns {boolean} + */ + isRepeatedParameter() { + return (this.#flags & ParameterFlags.REPEATED_PARAMETER) !== 0; } /** * Accept a visitor for this node. @@ -16687,7 +25992,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitStatementsNode(this); + visitor.visitRequiredKeywordParameterNode(this); } /** * Returns all child nodes of the current node. @@ -16695,7 +26000,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [...this.body]; + return []; } /** * Compact and return an array of child nodes. @@ -16703,7 +26008,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [...this.body]; + return []; } /** * Transforms the Node to a JavaScript object. @@ -16712,14 +26017,15 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "StatementsNode", + type: "RequiredKeywordParameterNode", location: this.location, flags: this.#flags, - body: this.body + name: this.name, + nameLoc: this.nameLoc }; } }; - var StringNode = class { + var RequiredParameterNode = class { /** * @type number */ @@ -16733,72 +26039,30 @@ var HerbLinter = (() => { */ #flags; /** - * @type Location | null - */ - openingLoc; - /** - * @type Location - */ - contentLoc; - /** - * @type Location | null - */ - closingLoc; - /** - * @type RubyString + * @type string */ - unescaped; + name; /** - * Construct a new StringNode. + * Construct a new RequiredParameterNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location | null} openingLoc - * @param {Location} contentLoc - * @param {Location | null} closingLoc - * @param {RubyString} unescaped + * @param {string} name */ - constructor(nodeID, location, flags, openingLoc, contentLoc, closingLoc, unescaped) { + constructor(nodeID, location, flags, name2) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.openingLoc = openingLoc; - this.contentLoc = contentLoc; - this.closingLoc = closingLoc; - this.unescaped = unescaped; - } - /** - * True if this node has the FORCED_UTF8_ENCODING flag. - * - * @returns {boolean} - */ - isForcedUtf8Encoding() { - return (this.#flags & StringFlags.FORCED_UTF8_ENCODING) !== 0; - } - /** - * True if this node has the FORCED_BINARY_ENCODING flag. - * - * @returns {boolean} - */ - isForcedBinaryEncoding() { - return (this.#flags & StringFlags.FORCED_BINARY_ENCODING) !== 0; - } - /** - * True if this node has the FROZEN flag. - * - * @returns {boolean} - */ - isFrozen() { - return (this.#flags & StringFlags.FROZEN) !== 0; + this.name = name2; } /** - * True if this node has the MUTABLE flag. + * True if this node has the REPEATED_PARAMETER flag. * * @returns {boolean} */ - isMutable() { - return (this.#flags & StringFlags.MUTABLE) !== 0; + isRepeatedParameter() { + return (this.#flags & ParameterFlags.REPEATED_PARAMETER) !== 0; } /** * Accept a visitor for this node. @@ -16806,7 +26070,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitStringNode(this); + visitor.visitRequiredParameterNode(this); } /** * Returns all child nodes of the current node. @@ -16831,17 +26095,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "StringNode", + type: "RequiredParameterNode", location: this.location, flags: this.#flags, - openingLoc: this.openingLoc, - contentLoc: this.contentLoc, - closingLoc: this.closingLoc, - unescaped: this.unescaped + name: this.name }; } }; - var SuperNode = class { + var RescueModifierNode = class { /** * @type number */ @@ -16855,46 +26116,34 @@ var HerbLinter = (() => { */ #flags; /** - * @type Location - */ - keywordLoc; - /** - * @type Location | null - */ - lparenLoc; - /** - * @type ArgumentsNode | null + * @type Node */ - arguments_; + expression; /** - * @type Location | null + * @type Location */ - rparenLoc; + keywordLoc; /** - * @type Node | null + * @type Node */ - block; + rescueExpression; /** - * Construct a new SuperNode. + * Construct a new RescueModifierNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {Node} expression * @param {Location} keywordLoc - * @param {Location | null} lparenLoc - * @param {ArgumentsNode | null} arguments_ - * @param {Location | null} rparenLoc - * @param {Node | null} block + * @param {Node} rescueExpression */ - constructor(nodeID, location, flags, keywordLoc, lparenLoc, arguments_, rparenLoc, block2) { + constructor(nodeID, location, flags, expression, keywordLoc, rescueExpression) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.expression = expression; this.keywordLoc = keywordLoc; - this.lparenLoc = lparenLoc; - this.arguments_ = arguments_; - this.rparenLoc = rparenLoc; - this.block = block2; + this.rescueExpression = rescueExpression; } /** * Accept a visitor for this node. @@ -16902,7 +26151,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitSuperNode(this); + visitor.visitRescueModifierNode(this); } /** * Returns all child nodes of the current node. @@ -16910,7 +26159,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.arguments_, this.block]; + return [this.expression, this.rescueExpression]; } /** * Compact and return an array of child nodes. @@ -16918,14 +26167,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - if (this.arguments_) { - compact.push(this.arguments_); - } - if (this.block) { - compact.push(this.block); - } - return compact; + return [this.expression, this.rescueExpression]; } /** * Transforms the Node to a JavaScript object. @@ -16934,18 +26176,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "SuperNode", + type: "RescueModifierNode", location: this.location, flags: this.#flags, + expression: this.expression, keywordLoc: this.keywordLoc, - lparenLoc: this.lparenLoc, - arguments: this.arguments_, - rparenLoc: this.rparenLoc, - block: this.block + rescueExpression: this.rescueExpression }; } }; - var SymbolNode = class { + var RescueNode = class { /** * @type number */ @@ -16959,64 +26199,58 @@ var HerbLinter = (() => { */ #flags; /** - * @type Location | null + * @type Location */ - openingLoc; + keywordLoc; + /** + * @type Node[] + */ + exceptions; /** * @type Location | null */ - valueLoc; + operatorLoc; + /** + * @type Node | null + */ + reference; /** * @type Location | null */ - closingLoc; + thenKeywordLoc; /** - * @type RubyString + * @type StatementsNode | null */ - unescaped; + statements; /** - * Construct a new SymbolNode. + * @type RescueNode | null + */ + subsequent; + /** + * Construct a new RescueNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location | null} openingLoc - * @param {Location | null} valueLoc - * @param {Location | null} closingLoc - * @param {RubyString} unescaped + * @param {Location} keywordLoc + * @param {Node[]} exceptions + * @param {Location | null} operatorLoc + * @param {Node | null} reference + * @param {Location | null} thenKeywordLoc + * @param {StatementsNode | null} statements + * @param {RescueNode | null} subsequent */ - constructor(nodeID, location, flags, openingLoc, valueLoc, closingLoc, unescaped) { + constructor(nodeID, location, flags, keywordLoc, exceptions, operatorLoc, reference, thenKeywordLoc, statements, subsequent) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.openingLoc = openingLoc; - this.valueLoc = valueLoc; - this.closingLoc = closingLoc; - this.unescaped = unescaped; - } - /** - * True if this node has the FORCED_UTF8_ENCODING flag. - * - * @returns {boolean} - */ - isForcedUtf8Encoding() { - return (this.#flags & SymbolFlags.FORCED_UTF8_ENCODING) !== 0; - } - /** - * True if this node has the FORCED_BINARY_ENCODING flag. - * - * @returns {boolean} - */ - isForcedBinaryEncoding() { - return (this.#flags & SymbolFlags.FORCED_BINARY_ENCODING) !== 0; - } - /** - * True if this node has the FORCED_US_ASCII_ENCODING flag. - * - * @returns {boolean} - */ - isForcedUsAsciiEncoding() { - return (this.#flags & SymbolFlags.FORCED_US_ASCII_ENCODING) !== 0; + this.keywordLoc = keywordLoc; + this.exceptions = exceptions; + this.operatorLoc = operatorLoc; + this.reference = reference; + this.thenKeywordLoc = thenKeywordLoc; + this.statements = statements; + this.subsequent = subsequent; } /** * Accept a visitor for this node. @@ -17024,7 +26258,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitSymbolNode(this); + visitor.visitRescueNode(this); } /** * Returns all child nodes of the current node. @@ -17032,7 +26266,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return []; + return [...this.exceptions, this.reference, this.statements, this.subsequent]; } /** * Compact and return an array of child nodes. @@ -17040,7 +26274,18 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return []; + const compact = []; + compact.concat(this.exceptions); + if (this.reference) { + compact.push(this.reference); + } + if (this.statements) { + compact.push(this.statements); + } + if (this.subsequent) { + compact.push(this.subsequent); + } + return compact; } /** * Transforms the Node to a JavaScript object. @@ -17049,17 +26294,20 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "SymbolNode", + type: "RescueNode", location: this.location, flags: this.#flags, - openingLoc: this.openingLoc, - valueLoc: this.valueLoc, - closingLoc: this.closingLoc, - unescaped: this.unescaped + keywordLoc: this.keywordLoc, + exceptions: this.exceptions, + operatorLoc: this.operatorLoc, + reference: this.reference, + thenKeywordLoc: this.thenKeywordLoc, + statements: this.statements, + subsequent: this.subsequent }; } }; - var TrueNode = class { + var RestParameterNode = class { /** * @type number */ @@ -17073,16 +26321,42 @@ var HerbLinter = (() => { */ #flags; /** - * Construct a new TrueNode. + * @type string | null + */ + name; + /** + * @type Location | null + */ + nameLoc; + /** + * @type Location + */ + operatorLoc; + /** + * Construct a new RestParameterNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags + * @param {string | null} name + * @param {Location | null} nameLoc + * @param {Location} operatorLoc */ - constructor(nodeID, location, flags) { + constructor(nodeID, location, flags, name2, nameLoc, operatorLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; + this.name = name2; + this.nameLoc = nameLoc; + this.operatorLoc = operatorLoc; + } + /** + * True if this node has the REPEATED_PARAMETER flag. + * + * @returns {boolean} + */ + isRepeatedParameter() { + return (this.#flags & ParameterFlags.REPEATED_PARAMETER) !== 0; } /** * Accept a visitor for this node. @@ -17090,7 +26364,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitTrueNode(this); + visitor.visitRestParameterNode(this); } /** * Returns all child nodes of the current node. @@ -17115,13 +26389,16 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "TrueNode", + type: "RestParameterNode", location: this.location, - flags: this.#flags + flags: this.#flags, + name: this.name, + nameLoc: this.nameLoc, + operatorLoc: this.operatorLoc }; } }; - var UndefNode = class { + var RetryNode = class { /** * @type number */ @@ -17135,28 +26412,16 @@ var HerbLinter = (() => { */ #flags; /** - * @type Node[] - */ - names; - /** - * @type Location - */ - keywordLoc; - /** - * Construct a new UndefNode. + * Construct a new RetryNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Node[]} names - * @param {Location} keywordLoc */ - constructor(nodeID, location, flags, names, keywordLoc) { + constructor(nodeID, location, flags) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.names = names; - this.keywordLoc = keywordLoc; } /** * Accept a visitor for this node. @@ -17164,7 +26429,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitUndefNode(this); + visitor.visitRetryNode(this); } /** * Returns all child nodes of the current node. @@ -17172,7 +26437,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [...this.names]; + return []; } /** * Compact and return an array of child nodes. @@ -17180,7 +26445,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - return [...this.names]; + return []; } /** * Transforms the Node to a JavaScript object. @@ -17189,15 +26454,13 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "UndefNode", + type: "RetryNode", location: this.location, - flags: this.#flags, - names: this.names, - keywordLoc: this.keywordLoc + flags: this.#flags }; } }; - var UnlessNode = class { + var ReturnNode = class { /** * @type number */ @@ -17215,48 +26478,24 @@ var HerbLinter = (() => { */ keywordLoc; /** - * @type Node - */ - predicate; - /** - * @type Location | null - */ - thenKeywordLoc; - /** - * @type StatementsNode | null - */ - statements; - /** - * @type ElseNode | null - */ - elseClause; - /** - * @type Location | null + * @type ArgumentsNode | null */ - endKeywordLoc; + arguments_; /** - * Construct a new UnlessNode. + * Construct a new ReturnNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags * @param {Location} keywordLoc - * @param {Node} predicate - * @param {Location | null} thenKeywordLoc - * @param {StatementsNode | null} statements - * @param {ElseNode | null} elseClause - * @param {Location | null} endKeywordLoc + * @param {ArgumentsNode | null} arguments_ */ - constructor(nodeID, location, flags, keywordLoc, predicate, thenKeywordLoc, statements, elseClause, endKeywordLoc) { + constructor(nodeID, location, flags, keywordLoc, arguments_) { this.nodeID = nodeID; this.location = location; this.#flags = flags; this.keywordLoc = keywordLoc; - this.predicate = predicate; - this.thenKeywordLoc = thenKeywordLoc; - this.statements = statements; - this.elseClause = elseClause; - this.endKeywordLoc = endKeywordLoc; + this.arguments_ = arguments_; } /** * Accept a visitor for this node. @@ -17264,7 +26503,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitUnlessNode(this); + visitor.visitReturnNode(this); } /** * Returns all child nodes of the current node. @@ -17272,7 +26511,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.predicate, this.statements, this.elseClause]; + return [this.arguments_]; } /** * Compact and return an array of child nodes. @@ -17281,12 +26520,8 @@ var HerbLinter = (() => { */ compactChildNodes() { const compact = []; - compact.push(this.predicate); - if (this.statements) { - compact.push(this.statements); - } - if (this.elseClause) { - compact.push(this.elseClause); + if (this.arguments_) { + compact.push(this.arguments_); } return compact; } @@ -17297,19 +26532,15 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "UnlessNode", + type: "ReturnNode", location: this.location, flags: this.#flags, keywordLoc: this.keywordLoc, - predicate: this.predicate, - thenKeywordLoc: this.thenKeywordLoc, - statements: this.statements, - elseClause: this.elseClause, - endKeywordLoc: this.endKeywordLoc + arguments: this.arguments_ }; } }; - var UntilNode = class { + var SelfNode = class { /** * @type number */ @@ -17323,54 +26554,108 @@ var HerbLinter = (() => { */ #flags; /** - * @type Location - */ - keywordLoc; - /** - * @type Location | null + * Construct a new SelfNode. + * + * @param {number} nodeID + * @param {Location} location + * @param {number} flags */ - doKeywordLoc; + constructor(nodeID, location, flags) { + this.nodeID = nodeID; + this.location = location; + this.#flags = flags; + } /** - * @type Location | null + * Accept a visitor for this node. + * + * @param {visitors.Visitor} visitor */ - closingLoc; + accept(visitor) { + visitor.visitSelfNode(this); + } /** - * @type Node + * Returns all child nodes of the current node. + * + * @returns {(Node | null)[]} An array of child nodes. */ - predicate; + childNodes() { + return []; + } /** - * @type StatementsNode | null + * Compact and return an array of child nodes. + * + * @returns {Node[]} An array of compacted child nodes. */ - statements; + compactChildNodes() { + return []; + } /** - * Construct a new UntilNode. + * Transforms the Node to a JavaScript object. + * + * @returns {Object} + */ + toJSON() { + return { + type: "SelfNode", + location: this.location, + flags: this.#flags + }; + } + }; + var ShareableConstantNode = class { + /** + * @type number + */ + nodeID; + /** + * @type {Location} + */ + location; + /** + * @type number + */ + #flags; + /** + * @type Node + */ + write; + /** + * Construct a new ShareableConstantNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} keywordLoc - * @param {Location | null} doKeywordLoc - * @param {Location | null} closingLoc - * @param {Node} predicate - * @param {StatementsNode | null} statements + * @param {Node} write */ - constructor(nodeID, location, flags, keywordLoc, doKeywordLoc, closingLoc, predicate, statements) { + constructor(nodeID, location, flags, write) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.keywordLoc = keywordLoc; - this.doKeywordLoc = doKeywordLoc; - this.closingLoc = closingLoc; - this.predicate = predicate; - this.statements = statements; + this.write = write; } /** - * True if this node has the BEGIN_MODIFIER flag. + * True if this node has the LITERAL flag. * * @returns {boolean} */ - isBeginModifier() { - return (this.#flags & LoopFlags.BEGIN_MODIFIER) !== 0; + isLiteral() { + return (this.#flags & ShareableConstantNodeFlags.LITERAL) !== 0; + } + /** + * True if this node has the EXPERIMENTAL_EVERYTHING flag. + * + * @returns {boolean} + */ + isExperimentalEverything() { + return (this.#flags & ShareableConstantNodeFlags.EXPERIMENTAL_EVERYTHING) !== 0; + } + /** + * True if this node has the EXPERIMENTAL_COPY flag. + * + * @returns {boolean} + */ + isExperimentalCopy() { + return (this.#flags & ShareableConstantNodeFlags.EXPERIMENTAL_COPY) !== 0; } /** * Accept a visitor for this node. @@ -17378,7 +26663,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitUntilNode(this); + visitor.visitShareableConstantNode(this); } /** * Returns all child nodes of the current node. @@ -17386,7 +26671,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.predicate, this.statements]; + return [this.write]; } /** * Compact and return an array of child nodes. @@ -17394,12 +26679,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - compact.push(this.predicate); - if (this.statements) { - compact.push(this.statements); - } - return compact; + return [this.write]; } /** * Transforms the Node to a JavaScript object. @@ -17408,18 +26688,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "UntilNode", + type: "ShareableConstantNode", location: this.location, flags: this.#flags, - keywordLoc: this.keywordLoc, - doKeywordLoc: this.doKeywordLoc, - closingLoc: this.closingLoc, - predicate: this.predicate, - statements: this.statements + write: this.write }; } }; - var WhenNode = class { + var SingletonClassNode = class { /** * @type number */ @@ -17432,41 +26708,53 @@ var HerbLinter = (() => { * @type number */ #flags; + /** + * @type string[] + */ + locals; /** * @type Location */ - keywordLoc; + classKeywordLoc; /** - * @type Node[] + * @type Location */ - conditions; + operatorLoc; /** - * @type Location | null + * @type Node */ - thenKeywordLoc; + expression; /** - * @type StatementsNode | null + * @type Node | null */ - statements; + body; /** - * Construct a new WhenNode. + * @type Location + */ + endKeywordLoc; + /** + * Construct a new SingletonClassNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} keywordLoc - * @param {Node[]} conditions - * @param {Location | null} thenKeywordLoc - * @param {StatementsNode | null} statements + * @param {string[]} locals + * @param {Location} classKeywordLoc + * @param {Location} operatorLoc + * @param {Node} expression + * @param {Node | null} body + * @param {Location} endKeywordLoc */ - constructor(nodeID, location, flags, keywordLoc, conditions, thenKeywordLoc, statements) { + constructor(nodeID, location, flags, locals, classKeywordLoc, operatorLoc, expression, body, endKeywordLoc) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.keywordLoc = keywordLoc; - this.conditions = conditions; - this.thenKeywordLoc = thenKeywordLoc; - this.statements = statements; + this.locals = locals; + this.classKeywordLoc = classKeywordLoc; + this.operatorLoc = operatorLoc; + this.expression = expression; + this.body = body; + this.endKeywordLoc = endKeywordLoc; } /** * Accept a visitor for this node. @@ -17474,7 +26762,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitWhenNode(this); + visitor.visitSingletonClassNode(this); } /** * Returns all child nodes of the current node. @@ -17482,7 +26770,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [...this.conditions, this.statements]; + return [this.expression, this.body]; } /** * Compact and return an array of child nodes. @@ -17491,9 +26779,9 @@ var HerbLinter = (() => { */ compactChildNodes() { const compact = []; - compact.concat(this.conditions); - if (this.statements) { - compact.push(this.statements); + compact.push(this.expression); + if (this.body) { + compact.push(this.body); } return compact; } @@ -17504,17 +26792,19 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "WhenNode", + type: "SingletonClassNode", location: this.location, flags: this.#flags, - keywordLoc: this.keywordLoc, - conditions: this.conditions, - thenKeywordLoc: this.thenKeywordLoc, - statements: this.statements + locals: this.locals, + classKeywordLoc: this.classKeywordLoc, + operatorLoc: this.operatorLoc, + expression: this.expression, + body: this.body, + endKeywordLoc: this.endKeywordLoc }; } }; - var WhileNode = class { + var SourceEncodingNode = class { /** * @type number */ @@ -17528,54 +26818,16 @@ var HerbLinter = (() => { */ #flags; /** - * @type Location - */ - keywordLoc; - /** - * @type Location | null - */ - doKeywordLoc; - /** - * @type Location | null - */ - closingLoc; - /** - * @type Node - */ - predicate; - /** - * @type StatementsNode | null - */ - statements; - /** - * Construct a new WhileNode. + * Construct a new SourceEncodingNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} keywordLoc - * @param {Location | null} doKeywordLoc - * @param {Location | null} closingLoc - * @param {Node} predicate - * @param {StatementsNode | null} statements */ - constructor(nodeID, location, flags, keywordLoc, doKeywordLoc, closingLoc, predicate, statements) { + constructor(nodeID, location, flags) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.keywordLoc = keywordLoc; - this.doKeywordLoc = doKeywordLoc; - this.closingLoc = closingLoc; - this.predicate = predicate; - this.statements = statements; - } - /** - * True if this node has the BEGIN_MODIFIER flag. - * - * @returns {boolean} - */ - isBeginModifier() { - return (this.#flags & LoopFlags.BEGIN_MODIFIER) !== 0; } /** * Accept a visitor for this node. @@ -17583,7 +26835,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitWhileNode(this); + visitor.visitSourceEncodingNode(this); } /** * Returns all child nodes of the current node. @@ -17591,7 +26843,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.predicate, this.statements]; + return []; } /** * Compact and return an array of child nodes. @@ -17599,12 +26851,7 @@ var HerbLinter = (() => { * @returns {Node[]} An array of compacted child nodes. */ compactChildNodes() { - const compact = []; - compact.push(this.predicate); - if (this.statements) { - compact.push(this.statements); - } - return compact; + return []; } /** * Transforms the Node to a JavaScript object. @@ -17613,18 +26860,13 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "WhileNode", + type: "SourceEncodingNode", location: this.location, - flags: this.#flags, - keywordLoc: this.keywordLoc, - doKeywordLoc: this.doKeywordLoc, - closingLoc: this.closingLoc, - predicate: this.predicate, - statements: this.statements + flags: this.#flags }; } }; - var XStringNode = class { + var SourceFileNode = class { /** * @type number */ @@ -17637,41 +26879,23 @@ var HerbLinter = (() => { * @type number */ #flags; - /** - * @type Location - */ - openingLoc; - /** - * @type Location - */ - contentLoc; - /** - * @type Location - */ - closingLoc; /** * @type RubyString */ - unescaped; + filepath; /** - * Construct a new XStringNode. + * Construct a new SourceFileNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} openingLoc - * @param {Location} contentLoc - * @param {Location} closingLoc - * @param {RubyString} unescaped + * @param {RubyString} filepath */ - constructor(nodeID, location, flags, openingLoc, contentLoc, closingLoc, unescaped) { + constructor(nodeID, location, flags, filepath) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.openingLoc = openingLoc; - this.contentLoc = contentLoc; - this.closingLoc = closingLoc; - this.unescaped = unescaped; + this.filepath = filepath; } /** * True if this node has the FORCED_UTF8_ENCODING flag. @@ -17679,7 +26903,7 @@ var HerbLinter = (() => { * @returns {boolean} */ isForcedUtf8Encoding() { - return (this.#flags & EncodingFlags.FORCED_UTF8_ENCODING) !== 0; + return (this.#flags & StringFlags.FORCED_UTF8_ENCODING) !== 0; } /** * True if this node has the FORCED_BINARY_ENCODING flag. @@ -17687,7 +26911,23 @@ var HerbLinter = (() => { * @returns {boolean} */ isForcedBinaryEncoding() { - return (this.#flags & EncodingFlags.FORCED_BINARY_ENCODING) !== 0; + return (this.#flags & StringFlags.FORCED_BINARY_ENCODING) !== 0; + } + /** + * True if this node has the FROZEN flag. + * + * @returns {boolean} + */ + isFrozen() { + return (this.#flags & StringFlags.FROZEN) !== 0; + } + /** + * True if this node has the MUTABLE flag. + * + * @returns {boolean} + */ + isMutable() { + return (this.#flags & StringFlags.MUTABLE) !== 0; } /** * Accept a visitor for this node. @@ -17695,7 +26935,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitXStringNode(this); + visitor.visitSourceFileNode(this); } /** * Returns all child nodes of the current node. @@ -17720,17 +26960,14 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "XStringNode", + type: "SourceFileNode", location: this.location, flags: this.#flags, - openingLoc: this.openingLoc, - contentLoc: this.contentLoc, - closingLoc: this.closingLoc, - unescaped: this.unescaped + filepath: this.filepath }; } }; - var YieldNode = class { + var SourceLineNode = class { /** * @type number */ @@ -17744,40 +26981,90 @@ var HerbLinter = (() => { */ #flags; /** - * @type Location + * Construct a new SourceLineNode. + * + * @param {number} nodeID + * @param {Location} location + * @param {number} flags */ - keywordLoc; + constructor(nodeID, location, flags) { + this.nodeID = nodeID; + this.location = location; + this.#flags = flags; + } /** - * @type Location | null + * Accept a visitor for this node. + * + * @param {visitors.Visitor} visitor */ - lparenLoc; + accept(visitor) { + visitor.visitSourceLineNode(this); + } /** - * @type ArgumentsNode | null + * Returns all child nodes of the current node. + * + * @returns {(Node | null)[]} An array of child nodes. */ - arguments_; + childNodes() { + return []; + } /** - * @type Location | null + * Compact and return an array of child nodes. + * + * @returns {Node[]} An array of compacted child nodes. */ - rparenLoc; + compactChildNodes() { + return []; + } /** - * Construct a new YieldNode. + * Transforms the Node to a JavaScript object. + * + * @returns {Object} + */ + toJSON() { + return { + type: "SourceLineNode", + location: this.location, + flags: this.#flags + }; + } + }; + var SplatNode = class { + /** + * @type number + */ + nodeID; + /** + * @type {Location} + */ + location; + /** + * @type number + */ + #flags; + /** + * @type Location + */ + operatorLoc; + /** + * @type Node | null + */ + expression; + /** + * Construct a new SplatNode. * * @param {number} nodeID * @param {Location} location * @param {number} flags - * @param {Location} keywordLoc - * @param {Location | null} lparenLoc - * @param {ArgumentsNode | null} arguments_ - * @param {Location | null} rparenLoc + * @param {Location} operatorLoc + * @param {Node | null} expression */ - constructor(nodeID, location, flags, keywordLoc, lparenLoc, arguments_, rparenLoc) { + constructor(nodeID, location, flags, operatorLoc, expression) { this.nodeID = nodeID; this.location = location; this.#flags = flags; - this.keywordLoc = keywordLoc; - this.lparenLoc = lparenLoc; - this.arguments_ = arguments_; - this.rparenLoc = rparenLoc; + this.operatorLoc = operatorLoc; + this.expression = expression; } /** * Accept a visitor for this node. @@ -17785,7 +27072,7 @@ var HerbLinter = (() => { * @param {visitors.Visitor} visitor */ accept(visitor) { - visitor.visitYieldNode(this); + visitor.visitSplatNode(this); } /** * Returns all child nodes of the current node. @@ -17793,7 +27080,7 @@ var HerbLinter = (() => { * @returns {(Node | null)[]} An array of child nodes. */ childNodes() { - return [this.arguments_]; + return [this.expression]; } /** * Compact and return an array of child nodes. @@ -17802,8 +27089,8 @@ var HerbLinter = (() => { */ compactChildNodes() { const compact = []; - if (this.arguments_) { - compact.push(this.arguments_); + if (this.expression) { + compact.push(this.expression); } return compact; } @@ -17814,1730 +27101,3130 @@ var HerbLinter = (() => { */ toJSON() { return { - type: "YieldNode", + type: "SplatNode", location: this.location, flags: this.#flags, - keywordLoc: this.keywordLoc, - lparenLoc: this.lparenLoc, - arguments: this.arguments_, - rparenLoc: this.rparenLoc + operatorLoc: this.operatorLoc, + expression: this.expression }; } }; - - // node_modules/@ruby/prism/src/deserialize.js - var MAJOR_VERSION = 1; - var MINOR_VERSION = 9; - var PATCH_VERSION = 0; - var LITTLE_ENDIAN = (() => { - let uint32 = new Uint32Array([287454020]); - let uint8 = new Uint8Array(uint32.buffer); - if (uint8[0] === 68) { - return true; - } else if (uInt8[0] === 17) { - return false; - } else { - throw new Error("Mixed endianness"); - } - })(); - var SerializationBuffer = class { - FORCED_UTF8_ENCODING_FLAG = 1 << 2; - FORCED_BINARY_ENCODING_FLAG = 1 << 3; - DECODER_MAP = /* @__PURE__ */ new Map([ - ["ascii-8bit", "ascii"] - ]); - constructor(source, array) { - this.source = source; - this.array = array; - this.index = 0; - this.fileEncoding = "utf-8"; - this.decoders = /* @__PURE__ */ new Map(); + var StatementsNode = class { + /** + * @type number + */ + nodeID; + /** + * @type {Location} + */ + location; + /** + * @type number + */ + #flags; + /** + * @type Node[] + */ + body; + /** + * Construct a new StatementsNode. + * + * @param {number} nodeID + * @param {Location} location + * @param {number} flags + * @param {Node[]} body + */ + constructor(nodeID, location, flags, body) { + this.nodeID = nodeID; + this.location = location; + this.#flags = flags; + this.body = body; } - readByte() { - const result = this.array[this.index]; - this.index += 1; - return result; + /** + * Accept a visitor for this node. + * + * @param {visitors.Visitor} visitor + */ + accept(visitor) { + visitor.visitStatementsNode(this); } - readBytes(length) { - const result = this.array.slice(this.index, this.index + length); - this.index += length; - return result; + /** + * Returns all child nodes of the current node. + * + * @returns {(Node | null)[]} An array of child nodes. + */ + childNodes() { + return [...this.body]; } - readString(length, flags) { - return this.decodeString(this.readBytes(length), flags).value; + /** + * Compact and return an array of child nodes. + * + * @returns {Node[]} An array of compacted child nodes. + */ + compactChildNodes() { + return [...this.body]; } - // Read a 32-bit unsigned integer in little-endian format. - readUint32() { - const result = this.scanUint32(this.index); - this.index += 4; - return result; + /** + * Transforms the Node to a JavaScript object. + * + * @returns {Object} + */ + toJSON() { + return { + type: "StatementsNode", + location: this.location, + flags: this.#flags, + body: this.body + }; } - scanUint32(offset) { - const bytes = this.array.slice(offset, offset + 4); - return bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24; + }; + var StringNode = class { + /** + * @type number + */ + nodeID; + /** + * @type {Location} + */ + location; + /** + * @type number + */ + #flags; + /** + * @type Location | null + */ + openingLoc; + /** + * @type Location + */ + contentLoc; + /** + * @type Location | null + */ + closingLoc; + /** + * @type RubyString + */ + unescaped; + /** + * Construct a new StringNode. + * + * @param {number} nodeID + * @param {Location} location + * @param {number} flags + * @param {Location | null} openingLoc + * @param {Location} contentLoc + * @param {Location | null} closingLoc + * @param {RubyString} unescaped + */ + constructor(nodeID, location, flags, openingLoc, contentLoc, closingLoc, unescaped) { + this.nodeID = nodeID; + this.location = location; + this.#flags = flags; + this.openingLoc = openingLoc; + this.contentLoc = contentLoc; + this.closingLoc = closingLoc; + this.unescaped = unescaped; } - readVarInt() { - let result = 0; - let shift = 0; - while (true) { - const byte = this.readByte(); - result += (byte & 127) << shift; - shift += 7; - if ((byte & 128) === 0) { - break; - } - } - return result; + /** + * True if this node has the FORCED_UTF8_ENCODING flag. + * + * @returns {boolean} + */ + isForcedUtf8Encoding() { + return (this.#flags & StringFlags.FORCED_UTF8_ENCODING) !== 0; } - readLocation() { - return { startOffset: this.readVarInt(), length: this.readVarInt() }; + /** + * True if this node has the FORCED_BINARY_ENCODING flag. + * + * @returns {boolean} + */ + isForcedBinaryEncoding() { + return (this.#flags & StringFlags.FORCED_BINARY_ENCODING) !== 0; } - readOptionalLocation() { - if (this.readByte() != 0) { - return this.readLocation(); - } else { - return null; - } + /** + * True if this node has the FROZEN flag. + * + * @returns {boolean} + */ + isFrozen() { + return (this.#flags & StringFlags.FROZEN) !== 0; } - readStringField(flags) { - if (flags === void 0) flags = 0; - const type = this.readByte(); - switch (type) { - case 1: { - const startOffset = this.readVarInt(); - const length = this.readVarInt(); - return this.decodeString(this.source.slice(startOffset, startOffset + length), flags); - } - case 2: - return this.decodeString(this.readBytes(this.readVarInt()), flags); - default: - throw new Error(`Unknown serialized string type: ${type}`); - } + /** + * True if this node has the MUTABLE flag. + * + * @returns {boolean} + */ + isMutable() { + return (this.#flags & StringFlags.MUTABLE) !== 0; } - scanConstant(constantPoolOffset, constantIndex) { - const offset = constantPoolOffset + constantIndex * 8; - let startOffset = this.scanUint32(offset); - const length = this.scanUint32(offset + 4); - if (startOffset & 1 << 31) { - startOffset &= (1 << 31) - 1; - return new TextDecoder().decode(this.array.slice(startOffset, startOffset + length)); - } else { - return new TextDecoder().decode(this.source.slice(startOffset, startOffset + length)); - } + /** + * Accept a visitor for this node. + * + * @param {visitors.Visitor} visitor + */ + accept(visitor) { + visitor.visitStringNode(this); } - readDouble() { - const view = new DataView(new ArrayBuffer(8)); - for (let index = 0; index < 8; index++) { - view.setUint8(index, this.readByte()); - } - return view.getFloat64(0, LITTLE_ENDIAN); + /** + * Returns all child nodes of the current node. + * + * @returns {(Node | null)[]} An array of child nodes. + */ + childNodes() { + return []; } - decodeString(bytes, flags) { - const forcedBin = (flags & this.FORCED_BINARY_ENCODING_FLAG) !== 0; - const forcedUtf8 = (flags & this.FORCED_UTF8_ENCODING_FLAG) !== 0; - if (forcedBin) { - return { - encoding: "ascii", - validEncoding: true, - value: this.asciiDecoder.decode(bytes) - }; - } else { - const encoding = forcedUtf8 ? "utf-8" : this.fileEncoding.toLowerCase(); - const decoder = this.getDecoder(encoding); - try { - return { - encoding, - validEncoding: true, - value: decoder.decode(bytes) - }; - } catch (e) { - if (e.code === "ERR_ENCODING_INVALID_ENCODED_DATA") { - return { - encoding, - validEncoding: false, - value: this.asciiDecoder.decode(bytes) - }; - } - throw e; - } - } + /** + * Compact and return an array of child nodes. + * + * @returns {Node[]} An array of compacted child nodes. + */ + compactChildNodes() { + return []; } - getDecoder(encoding) { - encoding = this.DECODER_MAP.get(encoding) || encoding; - if (!this.decoders.has(encoding)) { - this.decoders.set(encoding, new TextDecoder(encoding, { fatal: true })); - } - return this.decoders.get(encoding); + /** + * Transforms the Node to a JavaScript object. + * + * @returns {Object} + */ + toJSON() { + return { + type: "StringNode", + location: this.location, + flags: this.#flags, + openingLoc: this.openingLoc, + contentLoc: this.contentLoc, + closingLoc: this.closingLoc, + unescaped: this.unescaped + }; } - get asciiDecoder() { - if (!this._asciiDecoder) { - this._asciiDecoder = new TextDecoder("ascii"); + }; + var SuperNode = class { + /** + * @type number + */ + nodeID; + /** + * @type {Location} + */ + location; + /** + * @type number + */ + #flags; + /** + * @type Location + */ + keywordLoc; + /** + * @type Location | null + */ + lparenLoc; + /** + * @type ArgumentsNode | null + */ + arguments_; + /** + * @type Location | null + */ + rparenLoc; + /** + * @type Node | null + */ + block; + /** + * Construct a new SuperNode. + * + * @param {number} nodeID + * @param {Location} location + * @param {number} flags + * @param {Location} keywordLoc + * @param {Location | null} lparenLoc + * @param {ArgumentsNode | null} arguments_ + * @param {Location | null} rparenLoc + * @param {Node | null} block + */ + constructor(nodeID, location, flags, keywordLoc, lparenLoc, arguments_, rparenLoc, block) { + this.nodeID = nodeID; + this.location = location; + this.#flags = flags; + this.keywordLoc = keywordLoc; + this.lparenLoc = lparenLoc; + this.arguments_ = arguments_; + this.rparenLoc = rparenLoc; + this.block = block; + } + /** + * Accept a visitor for this node. + * + * @param {visitors.Visitor} visitor + */ + accept(visitor) { + visitor.visitSuperNode(this); + } + /** + * Returns all child nodes of the current node. + * + * @returns {(Node | null)[]} An array of child nodes. + */ + childNodes() { + return [this.arguments_, this.block]; + } + /** + * Compact and return an array of child nodes. + * + * @returns {Node[]} An array of compacted child nodes. + */ + compactChildNodes() { + const compact = []; + if (this.arguments_) { + compact.push(this.arguments_); } - return this._asciiDecoder; + if (this.block) { + compact.push(this.block); + } + return compact; + } + /** + * Transforms the Node to a JavaScript object. + * + * @returns {Object} + */ + toJSON() { + return { + type: "SuperNode", + location: this.location, + flags: this.#flags, + keywordLoc: this.keywordLoc, + lparenLoc: this.lparenLoc, + arguments: this.arguments_, + rparenLoc: this.rparenLoc, + block: this.block + }; } }; - var ParseResult = class { + var SymbolNode = class { /** - * @type {nodes.ProgramNode} + * @type number */ - value; + nodeID; /** - * @type {Comment[]} + * @type {Location} */ - comments; + location; /** - * @type {MagicComment[]} + * @type number */ - magicComments; + #flags; /** - * @type {Location | null} + * @type Location | null */ + openingLoc; /** - * @type {ParseError[]} + * @type Location | null */ - errors; + valueLoc; /** - * @type {ParseWarning[]} + * @type Location | null */ - warnings; + closingLoc; /** - * @param {nodes.ProgramNode} value - * @param {Comment[]} comments - * @param {MagicComment[]} magicComments - * @param {ParseError[]} errors - * @param {ParseWarning[]} warnings + * @type RubyString */ - constructor(value, comments, magicComments, dataLoc, errors, warnings) { - this.value = value; - this.comments = comments; - this.magicComments = magicComments; - this.dataLoc = dataLoc; - this.errors = errors; - this.warnings = warnings; + unescaped; + /** + * Construct a new SymbolNode. + * + * @param {number} nodeID + * @param {Location} location + * @param {number} flags + * @param {Location | null} openingLoc + * @param {Location | null} valueLoc + * @param {Location | null} closingLoc + * @param {RubyString} unescaped + */ + constructor(nodeID, location, flags, openingLoc, valueLoc, closingLoc, unescaped) { + this.nodeID = nodeID; + this.location = location; + this.#flags = flags; + this.openingLoc = openingLoc; + this.valueLoc = valueLoc; + this.closingLoc = closingLoc; + this.unescaped = unescaped; + } + /** + * True if this node has the FORCED_UTF8_ENCODING flag. + * + * @returns {boolean} + */ + isForcedUtf8Encoding() { + return (this.#flags & SymbolFlags.FORCED_UTF8_ENCODING) !== 0; + } + /** + * True if this node has the FORCED_BINARY_ENCODING flag. + * + * @returns {boolean} + */ + isForcedBinaryEncoding() { + return (this.#flags & SymbolFlags.FORCED_BINARY_ENCODING) !== 0; + } + /** + * True if this node has the FORCED_US_ASCII_ENCODING flag. + * + * @returns {boolean} + */ + isForcedUsAsciiEncoding() { + return (this.#flags & SymbolFlags.FORCED_US_ASCII_ENCODING) !== 0; + } + /** + * Accept a visitor for this node. + * + * @param {visitors.Visitor} visitor + */ + accept(visitor) { + visitor.visitSymbolNode(this); + } + /** + * Returns all child nodes of the current node. + * + * @returns {(Node | null)[]} An array of child nodes. + */ + childNodes() { + return []; + } + /** + * Compact and return an array of child nodes. + * + * @returns {Node[]} An array of compacted child nodes. + */ + compactChildNodes() { + return []; + } + /** + * Transforms the Node to a JavaScript object. + * + * @returns {Object} + */ + toJSON() { + return { + type: "SymbolNode", + location: this.location, + flags: this.#flags, + openingLoc: this.openingLoc, + valueLoc: this.valueLoc, + closingLoc: this.closingLoc, + unescaped: this.unescaped + }; } }; - var errorLevels = ["syntax", "argument", "load"]; - var errorTypes = [ - "alias_argument", - "alias_argument_numbered_reference", - "ampampeq_multi_assign", - "argument_after_block", - "argument_after_forwarding_ellipses", - "argument_bare_hash", - "argument_block_forwarding", - "argument_block_multi", - "argument_conflict_ampersand", - "argument_conflict_star", - "argument_conflict_star_star", - "argument_formal_class", - "argument_formal_constant", - "argument_formal_global", - "argument_formal_ivar", - "argument_forwarding_unbound", - "argument_no_forwarding_ampersand", - "argument_no_forwarding_ellipses", - "argument_no_forwarding_star", - "argument_no_forwarding_star_star", - "argument_splat_after_assoc_splat", - "argument_splat_after_splat", - "argument_term_paren", - "argument_unexpected_block", - "array_element", - "array_expression", - "array_expression_after_star", - "array_separator", - "array_term", - "begin_lonely_else", - "begin_term", - "begin_upcase_brace", - "begin_upcase_term", - "begin_upcase_toplevel", - "block_param_local_variable", - "block_param_pipe_term", - "block_term_brace", - "block_term_end", - "cannot_parse_expression", - "cannot_parse_string_part", - "case_expression_after_case", - "case_expression_after_when", - "case_match_missing_predicate", - "case_missing_conditions", - "case_term", - "class_in_method", - "class_name", - "class_superclass", - "class_term", - "class_unexpected_end", - "class_variable_bare", - "conditional_elsif_predicate", - "conditional_if_predicate", - "conditional_predicate_term", - "conditional_term", - "conditional_term_else", - "conditional_unless_predicate", - "conditional_until_predicate", - "conditional_while_predicate", - "constant_path_colon_colon_constant", - "def_endless", - "def_endless_parameters", - "def_endless_setter", - "def_name", - "def_params_term", - "def_params_term_paren", - "def_receiver", - "def_receiver_term", - "def_term", - "defined_expression", - "embdoc_term", - "embexpr_end", - "embvar_invalid", - "end_upcase_brace", - "end_upcase_term", - "escape_invalid_control", - "escape_invalid_control_repeat", - "escape_invalid_hexadecimal", - "escape_invalid_meta", - "escape_invalid_meta_repeat", - "escape_invalid_unicode", - "escape_invalid_unicode_cm_flags", - "escape_invalid_unicode_list", - "escape_invalid_unicode_literal", - "escape_invalid_unicode_long", - "escape_invalid_unicode_short", - "escape_invalid_unicode_term", - "expect_argument", - "expect_eol_after_statement", - "expect_expression_after_ampampeq", - "expect_expression_after_comma", - "expect_expression_after_equal", - "expect_expression_after_less_less", - "expect_expression_after_lparen", - "expect_expression_after_operator", - "expect_expression_after_pipepipeeq", - "expect_expression_after_question", - "expect_expression_after_splat", - "expect_expression_after_splat_hash", - "expect_expression_after_star", - "expect_for_delimiter", - "expect_ident_req_parameter", - "expect_in_delimiter", - "expect_lparen_after_not_lparen", - "expect_lparen_after_not_other", - "expect_lparen_req_parameter", - "expect_message", - "expect_rbracket", - "expect_rparen", - "expect_rparen_after_multi", - "expect_rparen_req_parameter", - "expect_singleton_class_delimiter", - "expect_string_content", - "expect_when_delimiter", - "expression_bare_hash", - "expression_not_writable", - "expression_not_writable_encoding", - "expression_not_writable_false", - "expression_not_writable_file", - "expression_not_writable_line", - "expression_not_writable_nil", - "expression_not_writable_numbered", - "expression_not_writable_self", - "expression_not_writable_true", - "float_parse", - "for_collection", - "for_in", - "for_index", - "for_term", - "global_variable_bare", - "hash_expression_after_label", - "hash_key", - "hash_rocket", - "hash_term", - "hash_value", - "heredoc_identifier", - "heredoc_term", - "incomplete_question_mark", - "incomplete_variable_class", - "incomplete_variable_class_3_3", - "incomplete_variable_instance", - "incomplete_variable_instance_3_3", - "instance_variable_bare", - "invalid_block_exit", - "invalid_character", - "invalid_comma", - "invalid_encoding_magic_comment", - "invalid_escape_character", - "invalid_float_exponent", - "invalid_local_variable_read", - "invalid_local_variable_write", - "invalid_multibyte_char", - "invalid_multibyte_character", - "invalid_multibyte_escape", - "invalid_number_binary", - "invalid_number_decimal", - "invalid_number_fraction", - "invalid_number_hexadecimal", - "invalid_number_octal", - "invalid_number_underscore_inner", - "invalid_number_underscore_trailing", - "invalid_percent", - "invalid_percent_eof", - "invalid_printable_character", - "invalid_retry_after_else", - "invalid_retry_after_ensure", - "invalid_retry_without_rescue", - "invalid_symbol", - "invalid_variable_global", - "invalid_variable_global_3_3", - "invalid_yield", - "it_not_allowed_numbered", - "it_not_allowed_ordinary", - "lambda_open", - "lambda_term_brace", - "lambda_term_end", - "list_i_lower_element", - "list_i_lower_term", - "list_i_upper_element", - "list_i_upper_term", - "list_w_lower_element", - "list_w_lower_term", - "list_w_upper_element", - "list_w_upper_term", - "malloc_failed", - "mixed_encoding", - "module_in_method", - "module_name", - "module_term", - "multi_assign_multi_splats", - "multi_assign_unexpected_rest", - "nesting_too_deep", - "no_local_variable", - "non_associative_operator", - "not_expression", - "number_literal_underscore", - "numbered_parameter_inner_block", - "numbered_parameter_it", - "numbered_parameter_ordinary", - "numbered_parameter_outer_block", - "operator_multi_assign", - "operator_write_arguments", - "operator_write_block", - "parameter_assoc_splat_multi", - "parameter_block_multi", - "parameter_circular", - "parameter_forwarding_after_rest", - "parameter_method_name", - "parameter_name_duplicated", - "parameter_no_default", - "parameter_no_default_kw", - "parameter_numbered_reserved", - "parameter_order", - "parameter_splat_multi", - "parameter_star", - "parameter_unexpected_fwd", - "parameter_unexpected_no_kw", - "parameter_wild_loose_comma", - "pattern_array_multiple_rests", - "pattern_capture_duplicate", - "pattern_capture_in_alternative", - "pattern_expression_after_bracket", - "pattern_expression_after_comma", - "pattern_expression_after_hrocket", - "pattern_expression_after_in", - "pattern_expression_after_key", - "pattern_expression_after_paren", - "pattern_expression_after_pin", - "pattern_expression_after_pipe", - "pattern_expression_after_range", - "pattern_expression_after_rest", - "pattern_find_missing_inner", - "pattern_hash_implicit", - "pattern_hash_key", - "pattern_hash_key_duplicate", - "pattern_hash_key_interpolated", - "pattern_hash_key_label", - "pattern_hash_key_locals", - "pattern_ident_after_hrocket", - "pattern_label_after_comma", - "pattern_rest", - "pattern_term_brace", - "pattern_term_bracket", - "pattern_term_paren", - "pipepipeeq_multi_assign", - "regexp_encoding_option_mismatch", - "regexp_incompat_char_encoding", - "regexp_invalid_unicode_range", - "regexp_non_escaped_mbc", - "regexp_parse_error", - "regexp_term", - "regexp_unknown_options", - "regexp_utf8_char_non_utf8_regexp", - "rescue_expression", - "rescue_modifier_value", - "rescue_term", - "rescue_variable", - "return_invalid", - "script_not_found", - "singleton_for_literals", - "statement_alias", - "statement_postexe_end", - "statement_preexe_begin", - "statement_undef", - "string_concatenation", - "string_interpolated_term", - "string_literal_eof", - "string_literal_term", - "symbol_invalid", - "symbol_term_dynamic", - "symbol_term_interpolated", - "ternary_colon", - "ternary_expression_false", - "ternary_expression_true", - "unary_disallowed", - "unary_receiver", - "undef_argument", - "unexpected_block_argument", - "unexpected_index_block", - "unexpected_index_keywords", - "unexpected_label", - "unexpected_multi_write", - "unexpected_parameter_default_value", - "unexpected_range_operator", - "unexpected_safe_navigation", - "unexpected_token_close_context", - "unexpected_token_ignore", - "until_term", - "void_expression", - "while_term", - "write_target_in_method", - "write_target_readonly", - "write_target_unexpected", - "xstring_term" - ]; - var warningLevels = ["default", "verbose"]; - var warningTypes = [ - "ambiguous_binary_operator", - "ambiguous_first_argument_minus", - "ambiguous_first_argument_plus", - "ambiguous_prefix_ampersand", - "ambiguous_prefix_star", - "ambiguous_prefix_star_star", - "ambiguous_slash", - "comparison_after_comparison", - "dot_dot_dot_eol", - "equal_in_conditional", - "equal_in_conditional_3_3", - "end_in_method", - "duplicated_hash_key", - "duplicated_when_clause", - "float_out_of_range", - "ignored_frozen_string_literal", - "indentation_mismatch", - "integer_in_flip_flop", - "invalid_character", - "invalid_magic_comment_value", - "invalid_numbered_reference", - "keyword_eol", - "literal_in_condition_default", - "literal_in_condition_verbose", - "shareable_constant_value_line", - "shebang_carriage_return", - "unexpected_carriage_return", - "unreachable_statement", - "unused_local_variable", - "void_statement" - ]; - function deserialize(source, array) { - const buffer = new SerializationBuffer(source, array); - if (buffer.readString(5) !== "PRISM") { - throw new Error("Invalid serialization"); + var TrueNode = class { + /** + * @type number + */ + nodeID; + /** + * @type {Location} + */ + location; + /** + * @type number + */ + #flags; + /** + * Construct a new TrueNode. + * + * @param {number} nodeID + * @param {Location} location + * @param {number} flags + */ + constructor(nodeID, location, flags) { + this.nodeID = nodeID; + this.location = location; + this.#flags = flags; } - if (buffer.readByte() != MAJOR_VERSION || buffer.readByte() != MINOR_VERSION || buffer.readByte() != PATCH_VERSION) { - throw new Error("Invalid serialization"); + /** + * Accept a visitor for this node. + * + * @param {visitors.Visitor} visitor + */ + accept(visitor) { + visitor.visitTrueNode(this); } - if (buffer.readByte() != 0) { - throw new Error("Invalid serialization (location fields must be included but are not)"); + /** + * Returns all child nodes of the current node. + * + * @returns {(Node | null)[]} An array of child nodes. + */ + childNodes() { + return []; } - buffer.fileEncoding = buffer.readString(buffer.readVarInt()); - buffer.readVarInt(); - const lineOffsetsCount = buffer.readVarInt(); - for (let i = 0; i < lineOffsetsCount; i++) { - buffer.readVarInt(); + /** + * Compact and return an array of child nodes. + * + * @returns {Node[]} An array of compacted child nodes. + */ + compactChildNodes() { + return []; } - const comments = Array.from({ length: buffer.readVarInt() }, () => ({ - type: buffer.readVarInt(), - location: buffer.readLocation() - })); - const magicComments = Array.from({ length: buffer.readVarInt() }, () => ({ - startLocation: buffer.readLocation(), - endLocation: buffer.readLocation() - })); - const dataLoc = buffer.readOptionalLocation(); - const errors = Array.from({ length: buffer.readVarInt() }, () => ({ - type: errorTypes[buffer.readVarInt()], - message: buffer.readString(buffer.readVarInt()), - location: buffer.readLocation(), - level: errorLevels[buffer.readByte()] - })); - const warnings = Array.from({ length: buffer.readVarInt() }, () => ({ - type: warningTypes[buffer.readVarInt()], - message: buffer.readString(buffer.readVarInt()), - location: buffer.readLocation(), - level: warningLevels[buffer.readByte()] - })); - const constantPoolOffset = buffer.readUint32(); - const constants = Array.from({ length: buffer.readVarInt() }, () => null); - return new ParseResult(readRequiredNode(), comments, magicComments, dataLoc, errors, warnings); - function readRequiredNode() { - const type = buffer.readByte(); - const nodeID = buffer.readVarInt(); - const location = buffer.readLocation(); - let flags; - switch (type) { - case 1: - return new AliasGlobalVariableNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), readRequiredNode(), buffer.readLocation()); - case 2: - return new AliasMethodNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), readRequiredNode(), buffer.readLocation()); - case 3: - return new AlternationPatternNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), readRequiredNode(), buffer.readLocation()); - case 4: - return new AndNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), readRequiredNode(), buffer.readLocation()); - case 5: - return new ArgumentsNode(nodeID, location, flags = buffer.readVarInt(), Array.from({ length: buffer.readVarInt() }, readRequiredNode)); - case 6: - return new ArrayNode(nodeID, location, flags = buffer.readVarInt(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), buffer.readOptionalLocation(), buffer.readOptionalLocation()); - case 7: - return new ArrayPatternNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), readOptionalNode(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), buffer.readOptionalLocation(), buffer.readOptionalLocation()); - case 8: - return new AssocNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), readRequiredNode(), buffer.readOptionalLocation()); - case 9: - return new AssocSplatNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), buffer.readLocation()); - case 10: - return new BackReferenceReadNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant()); - case 11: - return new BeginNode(nodeID, location, flags = buffer.readVarInt(), buffer.readOptionalLocation(), readOptionalNode(), readOptionalNode(), readOptionalNode(), readOptionalNode(), buffer.readOptionalLocation()); - case 12: - return new BlockArgumentNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), buffer.readLocation()); - case 13: - return new BlockLocalVariableNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant()); - case 14: - return new BlockNode(nodeID, location, flags = buffer.readVarInt(), Array.from({ length: buffer.readVarInt() }, readRequiredConstant), readOptionalNode(), readOptionalNode(), buffer.readLocation(), buffer.readLocation()); - case 15: - return new BlockParameterNode(nodeID, location, flags = buffer.readVarInt(), readOptionalConstant(), buffer.readOptionalLocation(), buffer.readLocation()); - case 16: - return new BlockParametersNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), buffer.readOptionalLocation(), buffer.readOptionalLocation()); - case 17: - return new BreakNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), buffer.readLocation()); - case 18: - return new CallAndWriteNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), buffer.readOptionalLocation(), buffer.readOptionalLocation(), readRequiredConstant(), readRequiredConstant(), buffer.readLocation(), readRequiredNode()); - case 19: - return new CallNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), buffer.readOptionalLocation(), readRequiredConstant(), buffer.readOptionalLocation(), buffer.readOptionalLocation(), readOptionalNode(), buffer.readOptionalLocation(), buffer.readOptionalLocation(), readOptionalNode()); - case 20: - return new CallOperatorWriteNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), buffer.readOptionalLocation(), buffer.readOptionalLocation(), readRequiredConstant(), readRequiredConstant(), readRequiredConstant(), buffer.readLocation(), readRequiredNode()); - case 21: - return new CallOrWriteNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), buffer.readOptionalLocation(), buffer.readOptionalLocation(), readRequiredConstant(), readRequiredConstant(), buffer.readLocation(), readRequiredNode()); - case 22: - return new CallTargetNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), buffer.readLocation(), readRequiredConstant(), buffer.readLocation()); - case 23: - return new CapturePatternNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), readRequiredNode(), buffer.readLocation()); - case 24: - return new CaseMatchNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), readOptionalNode(), buffer.readLocation(), buffer.readLocation()); - case 25: - return new CaseNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), readOptionalNode(), buffer.readLocation(), buffer.readLocation()); - case 26: - return new ClassNode(nodeID, location, flags = buffer.readVarInt(), Array.from({ length: buffer.readVarInt() }, readRequiredConstant), buffer.readLocation(), readRequiredNode(), buffer.readOptionalLocation(), readOptionalNode(), readOptionalNode(), buffer.readLocation(), readRequiredConstant()); - case 27: - return new ClassVariableAndWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), buffer.readLocation(), readRequiredNode()); - case 28: - return new ClassVariableOperatorWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), buffer.readLocation(), readRequiredNode(), readRequiredConstant()); - case 29: - return new ClassVariableOrWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), buffer.readLocation(), readRequiredNode()); - case 30: - return new ClassVariableReadNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant()); - case 31: - return new ClassVariableTargetNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant()); - case 32: - return new ClassVariableWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), readRequiredNode(), buffer.readLocation()); - case 33: - return new ConstantAndWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), buffer.readLocation(), readRequiredNode()); - case 34: - return new ConstantOperatorWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), buffer.readLocation(), readRequiredNode(), readRequiredConstant()); - case 35: - return new ConstantOrWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), buffer.readLocation(), readRequiredNode()); - case 36: - return new ConstantPathAndWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), buffer.readLocation(), readRequiredNode()); - case 37: - return new ConstantPathNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), readOptionalConstant(), buffer.readLocation(), buffer.readLocation()); - case 38: - return new ConstantPathOperatorWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), buffer.readLocation(), readRequiredNode(), readRequiredConstant()); - case 39: - return new ConstantPathOrWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), buffer.readLocation(), readRequiredNode()); - case 40: - return new ConstantPathTargetNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), readOptionalConstant(), buffer.readLocation(), buffer.readLocation()); - case 41: - return new ConstantPathWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), buffer.readLocation(), readRequiredNode()); - case 42: - return new ConstantReadNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant()); - case 43: - return new ConstantTargetNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant()); - case 44: - return new ConstantWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), readRequiredNode(), buffer.readLocation()); - case 45: - buffer.readUint32(); - return new DefNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), readOptionalNode(), readOptionalNode(), readOptionalNode(), Array.from({ length: buffer.readVarInt() }, readRequiredConstant), buffer.readLocation(), buffer.readOptionalLocation(), buffer.readOptionalLocation(), buffer.readOptionalLocation(), buffer.readOptionalLocation(), buffer.readOptionalLocation()); - case 46: - return new DefinedNode(nodeID, location, flags = buffer.readVarInt(), buffer.readOptionalLocation(), readRequiredNode(), buffer.readOptionalLocation(), buffer.readLocation()); - case 47: - return new ElseNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), readOptionalNode(), buffer.readOptionalLocation()); - case 48: - return new EmbeddedStatementsNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), readOptionalNode(), buffer.readLocation()); - case 49: - return new EmbeddedVariableNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), readRequiredNode()); - case 50: - return new EnsureNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), readOptionalNode(), buffer.readLocation()); - case 51: - return new FalseNode(nodeID, location, flags = buffer.readVarInt()); - case 52: - return new FindPatternNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), readRequiredNode(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), readRequiredNode(), buffer.readOptionalLocation(), buffer.readOptionalLocation()); - case 53: - return new FlipFlopNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), readOptionalNode(), buffer.readLocation()); - case 54: - return new FloatNode(nodeID, location, flags = buffer.readVarInt(), buffer.readDouble()); - case 55: - return new ForNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), readRequiredNode(), readOptionalNode(), buffer.readLocation(), buffer.readLocation(), buffer.readOptionalLocation(), buffer.readLocation()); - case 56: - return new ForwardingArgumentsNode(nodeID, location, flags = buffer.readVarInt()); - case 57: - return new ForwardingParameterNode(nodeID, location, flags = buffer.readVarInt()); - case 58: - return new ForwardingSuperNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode()); - case 59: - return new GlobalVariableAndWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), buffer.readLocation(), readRequiredNode()); - case 60: - return new GlobalVariableOperatorWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), buffer.readLocation(), readRequiredNode(), readRequiredConstant()); - case 61: - return new GlobalVariableOrWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), buffer.readLocation(), readRequiredNode()); - case 62: - return new GlobalVariableReadNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant()); - case 63: - return new GlobalVariableTargetNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant()); - case 64: - return new GlobalVariableWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), readRequiredNode(), buffer.readLocation()); - case 65: - return new HashNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), buffer.readLocation()); - case 66: - return new HashPatternNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), readOptionalNode(), buffer.readOptionalLocation(), buffer.readOptionalLocation()); - case 67: - return new IfNode(nodeID, location, flags = buffer.readVarInt(), buffer.readOptionalLocation(), readRequiredNode(), buffer.readOptionalLocation(), readOptionalNode(), readOptionalNode(), buffer.readOptionalLocation()); - case 68: - return new ImaginaryNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode()); - case 69: - return new ImplicitNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode()); - case 70: - return new ImplicitRestNode(nodeID, location, flags = buffer.readVarInt()); - case 71: - return new InNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), readOptionalNode(), buffer.readLocation(), buffer.readOptionalLocation()); - case 72: - return new IndexAndWriteNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), buffer.readOptionalLocation(), buffer.readLocation(), readOptionalNode(), buffer.readLocation(), readOptionalNode(), buffer.readLocation(), readRequiredNode()); - case 73: - return new IndexOperatorWriteNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), buffer.readOptionalLocation(), buffer.readLocation(), readOptionalNode(), buffer.readLocation(), readOptionalNode(), readRequiredConstant(), buffer.readLocation(), readRequiredNode()); - case 74: - return new IndexOrWriteNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), buffer.readOptionalLocation(), buffer.readLocation(), readOptionalNode(), buffer.readLocation(), readOptionalNode(), buffer.readLocation(), readRequiredNode()); - case 75: - return new IndexTargetNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), buffer.readLocation(), readOptionalNode(), buffer.readLocation(), readOptionalNode()); - case 76: - return new InstanceVariableAndWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), buffer.readLocation(), readRequiredNode()); - case 77: - return new InstanceVariableOperatorWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), buffer.readLocation(), readRequiredNode(), readRequiredConstant()); - case 78: - return new InstanceVariableOrWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), buffer.readLocation(), readRequiredNode()); - case 79: - return new InstanceVariableReadNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant()); - case 80: - return new InstanceVariableTargetNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant()); - case 81: - return new InstanceVariableWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), readRequiredNode(), buffer.readLocation()); - case 82: - return new IntegerNode(nodeID, location, flags = buffer.readVarInt(), readInteger()); - case 83: - return new InterpolatedMatchLastLineNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), buffer.readLocation()); - case 84: - return new InterpolatedRegularExpressionNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), buffer.readLocation()); - case 85: - return new InterpolatedStringNode(nodeID, location, flags = buffer.readVarInt(), buffer.readOptionalLocation(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), buffer.readOptionalLocation()); - case 86: - return new InterpolatedSymbolNode(nodeID, location, flags = buffer.readVarInt(), buffer.readOptionalLocation(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), buffer.readOptionalLocation()); - case 87: - return new InterpolatedXStringNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), buffer.readLocation()); - case 88: - return new ItLocalVariableReadNode(nodeID, location, flags = buffer.readVarInt()); - case 89: - return new ItParametersNode(nodeID, location, flags = buffer.readVarInt()); - case 90: - return new KeywordHashNode(nodeID, location, flags = buffer.readVarInt(), Array.from({ length: buffer.readVarInt() }, readRequiredNode)); - case 91: - return new KeywordRestParameterNode(nodeID, location, flags = buffer.readVarInt(), readOptionalConstant(), buffer.readOptionalLocation(), buffer.readLocation()); - case 92: - return new LambdaNode(nodeID, location, flags = buffer.readVarInt(), Array.from({ length: buffer.readVarInt() }, readRequiredConstant), buffer.readLocation(), buffer.readLocation(), buffer.readLocation(), readOptionalNode(), readOptionalNode()); - case 93: - return new LocalVariableAndWriteNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), buffer.readLocation(), readRequiredNode(), readRequiredConstant(), buffer.readVarInt()); - case 94: - return new LocalVariableOperatorWriteNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), buffer.readLocation(), readRequiredNode(), readRequiredConstant(), readRequiredConstant(), buffer.readVarInt()); - case 95: - return new LocalVariableOrWriteNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), buffer.readLocation(), readRequiredNode(), readRequiredConstant(), buffer.readVarInt()); - case 96: - return new LocalVariableReadNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readVarInt()); - case 97: - return new LocalVariableTargetNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readVarInt()); - case 98: - return new LocalVariableWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readVarInt(), buffer.readLocation(), readRequiredNode(), buffer.readLocation()); - case 99: - return new MatchLastLineNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), buffer.readLocation(), buffer.readLocation(), buffer.readStringField(flags)); - case 100: - return new MatchPredicateNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), readRequiredNode(), buffer.readLocation()); - case 101: - return new MatchRequiredNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), readRequiredNode(), buffer.readLocation()); - case 102: - return new MatchWriteNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), Array.from({ length: buffer.readVarInt() }, readRequiredNode)); - case 103: - return new MissingNode(nodeID, location, flags = buffer.readVarInt()); - case 104: - return new ModuleNode(nodeID, location, flags = buffer.readVarInt(), Array.from({ length: buffer.readVarInt() }, readRequiredConstant), buffer.readLocation(), readRequiredNode(), readOptionalNode(), buffer.readLocation(), readRequiredConstant()); - case 105: - return new MultiTargetNode(nodeID, location, flags = buffer.readVarInt(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), readOptionalNode(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), buffer.readOptionalLocation(), buffer.readOptionalLocation()); - case 106: - return new MultiWriteNode(nodeID, location, flags = buffer.readVarInt(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), readOptionalNode(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), buffer.readOptionalLocation(), buffer.readOptionalLocation(), buffer.readLocation(), readRequiredNode()); - case 107: - return new NextNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), buffer.readLocation()); - case 108: - return new NilNode(nodeID, location, flags = buffer.readVarInt()); - case 109: - return new NoKeywordsParameterNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), buffer.readLocation()); - case 110: - return new NumberedParametersNode(nodeID, location, flags = buffer.readVarInt(), buffer.readByte()); - case 111: - return new NumberedReferenceReadNode(nodeID, location, flags = buffer.readVarInt(), buffer.readVarInt()); - case 112: - return new OptionalKeywordParameterNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), readRequiredNode()); - case 113: - return new OptionalParameterNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation(), buffer.readLocation(), readRequiredNode()); - case 114: - return new OrNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), readRequiredNode(), buffer.readLocation()); - case 115: - return new ParametersNode(nodeID, location, flags = buffer.readVarInt(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), Array.from({ length: buffer.readVarInt() }, readRequiredNode), readOptionalNode(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), Array.from({ length: buffer.readVarInt() }, readRequiredNode), readOptionalNode(), readOptionalNode()); - case 116: - return new ParenthesesNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), buffer.readLocation(), buffer.readLocation()); - case 117: - return new PinnedExpressionNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), buffer.readLocation(), buffer.readLocation(), buffer.readLocation()); - case 118: - return new PinnedVariableNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), buffer.readLocation()); - case 119: - return new PostExecutionNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), buffer.readLocation(), buffer.readLocation(), buffer.readLocation()); - case 120: - return new PreExecutionNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), buffer.readLocation(), buffer.readLocation(), buffer.readLocation()); - case 121: - return new ProgramNode(nodeID, location, flags = buffer.readVarInt(), Array.from({ length: buffer.readVarInt() }, readRequiredConstant), readRequiredNode()); - case 122: - return new RangeNode(nodeID, location, flags = buffer.readVarInt(), readOptionalNode(), readOptionalNode(), buffer.readLocation()); - case 123: - return new RationalNode(nodeID, location, flags = buffer.readVarInt(), readInteger(), readInteger()); - case 124: - return new RedoNode(nodeID, location, flags = buffer.readVarInt()); - case 125: - return new RegularExpressionNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), buffer.readLocation(), buffer.readLocation(), buffer.readStringField(flags)); - case 126: - return new RequiredKeywordParameterNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant(), buffer.readLocation()); - case 127: - return new RequiredParameterNode(nodeID, location, flags = buffer.readVarInt(), readRequiredConstant()); - case 128: - return new RescueModifierNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode(), buffer.readLocation(), readRequiredNode()); - case 129: - return new RescueNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), buffer.readOptionalLocation(), readOptionalNode(), buffer.readOptionalLocation(), readOptionalNode(), readOptionalNode()); - case 130: - return new RestParameterNode(nodeID, location, flags = buffer.readVarInt(), readOptionalConstant(), buffer.readOptionalLocation(), buffer.readLocation()); - case 131: - return new RetryNode(nodeID, location, flags = buffer.readVarInt()); - case 132: - return new ReturnNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), readOptionalNode()); - case 133: - return new SelfNode(nodeID, location, flags = buffer.readVarInt()); - case 134: - return new ShareableConstantNode(nodeID, location, flags = buffer.readVarInt(), readRequiredNode()); - case 135: - return new SingletonClassNode(nodeID, location, flags = buffer.readVarInt(), Array.from({ length: buffer.readVarInt() }, readRequiredConstant), buffer.readLocation(), buffer.readLocation(), readRequiredNode(), readOptionalNode(), buffer.readLocation()); - case 136: - return new SourceEncodingNode(nodeID, location, flags = buffer.readVarInt()); - case 137: - return new SourceFileNode(nodeID, location, flags = buffer.readVarInt(), buffer.readStringField(flags)); - case 138: - return new SourceLineNode(nodeID, location, flags = buffer.readVarInt()); - case 139: - return new SplatNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), readOptionalNode()); - case 140: - return new StatementsNode(nodeID, location, flags = buffer.readVarInt(), Array.from({ length: buffer.readVarInt() }, readRequiredNode)); - case 141: - return new StringNode(nodeID, location, flags = buffer.readVarInt(), buffer.readOptionalLocation(), buffer.readLocation(), buffer.readOptionalLocation(), buffer.readStringField(flags)); - case 142: - return new SuperNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), buffer.readOptionalLocation(), readOptionalNode(), buffer.readOptionalLocation(), readOptionalNode()); - case 143: - return new SymbolNode(nodeID, location, flags = buffer.readVarInt(), buffer.readOptionalLocation(), buffer.readOptionalLocation(), buffer.readOptionalLocation(), buffer.readStringField(flags)); - case 144: - return new TrueNode(nodeID, location, flags = buffer.readVarInt()); - case 145: - return new UndefNode(nodeID, location, flags = buffer.readVarInt(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), buffer.readLocation()); - case 146: - return new UnlessNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), readRequiredNode(), buffer.readOptionalLocation(), readOptionalNode(), readOptionalNode(), buffer.readOptionalLocation()); - case 147: - return new UntilNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), buffer.readOptionalLocation(), buffer.readOptionalLocation(), readRequiredNode(), readOptionalNode()); - case 148: - return new WhenNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), Array.from({ length: buffer.readVarInt() }, readRequiredNode), buffer.readOptionalLocation(), readOptionalNode()); - case 149: - return new WhileNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), buffer.readOptionalLocation(), buffer.readOptionalLocation(), readRequiredNode(), readOptionalNode()); - case 150: - return new XStringNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), buffer.readLocation(), buffer.readLocation(), buffer.readStringField(flags)); - case 151: - return new YieldNode(nodeID, location, flags = buffer.readVarInt(), buffer.readLocation(), buffer.readOptionalLocation(), readOptionalNode(), buffer.readOptionalLocation()); - default: - throw new Error(`Unknown node type: ${type}`); - } + /** + * Transforms the Node to a JavaScript object. + * + * @returns {Object} + */ + toJSON() { + return { + type: "TrueNode", + location: this.location, + flags: this.#flags + }; } - function readOptionalNode() { - if (buffer.readByte() != 0) { - buffer.index -= 1; - return readRequiredNode(); - } else { - return null; - } + }; + var UndefNode = class { + /** + * @type number + */ + nodeID; + /** + * @type {Location} + */ + location; + /** + * @type number + */ + #flags; + /** + * @type Node[] + */ + names; + /** + * @type Location + */ + keywordLoc; + /** + * Construct a new UndefNode. + * + * @param {number} nodeID + * @param {Location} location + * @param {number} flags + * @param {Node[]} names + * @param {Location} keywordLoc + */ + constructor(nodeID, location, flags, names, keywordLoc) { + this.nodeID = nodeID; + this.location = location; + this.#flags = flags; + this.names = names; + this.keywordLoc = keywordLoc; } - function scanConstant(constantIndex) { - if (constants[constantIndex] === null) { - constants[constantIndex] = buffer.scanConstant(constantPoolOffset, constantIndex); - } - return constants[constantIndex]; + /** + * Accept a visitor for this node. + * + * @param {visitors.Visitor} visitor + */ + accept(visitor) { + visitor.visitUndefNode(this); } - function readRequiredConstant() { - return scanConstant(buffer.readVarInt() - 1); + /** + * Returns all child nodes of the current node. + * + * @returns {(Node | null)[]} An array of child nodes. + */ + childNodes() { + return [...this.names]; } - function readOptionalConstant() { - const index = buffer.readVarInt(); - if (index === 0) { - return null; - } else { - return scanConstant(index - 1); - } + /** + * Compact and return an array of child nodes. + * + * @returns {Node[]} An array of compacted child nodes. + */ + compactChildNodes() { + return [...this.names]; } - function readInteger() { - const negative = buffer.readByte() != 0; - const length = buffer.readVarInt(); - const firstWord = buffer.readVarInt(); - if (length == 1) { - if (negative && firstWord >= 2147483648) { - return -BigInt(firstWord); - } else if (negative) { - return -firstWord; - } else { - return firstWord; - } + /** + * Transforms the Node to a JavaScript object. + * + * @returns {Object} + */ + toJSON() { + return { + type: "UndefNode", + location: this.location, + flags: this.#flags, + names: this.names, + keywordLoc: this.keywordLoc + }; + } + }; + var UnlessNode = class { + /** + * @type number + */ + nodeID; + /** + * @type {Location} + */ + location; + /** + * @type number + */ + #flags; + /** + * @type Location + */ + keywordLoc; + /** + * @type Node + */ + predicate; + /** + * @type Location | null + */ + thenKeywordLoc; + /** + * @type StatementsNode | null + */ + statements; + /** + * @type ElseNode | null + */ + elseClause; + /** + * @type Location | null + */ + endKeywordLoc; + /** + * Construct a new UnlessNode. + * + * @param {number} nodeID + * @param {Location} location + * @param {number} flags + * @param {Location} keywordLoc + * @param {Node} predicate + * @param {Location | null} thenKeywordLoc + * @param {StatementsNode | null} statements + * @param {ElseNode | null} elseClause + * @param {Location | null} endKeywordLoc + */ + constructor(nodeID, location, flags, keywordLoc, predicate, thenKeywordLoc, statements, elseClause, endKeywordLoc) { + this.nodeID = nodeID; + this.location = location; + this.#flags = flags; + this.keywordLoc = keywordLoc; + this.predicate = predicate; + this.thenKeywordLoc = thenKeywordLoc; + this.statements = statements; + this.elseClause = elseClause; + this.endKeywordLoc = endKeywordLoc; + } + /** + * Accept a visitor for this node. + * + * @param {visitors.Visitor} visitor + */ + accept(visitor) { + visitor.visitUnlessNode(this); + } + /** + * Returns all child nodes of the current node. + * + * @returns {(Node | null)[]} An array of child nodes. + */ + childNodes() { + return [this.predicate, this.statements, this.elseClause]; + } + /** + * Compact and return an array of child nodes. + * + * @returns {Node[]} An array of compacted child nodes. + */ + compactChildNodes() { + const compact = []; + compact.push(this.predicate); + if (this.statements) { + compact.push(this.statements); } - let result = BigInt(firstWord); - for (let index = 1; index < length; index++) { - result |= BigInt(buffer.readVarInt()) << BigInt(index * 32); + if (this.elseClause) { + compact.push(this.elseClause); } - return negative ? -result : result; + return compact; + } + /** + * Transforms the Node to a JavaScript object. + * + * @returns {Object} + */ + toJSON() { + return { + type: "UnlessNode", + location: this.location, + flags: this.#flags, + keywordLoc: this.keywordLoc, + predicate: this.predicate, + thenKeywordLoc: this.thenKeywordLoc, + statements: this.statements, + elseClause: this.elseClause, + endKeywordLoc: this.endKeywordLoc + }; } - } - - // node_modules/@herb-tools/core/dist/herb-core.esm.js - var HelperType; - (function(HelperType3) { - HelperType3["ActionCableMetaTag"] = "action_cable_meta_tag"; - HelperType3["ContentSecurityPolicyP"] = "content_security_policy?"; - HelperType3["ContentSecurityPolicyNonce"] = "content_security_policy_nonce"; - HelperType3["PolymorphicPath"] = "polymorphic_path"; - HelperType3["PolymorphicUrl"] = "polymorphic_url"; - HelperType3["FormAuthenticityToken"] = "form_authenticity_token"; - HelperType3["ProtectAgainstForgeryP"] = "protect_against_forgery?"; - HelperType3["RenderActionTextContent"] = "render_action_text_content"; - HelperType3["SanitizeActionTextContent"] = "sanitize_action_text_content"; - HelperType3["RichTextareaTag"] = "rich_textarea_tag"; - HelperType3["ErrorMessage"] = "error_message"; - HelperType3["ErrorWrapping"] = "error_wrapping"; - HelperType3["Object"] = "object"; - HelperType3["ApplyStylesheetMediaDefault"] = "apply_stylesheet_media_default"; - HelperType3["AudioTag"] = "audio_tag"; - HelperType3["AutoDiscoveryLinkTag"] = "auto_discovery_link_tag"; - HelperType3["AutoIncludeNonce"] = "auto_include_nonce"; - HelperType3["AutoIncludeNonceForScripts"] = "auto_include_nonce_for_scripts"; - HelperType3["AutoIncludeNonceForStyles"] = "auto_include_nonce_for_styles"; - HelperType3["FaviconLinkTag"] = "favicon_link_tag"; - HelperType3["ImageDecoding"] = "image_decoding"; - HelperType3["ImageLoading"] = "image_loading"; - HelperType3["ImageTag"] = "image_tag"; - HelperType3["JavascriptIncludeTag"] = "javascript_include_tag"; - HelperType3["PictureTag"] = "picture_tag"; - HelperType3["PreloadLinkTag"] = "preload_link_tag"; - HelperType3["PreloadLinksHeader"] = "preload_links_header"; - HelperType3["StylesheetLinkTag"] = "stylesheet_link_tag"; - HelperType3["VideoTag"] = "video_tag"; - HelperType3["AssetPath"] = "asset_path"; - HelperType3["AssetUrl"] = "asset_url"; - HelperType3["AudioPath"] = "audio_path"; - HelperType3["AudioUrl"] = "audio_url"; - HelperType3["ComputeAssetExtname"] = "compute_asset_extname"; - HelperType3["ComputeAssetHost"] = "compute_asset_host"; - HelperType3["ComputeAssetPath"] = "compute_asset_path"; - HelperType3["FontPath"] = "font_path"; - HelperType3["FontUrl"] = "font_url"; - HelperType3["ImagePath"] = "image_path"; - HelperType3["ImageUrl"] = "image_url"; - HelperType3["JavascriptPath"] = "javascript_path"; - HelperType3["JavascriptUrl"] = "javascript_url"; - HelperType3["PublicComputeAssetPath"] = "public_compute_asset_path"; - HelperType3["StylesheetPath"] = "stylesheet_path"; - HelperType3["StylesheetUrl"] = "stylesheet_url"; - HelperType3["VideoPath"] = "video_path"; - HelperType3["VideoUrl"] = "video_url"; - HelperType3["AtomFeed"] = "atom_feed"; - HelperType3["Cache"] = "cache"; - HelperType3["CacheFragmentName"] = "cache_fragment_name"; - HelperType3["CacheIf"] = "cache_if"; - HelperType3["CacheUnless"] = "cache_unless"; - HelperType3["CachingP"] = "caching?"; - HelperType3["DigestPathFromTemplate"] = "digest_path_from_template"; - HelperType3["FragmentFor"] = "fragment_for"; - HelperType3["FragmentNameWithDigest"] = "fragment_name_with_digest"; - HelperType3["ReadFragmentFor"] = "read_fragment_for"; - HelperType3["UncacheableBang"] = "uncacheable!"; - HelperType3["WriteFragmentFor"] = "write_fragment_for"; - HelperType3["Capture"] = "capture"; - HelperType3["ContentFor"] = "content_for"; - HelperType3["ContentForP"] = "content_for?"; - HelperType3["Provide"] = "provide"; - HelperType3["WithOutputBuffer"] = "with_output_buffer"; - HelperType3["PrependContentExfiltrationPrevention"] = "prepend_content_exfiltration_prevention"; - HelperType3["PreventContentExfiltration"] = "prevent_content_exfiltration"; - HelperType3["ActionName"] = "action_name"; - HelperType3["AssignController"] = "assign_controller"; - HelperType3["Controller"] = "controller"; - HelperType3["ControllerName"] = "controller_name"; - HelperType3["ControllerPath"] = "controller_path"; - HelperType3["Cookies"] = "cookies"; - HelperType3["Flash"] = "flash"; - HelperType3["Headers"] = "headers"; - HelperType3["Logger"] = "logger"; - HelperType3["Params"] = "params"; - HelperType3["Request"] = "request"; - HelperType3["RequestForgeryProtectionToken"] = "request_forgery_protection_token"; - HelperType3["Response"] = "response"; - HelperType3["Session"] = "session"; - HelperType3["CspMetaTag"] = "csp_meta_tag"; - HelperType3["CsrfMetaTags"] = "csrf_meta_tags"; - HelperType3["DateSelect"] = "date_select"; - HelperType3["DatetimeSelect"] = "datetime_select"; - HelperType3["DistanceOfTimeInWords"] = "distance_of_time_in_words"; - HelperType3["RelativeTimeInWords"] = "relative_time_in_words"; - HelperType3["SelectDate"] = "select_date"; - HelperType3["SelectDatetime"] = "select_datetime"; - HelperType3["SelectDay"] = "select_day"; - HelperType3["SelectHour"] = "select_hour"; - HelperType3["SelectMinute"] = "select_minute"; - HelperType3["SelectMonth"] = "select_month"; - HelperType3["SelectSecond"] = "select_second"; - HelperType3["SelectTime"] = "select_time"; - HelperType3["SelectYear"] = "select_year"; - HelperType3["TimeAgoInWords"] = "time_ago_in_words"; - HelperType3["TimeSelect"] = "time_select"; - HelperType3["TimeTag"] = "time_tag"; - HelperType3["Debug"] = "debug"; - HelperType3["ApplyFormForOptionsBang"] = "apply_form_for_options!"; - HelperType3["Button"] = "button"; - HelperType3["Checkbox"] = "checkbox"; - HelperType3["ColorField"] = "color_field"; - HelperType3["DateField"] = "date_field"; - HelperType3["DatetimeField"] = "datetime_field"; - HelperType3["EmailField"] = "email_field"; - HelperType3["EmittedHiddenIdP"] = "emitted_hidden_id?"; - HelperType3["Fields"] = "fields"; - HelperType3["FieldsFor"] = "fields_for"; - HelperType3["FileField"] = "file_field"; - HelperType3["FormFor"] = "form_for"; - HelperType3["FormWith"] = "form_with"; - HelperType3["FormWithGeneratesIds"] = "form_with_generates_ids"; - HelperType3["FormWithGeneratesRemoteForms"] = "form_with_generates_remote_forms"; - HelperType3["HiddenField"] = "hidden_field"; - HelperType3["Label"] = "label"; - HelperType3["MonthField"] = "month_field"; - HelperType3["Multipart"] = "multipart"; - HelperType3["MultipleFileFieldIncludeHidden"] = "multiple_file_field_include_hidden"; - HelperType3["NumberField"] = "number_field"; - HelperType3["PasswordField"] = "password_field"; - HelperType3["RadioButton"] = "radio_button"; - HelperType3["RangeField"] = "range_field"; - HelperType3["SearchField"] = "search_field"; - HelperType3["Submit"] = "submit"; - HelperType3["TelephoneField"] = "telephone_field"; - HelperType3["TextField"] = "text_field"; - HelperType3["Textarea"] = "textarea"; - HelperType3["TimeField"] = "time_field"; - HelperType3["UrlField"] = "url_field"; - HelperType3["WeekField"] = "week_field"; - HelperType3["CollectionCheckboxes"] = "collection_checkboxes"; - HelperType3["CollectionRadioButtons"] = "collection_radio_buttons"; - HelperType3["CollectionSelect"] = "collection_select"; - HelperType3["GroupedCollectionSelect"] = "grouped_collection_select"; - HelperType3["GroupedOptionsForSelect"] = "grouped_options_for_select"; - HelperType3["OptionGroupsFromCollectionForSelect"] = "option_groups_from_collection_for_select"; - HelperType3["OptionsForSelect"] = "options_for_select"; - HelperType3["OptionsFromCollectionForSelect"] = "options_from_collection_for_select"; - HelperType3["Select"] = "select"; - HelperType3["TimeZoneOptionsForSelect"] = "time_zone_options_for_select"; - HelperType3["TimeZoneSelect"] = "time_zone_select"; - HelperType3["WeekdayOptionsForSelect"] = "weekday_options_for_select"; - HelperType3["WeekdaySelect"] = "weekday_select"; - HelperType3["ButtonTag"] = "button_tag"; - HelperType3["CheckboxTag"] = "checkbox_tag"; - HelperType3["ColorFieldTag"] = "color_field_tag"; - HelperType3["DateFieldTag"] = "date_field_tag"; - HelperType3["DatetimeFieldTag"] = "datetime_field_tag"; - HelperType3["DefaultEnforceUtf8"] = "default_enforce_utf8"; - HelperType3["EmailFieldTag"] = "email_field_tag"; - HelperType3["EmbedAuthenticityTokenInRemoteForms"] = "embed_authenticity_token_in_remote_forms"; - HelperType3["FieldId"] = "field_id"; - HelperType3["FieldName"] = "field_name"; - HelperType3["FieldSetTag"] = "field_set_tag"; - HelperType3["FileFieldTag"] = "file_field_tag"; - HelperType3["FormTag"] = "form_tag"; - HelperType3["HiddenFieldTag"] = "hidden_field_tag"; - HelperType3["ImageSubmitTag"] = "image_submit_tag"; - HelperType3["LabelTag"] = "label_tag"; - HelperType3["MonthFieldTag"] = "month_field_tag"; - HelperType3["NumberFieldTag"] = "number_field_tag"; - HelperType3["PasswordFieldTag"] = "password_field_tag"; - HelperType3["RadioButtonTag"] = "radio_button_tag"; - HelperType3["RangeFieldTag"] = "range_field_tag"; - HelperType3["SearchFieldTag"] = "search_field_tag"; - HelperType3["SelectTag"] = "select_tag"; - HelperType3["SubmitTag"] = "submit_tag"; - HelperType3["TelephoneFieldTag"] = "telephone_field_tag"; - HelperType3["TextFieldTag"] = "text_field_tag"; - HelperType3["TextareaTag"] = "textarea_tag"; - HelperType3["TimeFieldTag"] = "time_field_tag"; - HelperType3["UrlFieldTag"] = "url_field_tag"; - HelperType3["Utf8EnforcerTag"] = "utf8_enforcer_tag"; - HelperType3["WeekFieldTag"] = "week_field_tag"; - HelperType3["EscapeJavascript"] = "escape_javascript"; - HelperType3["JavascriptCdataSection"] = "javascript_cdata_section"; - HelperType3["JavascriptTag"] = "javascript_tag"; - HelperType3["NumberToCurrency"] = "number_to_currency"; - HelperType3["NumberToHuman"] = "number_to_human"; - HelperType3["NumberToHumanSize"] = "number_to_human_size"; - HelperType3["NumberToPercentage"] = "number_to_percentage"; - HelperType3["NumberToPhone"] = "number_to_phone"; - HelperType3["NumberWithDelimiter"] = "number_with_delimiter"; - HelperType3["NumberWithPrecision"] = "number_with_precision"; - HelperType3["Raw"] = "raw"; - HelperType3["SafeJoin"] = "safe_join"; - HelperType3["ToSentence"] = "to_sentence"; - HelperType3["DomClass"] = "dom_class"; - HelperType3["DomId"] = "dom_id"; - HelperType3["DomTarget"] = "dom_target"; - HelperType3["ModelNameFromRecordOrClass"] = "model_name_from_record_or_class"; - HelperType3["Render"] = "render"; - HelperType3["Sanitize"] = "sanitize"; - HelperType3["SanitizeCss"] = "sanitize_css"; - HelperType3["SanitizerVendor"] = "sanitizer_vendor"; - HelperType3["StripLinks"] = "strip_links"; - HelperType3["StripTags"] = "strip_tags"; - HelperType3["CdataSection"] = "cdata_section"; - HelperType3["ContentTag"] = "content_tag"; - HelperType3["EscapeOnce"] = "escape_once"; - HelperType3["Tag"] = "tag"; - HelperType3["TokenList"] = "token_list"; - HelperType3["Concat"] = "concat"; - HelperType3["CurrentCycle"] = "current_cycle"; - HelperType3["Cycle"] = "cycle"; - HelperType3["Excerpt"] = "excerpt"; - HelperType3["Highlight"] = "highlight"; - HelperType3["Pluralize"] = "pluralize"; - HelperType3["ResetCycle"] = "reset_cycle"; - HelperType3["SafeConcat"] = "safe_concat"; - HelperType3["SimpleFormat"] = "simple_format"; - HelperType3["Truncate"] = "truncate"; - HelperType3["WordWrap"] = "word_wrap"; - HelperType3["DebugMissingTranslation"] = "debug_missing_translation"; - HelperType3["Localize"] = "localize"; - HelperType3["Translate"] = "translate"; - HelperType3["ButtonTo"] = "button_to"; - HelperType3["ButtonToGeneratesButtonTag"] = "button_to_generates_button_tag"; - HelperType3["CurrentPageP"] = "current_page?"; - HelperType3["LinkTo"] = "link_to"; - HelperType3["LinkToIf"] = "link_to_if"; - HelperType3["LinkToUnless"] = "link_to_unless"; - HelperType3["LinkToUnlessCurrent"] = "link_to_unless_current"; - HelperType3["MailTo"] = "mail_to"; - HelperType3["PhoneTo"] = "phone_to"; - HelperType3["SmsTo"] = "sms_to"; - HelperType3["UrlFor"] = "url_for"; - HelperType3["TurboExemptsPageFromCache"] = "turbo_exempts_page_from_cache"; - HelperType3["TurboExemptsPageFromCacheTag"] = "turbo_exempts_page_from_cache_tag"; - HelperType3["TurboExemptsPageFromPreview"] = "turbo_exempts_page_from_preview"; - HelperType3["TurboExemptsPageFromPreviewTag"] = "turbo_exempts_page_from_preview_tag"; - HelperType3["TurboPageRequiresReload"] = "turbo_page_requires_reload"; - HelperType3["TurboPageRequiresReloadTag"] = "turbo_page_requires_reload_tag"; - HelperType3["TurboRefreshMethodTag"] = "turbo_refresh_method_tag"; - HelperType3["TurboRefreshScrollTag"] = "turbo_refresh_scroll_tag"; - HelperType3["TurboRefreshesWith"] = "turbo_refreshes_with"; - HelperType3["TurboFrameTag"] = "turbo_frame_tag"; - HelperType3["TurboIncludeTags"] = "turbo_include_tags"; - HelperType3["TurboStreamActionTag"] = "turbo_stream_action_tag"; - HelperType3["TurboStreamRefreshTag"] = "turbo_stream_refresh_tag"; - HelperType3["TurboStream"] = "turbo_stream"; - HelperType3["TurboStreamFrom"] = "turbo_stream_from"; - })(HelperType || (HelperType = {})); - var actionCableMetaTagEntry = { - name: "action_cable_meta_tag", - type: HelperType.ActionCableMetaTag, - source: "ActionCable::Helpers::ActionCableHelper#action_cable_meta_tag", - gem: "actioncable", - output: "html", - visibility: "public", - tagName: "meta", - isVoid: true, - supportsBlock: false, - preferredForTag: false, - supported: false, - detectStyle: "call_name", - description: 'Returns an `"action-cable-url"` `` tag with the value of the URL specified in your configuration. Ensure this is above your JavaScript tag. Used by Action Cable to determine the URL of your WebSocket server.', - signature: "action_cable_meta_tag", - documentationURL: "https://api.rubyonrails.org/classes/ActionCable/Helpers/ActionCableHelper.html#method-i-action_cable_meta_tag", - implicitAttribute: null, - arguments: [], - options: [], - specialBehaviors: [], - aliases: [] - }; - var contentSecurityPolicyPEntry = { - name: "content_security_policy?", - type: HelperType.ContentSecurityPolicyP, - source: "ActionController::ContentSecurityPolicy#content_security_policy?", - gem: "actionpack", - output: "boolean", - visibility: "public", - tagName: null, - isVoid: false, - supportsBlock: false, - preferredForTag: false, - supported: false, - detectStyle: "call_name", - description: "Returns whether a Content-Security-Policy is present for the current request.", - signature: "content_security_policy?", - documentationURL: "", - implicitAttribute: null, - arguments: [], - options: [], - specialBehaviors: [], - aliases: [] - }; - var contentSecurityPolicyNonceEntry = { - name: "content_security_policy_nonce", - type: HelperType.ContentSecurityPolicyNonce, - source: "ActionController::ContentSecurityPolicy#content_security_policy_nonce", - gem: "actionpack", - output: "text", - visibility: "public", - tagName: null, - isVoid: false, - supportsBlock: false, - preferredForTag: false, - supported: false, - detectStyle: "call_name", - description: "Returns the Content-Security-Policy nonce for the current request. This nonce value is used in `