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

keep flag does not work in topic, reply #392

Open
hailiang-wang opened this issue Nov 12, 2017 · 0 comments
Open

keep flag does not work in topic, reply #392

hailiang-wang opened this issue Nov 12, 2017 · 0 comments

Comments

@hailiang-wang
Copy link
Contributor

hailiang-wang commented Nov 12, 2017

After install the latest superscript, I parse a script with keep flag. But I think it does not as expected. The keep flag is not in Topic and the reply's keep is false.

Expected Behavior

As described in Wiki, keep can be used with topics.

Current Behavior

keep flag does not work in topic, reply

Possible Solution

Steps to Reproduce (for bugs)

node_modules/superscript/lib/bin/parse.js -p chat -o data.json -f

greetings.ss in chat

> topic greetings {keep}

+ {keep} hello
- hi
- hey
- hello

< topic

data.json

{
    "topics": {
        "greetings": {
            "name": "greetings",
            "flags": {},
            "keywords": [],
            "filter": null,
            "gambits": [
                "DBtRlurb"
            ]
        }
    },
    "gambits": {
        "DBtRlurb": {
            "trigger": {
                "flags": {},
                "filter": null,
                "question": false,
                "raw": "hello",
                "clean": "hello"
            },
            "replies": [
                "NKJf47IE",
                "sc90c3A3"
            ],
            "conditional": null,
            "conversation": null,
            "topic": "greetings"
        }
    },
    "replies": {
        "NKJf47IE": {
            "string": "hi",
            "filter": null,
            "keep": false
        },
        "sc90c3A3": {
            "string": "hey",
            "filter": null,
            "keep": false
        }
    },
    "checksums": {
        "chat/greetings.ss": "99959fad371a27860e419504f5fdac9c4f8ebc38"
    },
    "version": 1
}

with superscript#1.0.0, things works out as expected, data.json with ss 1.0.0:

{
    "topics": {
        "greetings": {
            "name": "greetings",
            "flags": {
                "keep": "keep"
            },
            "keywords": [],
            "filter": null,
            "gambits": [
                "ZmywpgXK"
            ]
        }
    },
    "gambits": {
        "ZmywpgXK": {
            "trigger": {
                "flags": {
                    "keep": "keep"
                },
                "filter": null,
                "question": false,
                "raw": "hello",
                "clean": "hello"
            },
            "replies": [
                "SiA1tHNg",
                "yQnR8A2X",
                "EJW4gAug"
            ],
            "conditional": null,
            "conversation": null,
            "topic": "greetings"
        }
    },
    "replies": {
        "SiA1tHNg": {
            "string": "hi",
            "filter": null,
            "keep": false
        },
        "yQnR8A2X": {
            "string": "hey",
            "filter": null,
            "keep": false
        },
        "EJW4gAug": {
            "string": "hello",
            "filter": null,
            "keep": false
        }
    },
    "checksums": {
        "engine/chat/greetings.ss": "b2eed9b04702eaf5091b0eb2456660fa0da1bd7f"
    },
    "version": 1
}

Context

Your Environment

  • Version used:

image

  • Environment name and version (e.g. PHP 5.4 on nginx 1.9.1):
  • Server type and version:
  • Operating System and version:
  • Link to your project:
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

1 participant