mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-01-22 15:08:12 -05:00
Support notes in rule lists.
This commit is contained in:
parent
a536ff5d98
commit
b1c261c39c
@ -95,6 +95,8 @@ module.exports = exports =
|
|||||||
ruleList += eol
|
ruleList += eol
|
||||||
specialLineStart = exports['Switchy'].specialLineStart + '+'
|
specialLineStart = exports['Switchy'].specialLineStart + '+'
|
||||||
for rule in rules
|
for rule in rules
|
||||||
|
if rule.note
|
||||||
|
ruleList += '@note ' + rule.note + eol
|
||||||
line = Conditions.str(rule.condition)
|
line = Conditions.str(rule.condition)
|
||||||
if useExclusive and rule.profileName == defaultProfileName
|
if useExclusive and rule.profileName == defaultProfileName
|
||||||
line = '!' + line
|
line = '!' + line
|
||||||
@ -185,6 +187,7 @@ module.exports = exports =
|
|||||||
rulesWithDefaultProfile = []
|
rulesWithDefaultProfile = []
|
||||||
withResult = false
|
withResult = false
|
||||||
exclusiveProfile = null
|
exclusiveProfile = null
|
||||||
|
noteForNextRule = null
|
||||||
lno = 0
|
lno = 0
|
||||||
for line in text.split(/\n|\r/)
|
for line in text.split(/\n|\r/)
|
||||||
lno++
|
lno++
|
||||||
@ -205,6 +208,8 @@ module.exports = exports =
|
|||||||
feature = line.toUpperCase()
|
feature = line.toUpperCase()
|
||||||
if feature == 'RESULT' or feature == 'RESULTS'
|
if feature == 'RESULT' or feature == 'RESULTS'
|
||||||
withResult = true
|
withResult = true
|
||||||
|
when 'NOTE'
|
||||||
|
noteForNextRule = line
|
||||||
continue
|
continue
|
||||||
|
|
||||||
source = null
|
source = null
|
||||||
@ -243,6 +248,9 @@ module.exports = exports =
|
|||||||
condition: cond
|
condition: cond
|
||||||
profileName: profile
|
profileName: profile
|
||||||
source: if includeSource then source ? line
|
source: if includeSource then source ? line
|
||||||
|
if noteForNextRule?
|
||||||
|
rule.note = noteForNextRule
|
||||||
|
noteForNextRule = null
|
||||||
rules.push(rule)
|
rules.push(rule)
|
||||||
if not profile
|
if not profile
|
||||||
rulesWithDefaultProfile.push(rule)
|
rulesWithDefaultProfile.push(rule)
|
||||||
|
Loading…
Reference in New Issue
Block a user