mirror of
https://github.com/safing/portmaster
synced 2025-04-18 01:49:09 +00:00
Fix netquery textql parser when dealing with IP addresses
This commit is contained in:
parent
0e5b8b2e06
commit
6daea521c3
2 changed files with 60 additions and 10 deletions
desktop/angular
51
desktop/angular/.eslintrc.json
Normal file
51
desktop/angular/.eslintrc.json
Normal file
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"root": true,
|
||||
"ignorePatterns": [
|
||||
"projects/**/*"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"*.ts"
|
||||
],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@angular-eslint/recommended",
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
],
|
||||
"rules": {
|
||||
"@angular-eslint/directive-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "attribute",
|
||||
"prefix": "app",
|
||||
"style": "camelCase"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/component-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "element",
|
||||
"prefix": "app",
|
||||
"style": "kebab-case"
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-explicit-any": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"*.html"
|
||||
],
|
||||
"extends": [
|
||||
"plugin:@angular-eslint/template/recommended",
|
||||
"plugin:@angular-eslint/template/accessibility"
|
||||
],
|
||||
"rules": {
|
||||
"@angular-eslint/template/click-events-have-key-events": "off",
|
||||
"@angular-eslint/template/interactive-supports-focus": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -43,7 +43,7 @@ export class Lexer {
|
|||
}
|
||||
|
||||
/** reads a number token */
|
||||
private readNumber(): Token<TokenType.NUMBER> {
|
||||
private readNumber(): Token<TokenType.NUMBER> | null {
|
||||
const start = this._input.pos;
|
||||
|
||||
let has_dot = false;
|
||||
|
@ -59,9 +59,10 @@ export class Lexer {
|
|||
return isDigit(ch);
|
||||
});
|
||||
|
||||
if (!this._input.eof() && isIdentChar(this._input.peek())) {
|
||||
this._input.revert(number.length + 1);
|
||||
this._input.croak("invalid number character")
|
||||
if (!this._input.eof() && !isWhitespace(this._input.peek())) {
|
||||
this._input.revert(number.length);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -182,13 +183,11 @@ export class Lexer {
|
|||
return this.readString('\'', true);
|
||||
}
|
||||
|
||||
try {
|
||||
if (isDigit(ch)) {
|
||||
return this.readNumber();
|
||||
if (isDigit(ch)) {
|
||||
const number = this.readNumber();
|
||||
if (number !== null) {
|
||||
return number;
|
||||
}
|
||||
} catch (err) {
|
||||
// we ignore that error here as it may only happen for unqoted strings
|
||||
// that start with a number.
|
||||
}
|
||||
|
||||
if (ch === ':') {
|
||||
|
|
Loading…
Add table
Reference in a new issue