Skip to content

Commit

Permalink
Refactor read method
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedSabthar committed Nov 6, 2023
1 parent abb32d7 commit 9739d34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ballerina/copybook_reader.bal
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ class CopybookReader {
chars.push(data.value);
}
string token = "".'join(...chars);
if dataItem.isSigned() && (token.trim().startsWith("+") || token.trim().startsWith("-")) {
// Handle optional signs ex:S9
if dataItem.isSigned() && re`^(\+|-).*$`.find(token.trim()) !is () {
var additionalChar = self.copybookIterator.next();
if additionalChar !is () {
chars.push(additionalChar.value);
Expand Down

0 comments on commit 9739d34

Please sign in to comment.