Skip to content

Commit 442e22a

Browse files
committed
Issue #277 - Fix implementation of RECNO/NUMBER keyword
1 parent bc20b42 commit 442e22a

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ This version is liberally based on the [**CMS Pipelines User's Guide and Referen
1010

1111
News
1212
====
13+
03-Jan-2025: Version 0.9.5-HF1 is here
14+
What's new:
15+
* Fixes a bug where `RECNO` within a loop returned the number of iterations of the loop rather than the numbers of records read.
16+
17+
NOTE: This is a non-backwards-compatible change.
18+
19+
1320
29-Dec-2024: Version 0.9.5 is here
1421
What's New:
1522
* The `exact()` function prototype for compatibility.
@@ -22,13 +29,6 @@ What's New:
2229
* A new `--progress` command-line switch to allow the user to monitor progress in reading records.
2330
* Bug fixes
2431

25-
10-May-2024: Version 0.9.2 is here
26-
What's New:
27-
* An unthreaded mode of operation
28-
* Compound `SET` statements
29-
* Reduced necessity of quoting complex conditions for `if` and `while`
30-
* Bug fixes
31-
3232

3333
Sources
3434
=======
@@ -40,7 +40,7 @@ Building
4040
========
4141
If you have downloaded a git repository, first make sure to check out a stable tag such as v0.9.5:
4242
```
43-
git checkout v0.9.5
43+
git checkout dev-0.9.5-hf1
4444
```
4545
A simple way to get the latest stable release is to check out the `stable` branch and rebase to its tip:
4646
```

manpage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.\" Manpage for specs.
22
.\" Open an issue at https://github.com/yoavnir/specs2016 to correct errors or typos
33
.mso www.tmac
4-
.TH man 1 "1 Jan 2025" "0.9.5" "specs man page"
4+
.TH man 1 "1 Jan 2025" "0.9.5-HF1" "specs man page"
55
.SH NAME
66
specs \- a text processing tool
77
.SH SYNOPSIS

specs/src/specitems/InputPart.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ std::string NumberPart::Debug()
142142

143143
PSpecString NumberPart::getStr(ProcessingState& pState)
144144
{
145-
std::string s = std::to_string(++m_Num);
145+
std::string s = std::to_string(pState.getRecordCount());
146146
s = std::string(NUMBER_PART_FIELD_LEN - s.length(), ' ') + s;
147147
return std::make_shared<std::string>(s);
148148
}

specs/src/test/ProcessingTest.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,11 @@ int main(int argc, char** argv)
741741
spec = "SUBSTR WS / WORD 3 of FS i FIELD 2";
742742
VERIFY2(spec, "The Epic: 1/Jan/1970 at midnight", "1970 at m"); // Test #186
743743

744+
// RECNO - Issue #277
745+
spec = "WORD 1 a: IF a%2==0 THEN RECNO 1";
746+
VERIFY2(spec, "1\n2\n3\n4\n5", " 2\n 4"); // Test #187
747+
748+
744749
if (errorCount) {
745750
std::cout << '\n' << errorCount << '/' << testCount << " tests failed.\n";
746751
std::cout << "Failed tests: ";

specs/tests/valgrind_unit_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys, memcheck, argparse
22

33
count_ALU_tests = 749
4-
count_processing_tests = 186
4+
count_processing_tests = 187
55
count_token_tests = 17
66

77
# Parse the one command line options

0 commit comments

Comments
 (0)