Commit 78196d59 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Replace \Z with \z in regexes.

I always intended \z, but mistakenly wrote \Z instead.
parent 43b1771d
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -107,12 +107,12 @@ module JsDuck
          elsif @input.check(/'/)
            return {
              :type => :string,
              :value => @input.scan(/'([^'\\]|\\.)*('|\Z)/m)
              :value => @input.scan(/'([^'\\]|\\.)*('|\z)/m)
            }
          elsif @input.check(/"/)
            return {
              :type => :string,
              :value => @input.scan(/"([^"\\]|\\.)*("|\Z)/m)
              :value => @input.scan(/"([^"\\]|\\.)*("|\z)/m)
            }
          elsif @input.check(/\//)
            # Several things begin with dash:
@@ -122,14 +122,14 @@ module JsDuck
                :type => :doc_comment,
                # Calculate current line number, starting with 1
                :linenr => @input.string[0...@input.pos].count("\n") + 1,
                :value => @input.scan_until(/\*\/|\Z/).sub(/\A\/\*\*/, "").sub(/\*\/\Z/, "")
                :value => @input.scan_until(/\*\/|\z/).sub(/\A\/\*\*/, "").sub(/\*\/\z/, "")
              }
            elsif @input.check(/\/\*/)
              # skip multiline comment
              @input.scan_until(/\*\/|\Z/)
              @input.scan_until(/\*\/|\z/)
            elsif @input.check(/\/\//)
              # skip line comment
              @input.scan_until(/\n|\Z/)
              @input.scan_until(/\n|\z/)
            else
              return {
                :type => :operator,
+3 −3
Original line number Diff line number Diff line
@@ -14,14 +14,14 @@ module JsDuck
        indent = nil
        input.each_line do |line|
          line.chomp!
          if line =~ /\A\s*\*\s?(.*)\Z/
          if line =~ /\A\s*\*\s?(.*)\z/
            # When comment contains *-lines, switch indent-trimming off
            indent = 0
            result << $1
          elsif line =~ /\A\s*\Z/
          elsif line =~ /\A\s*\z/
            # pass-through empty lines
            result << line
          elsif indent == nil && line =~ /\A(\s*)(.*?\Z)/
          elsif indent == nil && line =~ /\A(\s*)(.*?\z)/
            # When indent not measured, measure it and remember
            indent = $1.length
            result << $2
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ module JsDuck
          out += substitute
        elsif s.check(/<\w/)
          # Open HTML tag
          out += s.scan(/</) + tags.open(s.scan(/\w+/)) + s.scan_until(/>|\Z/)
          out += s.scan(/</) + tags.open(s.scan(/\w+/)) + s.scan_until(/>|\z/)
        elsif s.check(/<\/\w+>/)
          # Close HTML tag
          out += s.scan(/<\//) + tags.close(s.scan(/\w+/)) + s.scan(/>/)
+2 −2
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ module JsDuck
            cls2, member2 = split_to_cls_and_member(cls)
            if @relations[cls2] && @renderer.get_matching_member(cls2, {:name => member2})
              return @renderer.link(cls2, member2, cls2+"."+member2)
            elsif cls =~ /\.(js|css|html|php)\Z/
            elsif cls =~ /\.(js|css|html|php)\z/
              # Ignore common filenames
            else
              warn_magic_link("#{cls} links to non-existing class")
@@ -80,7 +80,7 @@ module JsDuck
        else
          if @renderer.get_matching_member(@class_context, {:name => member})
            return @renderer.link(@class_context, member, member)
          elsif member =~ /\A([A-F0-9]{3}|[A-F0-9]{6})\Z/i || member =~ /\A[0-9]/
          elsif member =~ /\A([A-F0-9]{3}|[A-F0-9]{6})\z/i || member =~ /\A[0-9]/
            # Ignore HEX color codes and
            # member names beginning with number
          else
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ module JsDuck
      # end of the first comment is allowed)
      def mergeable?(c1, c2)
        if c1["type"] == "Line" && c2["type"] == "Line"
          /\A(\r\n|\n|\r)?[ \t]*\Z/ =~ @input.slice((c1["range"][1])..(c2["range"][0]-1))
          /\A(\r\n|\n|\r)?[ \t]*\z/ =~ @input.slice((c1["range"][1])..(c2["range"][0]-1))
        else
          false
        end
Loading