Twasi / twasi-core

Core application and backend of the Twasi chatbot for Twitch.
MIT License
19 stars 4 forks source link

Optimise variable system #32

Closed DieserMerlin closed 5 years ago

DieserMerlin commented 5 years ago

Variable names should ignore non-alphanumeric chars (They should fit into a sentence like "$sender, you are amazing" instead of "$sender , you are amazing").

They also don't parse args correctly: (name [arg1, arg2, ...])

Input Parsed to (currently) Parsed to (should) Reason
$hello(world,123) hello ['world', '123'] hello ['world', '123'] Alright
$hello(world, 123) hello ['world'] hello ['world', '123'] Whitespace behind 'world,'
$hello(world,123 hello ['world', '123'] hello ['world', '123'] Parameter list is unclosed (dirty and error prone)

To prevent unexpected behavior they should have a smarter system that searches the closing bracket (if it has brackets, irrelevant if it hasn't) and automatically remove whitespaces between arguments.

They also need a system to prevent double variable registration.

DieserMerlin commented 5 years ago

Variables should also be nestable

DieserMerlin commented 5 years ago

https://github.com/Twasi/twasi-core/commit/283c30e82e19bf0906cab01676eeec56e177f8f4