Skip to content

Missing reserved words #133

Closed
Closed
@jaopaulolc

Description

@jaopaulolc

Hi,

I notice that the grammar does not include some reserved words that are part of the language according to the Bash Reference Manual.

This is a list of some with some reserved words that are missing:

("time" "coproc" "type" "trap" "exit" "exec" "continue" "break" "return" "logout" "bye" "true" "false" "test")

My suspicion is that including those would complicate significantly the parser and that my be the reason to leave those out.

However, for fontification and other text editing tasks, it is desirable to identify those.

Is the recommend approach to use a generic query and a regex to find the above reserved words? Something like this:

(command_name ((word) @captured_keyword (#match? @captured_keyword <regex to reserved words>)))

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