Skip to content

Commit

Permalink
Fix regexp patterns and tests for Nevod language.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-surkov committed Mar 18, 2021
1 parent f971bae commit 66037d9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions components/prism-nevod.js
Expand Up @@ -12,7 +12,7 @@ Prism.languages.nevod = {
lookbehind: true,
},
'pattern': {
pattern: /(@pattern\s+)?#?[a-zA-Z0-9\-.]+(?:\s*(?:[(]\s*(?:(?:~\s*)?[a-zA-Z0-9\-.]+\s*(?:,\s*(?:(?:~\s*)?[a-zA-Z0-9\-.]*))*)[)]))?(?=\s*=)/,
pattern: /(@pattern\s+)?#?[a-zA-Z0-9\-.]+(?:\s*[(]\s*(?:~\s*)?[a-zA-Z0-9\-.]+\s*(?:,\s*(?:~\s*)?[a-zA-Z0-9\-.]*)*[)])?(?=\s*=)/,
lookbehind: true,
inside: {
'pattern-name': {
Expand Down Expand Up @@ -49,7 +49,7 @@ Prism.languages.nevod = {
alias: 'builtin',
},
'quantifier': {
pattern: /\b\d+\s*(?:\+|-\s*\d+)?(?=\W)/,
pattern: /\b\d+(?:\s*\+|\s*-\s*\d+)?(?!\w)/,
alias: 'number',
},
'standard-pattern-attr': {
Expand All @@ -60,7 +60,7 @@ Prism.languages.nevod = {
},
},
'quantifier': {
pattern: /\b\d+\s*(?:\+|-\s*\d+)?(?=\W)/,
pattern: /\b\d+(?:\s*\+|\s*-\s*\d+)?(?!\w)/,
alias: 'number',
},
'operator': [
Expand Down
2 changes: 1 addition & 1 deletion components/prism-nevod.min.js

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

6 changes: 4 additions & 2 deletions tests/languages/nevod/keyword_feature.test
@@ -1,11 +1,13 @@
@require @namespace @pattern @search
@inside @outside @having
@search @where
@where

----------------------------------------------------

[
["keyword", "@require"], ["keyword", "@namespace"], ["keyword", "@pattern"], ["keyword", "@search"],
["keyword", "@inside"], ["keyword", "@outside"], ["keyword", "@having"],
["keyword", "@search"], ["keyword", "@where"]
["keyword", "@where"]
]

----------------------------------------------------
Expand Down

0 comments on commit 66037d9

Please sign in to comment.