Skip to content

Commit

Permalink
feat: Fix valid_semver regex
Browse files Browse the repository at this point in the history
  • Loading branch information
liamwh committed Apr 29, 2024
1 parent 0153006 commit 0652a1b
Show file tree
Hide file tree
Showing 4 changed files with 500 additions and 447 deletions.
3 changes: 2 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ module.exports = grammar({

id: $ => /%?(([a-z][a-z0-9]*|[A-Z][A-Z0-9]*))(-([a-z][a-z0-9]*|[A-Z][A-Z0-9]*))*/,

valid_semver: $ => /\d+\.\d+\.\d+/,
// As per https://semver.org/, this regex allows for trailing metadata after MAJOR.MINOR.PATCH
valid_semver: $ => /(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?/,

world_item: $ => seq(
'world',
Expand Down
2 changes: 1 addition & 1 deletion src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0652a1b

Please sign in to comment.