Skip to content

PVL Grammars don't have parameters #72

@acpaquette

Description

@acpaquette

Describe the bug
The current grammar classes (PVLGrammar, OmniGrammar, ODLGrammar, and ISISGrammar) do not take any of the specified parameters as mentioned in the documentation. Specifically PvlGrammer takes whitespace, reserved_characters, and comments. I believe these parameters would also be usable in the child classes (OmniGrammer, ODLGrammar, and IsisGrammer) however since PvlGrammer can't take advantage of them, neither can the sub classes.

To Reproduce

>>> grammar = pvl.grammar.ISISGrammar(comments=('#'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() got an unexpected keyword argument 'comments'

>>> grammar = pvl.grammar.PVLGrammar(comments=('#'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: object() takes no parameters

Expected behavior
When setting these parameters I would expect them to override the defaults being set in the PVLGrammar class any of its subclasses.

Your Environment (please complete the following information):

  • OS: macOS 10.13.6
  • Environment information: Python 3.6.7
  • pvl Version 1.0.0

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