Skip to content

case statement parsing? #91

@panwlodek

Description

@panwlodek

It looks like, that bashlex has problems with parsing of case statements. Please try read following into parser.parse:
case "$1" in
start)
start
;;

    stop)
        stop
        ;;
     
    *)
        echo $"Usage: $0 {start|stop}"
        exit 1

esac

I have following error message:
Traceback (most recent call last):
File "ttt.py", line 12, in
trees = parser.parse(s)
File "/home/joe/.local/lib/python3.10/site-packages/bashlex/parser.py", line 610, in parse
parts = [p.parse()]
File "/home/joe/.local/lib/python3.10/site-packages/bashlex/parser.py", line 691, in parse
tree = theparser.parse(lexer=self.tok, context=self)
File "/home/joe/.local/lib/python3.10/site-packages/bashlex/yacc.py", line 439, in parse
p.callable(pslice)
File "/home/joe/.local/lib/python3.10/site-packages/bashlex/parser.py", line 401, in p_pattern
handleNotImplemented(p, 'pattern')
File "/home/joe/.local/lib/python3.10/site-packages/bashlex/parser.py", line 17, in handleNotImplemented
raise NotImplementedError('type = {%s}, token = {%s}' % (type, p[1]))
NotImplementedError: type = {pattern}, token = {start}

I hope, you can help here.
Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions