@@ -92,8 +92,11 @@ export const AST_FLAG_HAS_OPTIONS = 1 << iota++;
9292
9393iota = 0 ;
9494export const AST_ERROR_NONE = 1 << iota ++ ;
95- export const AST_ERROR_BAD_REGEX = 1 << iota ++ ;
96- export const AST_ERROR_BAD_PATTERN = 1 << iota ++ ;
95+ export const AST_ERROR_REGEX = 1 << iota ++ ;
96+ export const AST_ERROR_PATTERN = 1 << iota ++ ;
97+ export const AST_ERROR_DOMAIN_NAME = 1 << iota ++ ;
98+ export const AST_ERROR_OPTION_DUPLICATE = 1 << iota ++ ;
99+ export const AST_ERROR_OPTION_UNKNOWN = 1 << iota ++ ;
97100
98101iota = 0 ;
99102const NODE_RIGHT_INDEX = iota ++ ;
@@ -1278,6 +1281,7 @@ export class AstFilterParser {
12781281 realBad = isNegated || hasValue ;
12791282 break ;
12801283 case NODE_TYPE_NET_OPTION_NAME_UNKNOWN :
1284+ this . astError = AST_ERROR_OPTION_UNKNOWN ;
12811285 realBad = true ;
12821286 break ;
12831287 case NODE_TYPE_NET_OPTION_NAME_WEBRTC :
@@ -1481,7 +1485,7 @@ export class AstFilterParser {
14811485 }
14821486 } else {
14831487 this . astTypeFlavor = AST_TYPE_NETWORK_PATTERN_BAD ;
1484- this . astError = AST_ERROR_BAD_REGEX ;
1488+ this . astError = AST_ERROR_REGEX ;
14851489 this . addFlags ( AST_FLAG_HAS_ERROR ) ;
14861490 this . addNodeFlags ( next , NODE_FLAG_ERROR ) ;
14871491 }
@@ -1602,7 +1606,7 @@ export class AstFilterParser {
16021606 if ( normal === undefined ) {
16031607 this . astTypeFlavor = AST_TYPE_NETWORK_PATTERN_BAD ;
16041608 this . addFlags ( AST_FLAG_HAS_ERROR ) ;
1605- this . astError = AST_ERROR_BAD_PATTERN ;
1609+ this . astError = AST_ERROR_PATTERN ;
16061610 this . addNodeFlags ( next , NODE_FLAG_ERROR ) ;
16071611 } else if ( normal === '' || pattern === '*' ) {
16081612 this . astTypeFlavor = AST_TYPE_NETWORK_PATTERN_ANY ;
@@ -1813,6 +1817,7 @@ export class AstFilterParser {
18131817 if ( this . getBranchFromType ( nodeOptionType ) !== 0 ) {
18141818 this . addNodeFlags ( parent , NODE_FLAG_ERROR ) ;
18151819 this . addFlags ( AST_FLAG_HAS_ERROR ) ;
1820+ this . astError = AST_ERROR_OPTION_DUPLICATE ;
18161821 } else {
18171822 this . addNodeToRegister ( nodeOptionType , parent ) ;
18181823 }
@@ -1956,6 +1961,7 @@ export class AstFilterParser {
19561961 } else {
19571962 this . addNodeFlags ( parent , NODE_FLAG_ERROR ) ;
19581963 this . addFlags ( AST_FLAG_HAS_ERROR ) ;
1964+ this . astError = AST_ERROR_DOMAIN_NAME ;
19591965 }
19601966 }
19611967 if ( head === 0 ) {
0 commit comments