Skip to content

White couldn't combine with set_results_name() #350

@hfudev

Description

@hfudev
from pyparsing import White, alphas, Word

parser = White(' \t').set_results_name('indent') + Word(alphas).set_results_name('word')
print(parser.parse_string('    test'))

would raise:

pyparsing.exceptions.ParseException: Expected <SP><TAB>, found 'test'  (at char 4), (line:1, col:5)

but

from pyparsing import White, alphas, Word

parser = White(' \t') + Word(alphas).set_results_name('word')
print(parser.parse_string('    test'))

would return [' ', 'test']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions