From 225460489fa87e7ffabb3e61a347822120458174 Mon Sep 17 00:00:00 2001 From: Chris Fraire Date: Fri, 10 Apr 2020 21:25:40 -0500 Subject: [PATCH] Fix rare uncounted Ruby LOC --- .../java/org/opengrok/indexer/analysis/ruby/RubyAnalyzer.java | 4 ++-- .../src/main/resources/analysis/ruby/RubyProductions.lexh | 3 ++- .../java/org/opengrok/indexer/analysis/ruby/RubyXrefTest.java | 4 ++-- .../src/test/resources/analysis/ruby/ruby_xrefres.html | 4 +++- opengrok-indexer/src/test/resources/analysis/ruby/sample.rb | 2 ++ 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/ruby/RubyAnalyzer.java b/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/ruby/RubyAnalyzer.java index 225d04238d5..d079d1dfd6d 100644 --- a/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/ruby/RubyAnalyzer.java +++ b/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/ruby/RubyAnalyzer.java @@ -58,11 +58,11 @@ public String getCtagsLang() { * Gets a version number to be used to tag processed documents so that * re-analysis can be re-done later if a stored version number is different * from the current implementation. - * @return 20190118_01 + * @return 20200410_00 */ @Override protected int getSpecializedVersionNo() { - return 20190118_01; // Edit comment above too! + return 20200410_00; // Edit comment above too! } /** diff --git a/opengrok-indexer/src/main/resources/analysis/ruby/RubyProductions.lexh b/opengrok-indexer/src/main/resources/analysis/ruby/RubyProductions.lexh index 6fc20d0ccda..93fd1afda34 100644 --- a/opengrok-indexer/src/main/resources/analysis/ruby/RubyProductions.lexh +++ b/opengrok-indexer/src/main/resources/analysis/ruby/RubyProductions.lexh @@ -19,7 +19,7 @@ /* * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. - * Portions Copyright (c) 2017, 2019, Chris Fraire . + * Portions Copyright (c) 2017, 2019-2020, Chris Fraire . */ /* @@ -483,6 +483,7 @@ Here_EOF3 = [\`][^\r\n\`]*[\`] } // Only one char at a time due to restriction on {WhspChar} above. [^\n\r] { + chkLOC(); maybeIntraState(); offer(yytext()); } diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/ruby/RubyXrefTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/ruby/RubyXrefTest.java index bea71b0b8db..077b0e2f2c4 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/ruby/RubyXrefTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/ruby/RubyXrefTest.java @@ -19,7 +19,7 @@ /* * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. - * Portions Copyright (c) 2017, 2019, Chris Fraire . + * Portions Copyright (c) 2017, 2019-2020, Chris Fraire . */ package org.opengrok.indexer.analysis.ruby; @@ -45,7 +45,7 @@ public void sampleTest() throws IOException { writeAndCompare(new RubyAnalyzerFactory(), "analysis/ruby/sample.rb", "analysis/ruby/ruby_xrefres.html", - readTagsFromResource("analysis/ruby/sampletags"), 159); + readTagsFromResource("analysis/ruby/sampletags"), 161); } @Test diff --git a/opengrok-indexer/src/test/resources/analysis/ruby/ruby_xrefres.html b/opengrok-indexer/src/test/resources/analysis/ruby/ruby_xrefres.html index 814b065a087..6e272d04c27 100644 --- a/opengrok-indexer/src/test/resources/analysis/ruby/ruby_xrefres.html +++ b/opengrok-indexer/src/test/resources/analysis/ruby/ruby_xrefres.html @@ -183,5 +183,7 @@ 177print 'http://example.com' 178puts "Last #{log_lines} lines from #{logfn}:" 179print "\n" -180 +180; +181; +182 diff --git a/opengrok-indexer/src/test/resources/analysis/ruby/sample.rb b/opengrok-indexer/src/test/resources/analysis/ruby/sample.rb index 23ebadceee0..63240faf54b 100644 --- a/opengrok-indexer/src/test/resources/analysis/ruby/sample.rb +++ b/opengrok-indexer/src/test/resources/analysis/ruby/sample.rb @@ -177,3 +177,5 @@ def right print 'http://example.com' puts "Last #{log_lines} lines from #{logfn}:" print "\n" +; +;