Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

‘=‘ in var definitions ends the definition #130

Closed
snoopyjc opened this issue Aug 17, 2019 · 3 comments
Closed

‘=‘ in var definitions ends the definition #130

snoopyjc opened this issue Aug 17, 2019 · 3 comments

Comments

@snoopyjc
Copy link
Contributor

If a var definition RHS contains a ‘=‘, that will act as the end of the definition. Instead it should be part of the variable value. Example:

! var website = https://www.rivescript.com/try/#/doc?x=y&more=more_stuff

+ where is your (website|web site|site)
- <bot website>

User: Where is your site?

Bot: https://www.rivescript.com/try/#/doc?x

@snoopyjc
Copy link
Contributor Author

Potential fix in parser.py:

        # Handle the types of RiveScript commands.
        if cmd == '!':
            # ! DEFINE
    -       halves = re.split(RE.equals, line, 2)
    +       halves = re.split(RE.equals, line, 1)

@snoopyjc
Copy link
Contributor Author

Potential fix for js version:

		// Handle the types of RiveScript commands.
		switch (cmd) {
			case "!": // ! Define
	-			let halves = line.split("=", 2);
        +                       let halves = line.split("=", 1);

@snoopyjc snoopyjc changed the title ‘=‘ in var definitions end the definition ‘=‘ in var definitions ends the definition Aug 17, 2019
@kirsle
Copy link
Member

kirsle commented Apr 10, 2020

Fixed in #144.

@kirsle kirsle closed this as completed Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants