Skip to content

Commit

Permalink
Addressed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dkumiszhan committed Jul 5, 2023
1 parent 85418e9 commit 1ddea79
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 4 deletions.
49 changes: 49 additions & 0 deletions public/syntax_diagram.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,45 @@
}
]
},
{
"type": "Rule",
"name": "searchClause",
"orgText": "",
"definition": [
{
"type": "Alternation",
"idx": 0,
"definition": [
{
"type": "Alternative",
"definition": [
{
"type": "Terminal",
"name": "PAYLOAD",
"label": "PAYLOAD",
"idx": 0,
"pattern": "payload"
},
{
"type": "Terminal",
"name": "CONTAINS",
"label": "contains",
"idx": 0,
"pattern": "contains"
},
{
"type": "Terminal",
"name": "STRING",
"label": "STRING",
"idx": 0,
"pattern": "\\\"[a-zA-Z0-9]+\\\""
}
]
}
]
}
]
},
{
"type": "Rule",
"name": "portItemClause",
Expand Down Expand Up @@ -265,6 +304,16 @@
"pattern": "([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])"
}
]
},
{
"type": "Alternative",
"definition": [
{
"type": "NonTerminal",
"name": "searchClause",
"idx": 0
}
]
}
]
}
Expand Down
6 changes: 2 additions & 4 deletions src/eventFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@ function filterByBooleanClause(event: Event, booleanClauseCstNode: BooleanClause
throw new Error('Unexpected missing portItemClause');
}
} else if (children.searchClause) {
let payloadString = children.searchClause[0].children.STRING[0].image.toLowerCase();
let payloadString = children.searchClause[0].children.STRING[0].image;
let trimmedString = payloadString.substring(1, payloadString.length - 1);

console.log(payloadString.length);
return event.payload.toLowerCase().includes(trimmedString);
return atob(event.payload).includes(trimmedString);
} else {
throw new Error('Unexpected booleanClauseCstNode');
}
Expand Down

0 comments on commit 1ddea79

Please sign in to comment.