Loading lib/jsduck/css/lexer.rb +5 −5 Original line number Diff line number Diff line Loading @@ -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: Loading @@ -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, Loading lib/jsduck/doc/comment.rb +3 −3 Original line number Diff line number Diff line Loading @@ -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 Loading lib/jsduck/doc_formatter.rb +1 −1 Original line number Diff line number Diff line Loading @@ -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(/>/) Loading lib/jsduck/inline/auto_link.rb +2 −2 Original line number Diff line number Diff line Loading @@ -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") Loading @@ -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 Loading lib/jsduck/js/parser.rb +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
lib/jsduck/css/lexer.rb +5 −5 Original line number Diff line number Diff line Loading @@ -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: Loading @@ -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, Loading
lib/jsduck/doc/comment.rb +3 −3 Original line number Diff line number Diff line Loading @@ -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 Loading
lib/jsduck/doc_formatter.rb +1 −1 Original line number Diff line number Diff line Loading @@ -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(/>/) Loading
lib/jsduck/inline/auto_link.rb +2 −2 Original line number Diff line number Diff line Loading @@ -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") Loading @@ -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 Loading
lib/jsduck/js/parser.rb +1 −1 Original line number Diff line number Diff line Loading @@ -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