1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 18:29:17 +02:00

Rename filter_value_* to filter_behavior_literal_*.

This commit is contained in:
Simo Kinnunen 2014-02-11 23:09:23 +09:00
parent 077982f08a
commit b6ccc29d0c

View file

@ -218,9 +218,9 @@ module.exports.parseKeyCharacterMap = function(stream) {
return true return true
} }
return fail(char, state) return fail(char, state)
case 'filter_value': case 'filter_behavior_literal':
if (char === '\\') { if (char === '\\') {
state = 'filter_value_escape' state = 'filter_behavior_literal_escape'
return true return true
} }
if (char !== "'") { if (char !== "'") {
@ -228,17 +228,17 @@ module.exports.parseKeyCharacterMap = function(stream) {
type: 'literal' type: 'literal'
, value: char , value: char
}) })
state = 'filter_value_end' state = 'filter_behavior_literal_end'
return true return true
} }
return fail(char, state) return fail(char, state)
case 'filter_value_escape': case 'filter_behavior_literal_escape':
if (char === '\\' || char === '\'' || char === '"') { if (char === '\\' || char === '\'' || char === '"') {
lastRule.behaviors.push({ lastRule.behaviors.push({
type: 'literal' type: 'literal'
, value: char , value: char
}) })
state = 'filter_value_end' state = 'filter_behavior_literal_end'
return true return true
} }
if (char === 'n') { if (char === 'n') {
@ -246,7 +246,7 @@ module.exports.parseKeyCharacterMap = function(stream) {
type: 'literal' type: 'literal'
, value: '\n' , value: '\n'
}) })
state = 'filter_value_end' state = 'filter_behavior_literal_end'
return true return true
} }
if (char === 't') { if (char === 't') {
@ -254,15 +254,15 @@ module.exports.parseKeyCharacterMap = function(stream) {
type: 'literal' type: 'literal'
, value: '\t' , value: '\t'
}) })
state = 'filter_value_end' state = 'filter_behavior_literal_end'
return true return true
} }
if (char === 'u') { if (char === 'u') {
state = 'filter_value_unicode_1' state = 'filter_behavior_literal_unicode_1'
return true return true
} }
return fail(char, state) return fail(char, state)
case 'filter_value_end': case 'filter_behavior_literal_end':
if (char === '\'') { if (char === '\'') {
state = 'filter_behavior_start' state = 'filter_behavior_start'
return true return true
@ -277,7 +277,7 @@ module.exports.parseKeyCharacterMap = function(stream) {
return true return true
} }
if (char === "'") { if (char === "'") {
state = 'filter_value' state = 'filter_behavior_literal'
return true return true
} }
if (char === 'n') { if (char === 'n') {
@ -382,38 +382,38 @@ module.exports.parseKeyCharacterMap = function(stream) {
return true return true
} }
return fail(char, state) return fail(char, state)
case 'filter_value_unicode_1': case 'filter_behavior_literal_unicode_1':
if ((char >= '0' && char <= '9') || if ((char >= '0' && char <= '9') ||
(char >= 'a' && char <= 'f')) { (char >= 'a' && char <= 'f')) {
lastRule.behaviors.push(lastBehavior = { lastRule.behaviors.push(lastBehavior = {
type: 'literal' type: 'literal'
, value: parseInt(char, 16) << 12 , value: parseInt(char, 16) << 12
}) })
state = 'filter_value_unicode_2' state = 'filter_behavior_literal_unicode_2'
return true return true
} }
return fail(char, state) return fail(char, state)
case 'filter_value_unicode_2': case 'filter_behavior_literal_unicode_2':
if ((char >= '0' && char <= '9') || if ((char >= '0' && char <= '9') ||
(char >= 'a' && char <= 'f')) { (char >= 'a' && char <= 'f')) {
lastBehavior.value += parseInt(char, 16) << 8 lastBehavior.value += parseInt(char, 16) << 8
state = 'filter_value_unicode_3' state = 'filter_behavior_literal_unicode_3'
return true return true
} }
return fail(char, state) return fail(char, state)
case 'filter_value_unicode_3': case 'filter_behavior_literal_unicode_3':
if ((char >= '0' && char <= '9') || if ((char >= '0' && char <= '9') ||
(char >= 'a' && char <= 'f')) { (char >= 'a' && char <= 'f')) {
lastBehavior.value += parseInt(char, 16) << 4 lastBehavior.value += parseInt(char, 16) << 4
state = 'filter_value_unicode_4' state = 'filter_behavior_literal_unicode_4'
return true return true
} }
return fail(char, state) return fail(char, state)
case 'filter_value_unicode_4': case 'filter_behavior_literal_unicode_4':
if ((char >= '0' && char <= '9') || if ((char >= '0' && char <= '9') ||
(char >= 'a' && char <= 'f')) { (char >= 'a' && char <= 'f')) {
lastBehavior.value += parseInt(char, 16) lastBehavior.value += parseInt(char, 16)
state = 'filter_value_end' state = 'filter_behavior_literal_end'
return true return true
} }
return fail(char, state) return fail(char, state)