Add comments to the input parser #75

Closed
opened 5 months ago by kimimaru · 1 comments
Owner

Add comments that can be enclosed in "//". For example, //this is for testing// would be a comment. Using comments in a valid input string like a up _right400ms //this is for testing// b450ms would ignore the comment, resulting in a up _right400ms b450ms.

This should be possible to implement with a new IPreparser called RemoveCommentPreparser, which would simply remove all comments matched via a regex pattern.

The regex pattern could look like the following, which will capture anything enclosed in two forward slashes aside from forward slash itself:
(\/\/)([^\/]+)(\/\/)

Macros should preserve all comments when added. To achieve this, remove comments from both the given macro value and the parsed one for comparison; if the comparison succeeds, add the original macro value without the comments removed.

Add comments that can be enclosed in "//". For example, `//this is for testing//` would be a comment. Using comments in a valid input string like `a up _right400ms //this is for testing// b450ms` would ignore the comment, resulting in `a up _right400ms b450ms`. This should be possible to implement with a new `IPreparser` called `RemoveCommentPreparser`, which would simply remove all comments matched via a regex pattern. The regex pattern could look like the following, which will capture anything enclosed in two forward slashes aside from forward slash itself: `(\/\/)([^\/]+)(\/\/)` Macros should preserve all comments when added. To achieve this, remove comments from both the given macro value and the parsed one for comparison; if the comparison succeeds, add the original macro value without the comments removed.
kimimaru added the
enhancement
label 5 months ago
kimimaru added this to the TRBot 2.4 project 5 months ago
Poster
Owner

Completed in 3f264d5470. New tests were added, and all tests pass, so this is good to go.

Will wait on merging into develop until over issues are resolved.

Completed in https://codeberg.org/kimimaru/TRBot/commit/3f264d54703fc094d8e45b0a5363bebc9be867fc. New tests were added, and all tests pass, so this is good to go. Will wait on merging into develop until over issues are resolved.
kimimaru closed this issue 5 months ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.