Skip to content

Commit

Permalink
fix: RC in xschem version number breaks parser #14
Browse files Browse the repository at this point in the history
  • Loading branch information
urish committed Dec 4, 2024
1 parent 75b5d3c commit fffb103
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 103 deletions.
2 changes: 1 addition & 1 deletion src/parser/xschem-parser.peg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ VersionString
}

VersionNumber
= version:[0-9.]+ { return text(); }
= version:[0-9.]+[A-Z0-9]* { return text(); }

LicenseText
= text:[^}]* { return text.join(""); }
Expand Down
13 changes: 13 additions & 0 deletions src/parser/xschem-parser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,19 @@ spiceprefix=X
]);
});

it('parses a file with version number with RC suffix (issue #14)', () => {
const content = `v {xschem version=3.4.6RC file_version=1.2}`;
const result = parse(content);
expect(result).toEqual([
{
type: 'Version',
version: '3.4.6RC',
fileVersion: '1.2',
license: '',
},
]);
});

it('parses a version object that contains license text correctly', () => {
const content = `v {xschem version=3.4.5 file_version=1.2
* Copyright 2021 Stefan Frederik Schippers
Expand Down
Loading

0 comments on commit fffb103

Please sign in to comment.