def test_autokwd():
    def grammar():     return ("one", "two", "three")

    parser = ParserPython(grammar, autokwd=True)

    # If autokwd is enabled this should parse without error.
    parser.parse("one two three")

    # But this will not parse because each word to match
    # will be, by default, tried to match as a whole word
    with pytest.raises(NoMatch):
        parser.parse("onetwothree")

    parser = ParserPython(grammar, autokwd=False)
    # If we turn off the autokwd than this will match.
    parser.parse("one two three")
    parser.parse("onetwothree")
autokwd will match keywords on word boundaries.
dataset/ETHPy150Open igordejanovic/Arpeggio/tests/unit/test_parser_params.py/test_autokwd