Sha256: dd26be87cdd4ad9e07744e0785172784ca3ba750ace4e4658c94f8d2e1f69791

Contents?: true

Size: 1.26 KB

Versions: 14

Compression:

Stored size: 1.26 KB

Contents

# frozen_string_literal: true

module PlatformosCheck
  module LanguageServer
    module VariableLookupFinder
      module Constants
        ANY_STARTING_TAG = /\s*#{Liquid::AnyStartingTag}/
        ANY_ENDING_TAG = /#{Liquid::TagEnd}|#{Liquid::VariableEnd}\s*^/om

        UNCLOSED_SQUARE_BRACKET = /\[[^\]]*\Z/
        ENDS_IN_BRACKET_POSITION_THAT_CANT_BE_COMPLETED = /
          (
            # quotes not preceded by a [
            (?<!\[)['"]|
            # closing ]
            \]|
            # opening [
            \[
          )$
        /x

        VARIABLE_START = /\s*#{Liquid::VariableStart}/
        VARIABLE_LOOKUP_CHARACTERS = /[a-z0-9_.'"\]\[]/i
        VARIABLE_LOOKUP = /#{VARIABLE_LOOKUP_CHARACTERS}+/o
        SYMBOLS_PRECEDING_POTENTIAL_LOOKUPS = /
          (?:
            \s(?:
              if|elsif|unless|and|or|#{Liquid::Condition.operators.keys.join("|")}
              |echo
              |paginate
              |case|when
              |cycle
              |in
            )
            |[:,=]
          )
          \s+
        /omix
        ENDS_WITH_BLANK_POTENTIAL_LOOKUP = /#{SYMBOLS_PRECEDING_POTENTIAL_LOOKUPS}$/oimx
        ENDS_WITH_POTENTIAL_LOOKUP = /#{SYMBOLS_PRECEDING_POTENTIAL_LOOKUPS}#{VARIABLE_LOOKUP}$/oimx
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
platformos-check-0.4.3 lib/platformos_check/language_server/variable_lookup_finder/constants.rb
platformos-check-0.4.2 lib/platformos_check/language_server/variable_lookup_finder/constants.rb
platformos-check-0.4.1 lib/platformos_check/language_server/variable_lookup_finder/constants.rb
platformos-check-0.4.0 lib/platformos_check/language_server/variable_lookup_finder/constants.rb
platformos-check-0.3.3 lib/platformos_check/language_server/variable_lookup_finder/constants.rb
platformos-check-0.3.1 lib/platformos_check/language_server/variable_lookup_finder/constants.rb
platformos-check-0.3.0 lib/platformos_check/language_server/variable_lookup_finder/constants.rb
platformos-check-0.2.2 lib/platformos_check/language_server/variable_lookup_finder/constants.rb
platformos-check-0.2.1 lib/platformos_check/language_server/variable_lookup_finder/constants.rb
platformos-check-0.2.0 lib/platformos_check/language_server/variable_lookup_finder/constants.rb
platformos-check-0.1.0 lib/platformos_check/language_server/variable_lookup_finder/constants.rb
platformos-check-0.0.3 lib/platformos_check/language_server/variable_lookup_finder/constants.rb
platformos-check-0.0.2 lib/platformos_check/language_server/variable_lookup_finder/constants.rb
platformos-check-0.0.1 lib/platformos_check/language_server/variable_lookup_finder/constants.rb