Skip to content

SYMBOL ambiguity #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
geographika opened this issue Jan 25, 2018 · 1 comment
Closed

SYMBOL ambiguity #48

geographika opened this issue Jan 25, 2018 · 1 comment

Comments

@geographika
Copy link
Owner

geographika commented Jan 25, 2018

There are currently two ambiguities that remain in the grammar.

  1. SYMBOL can in some cases be used as a composite type, and sometimes as an attribute. E.g.
SYMBOL
  NAME "circle"
  TYPE ellipse
  FILLED true
  POINTS
    1 1
  END
END

And sometimes it can be used as a simple keyword / value pair e.g.

SYMBOL "symbol_name
SYMBOL 0 # reference a symbol from a SYMBOLSET

Everything currently works fine for cases such as:

SYMBOL"barb_warm"

But in cases without quotes, such as the following, fail:

SYMBOL barb_warm

Not sure if anything can be done about this. If not then these will always need to be quoted.
There is a test for this in test_snippets.py - test_symbol_style2().

A possible solution is to have an unquoted string type, a KEYWORD type which only accepts letters (case-insensitive)
for attribute names, and a more permissive type that accepts underscores, numbers, and hyphens that could
be used for attribute values.

  1. STYLE - this is typically a class such as:
STYLE
  SYMBOL 'hatch-test'
  COLOR 255 0 0
  ANGLE [MYROTATE]
  SIZE 4.0
  WIDTH 3.0
END

However it is also used in a two other classes as an attribute e.g. in a SCALEBAR and in a QUERYMAP. E.g.

SCALEBAR
    STYLE 0
END
@geographika geographika changed the title STYLE and SYMBOL ambiguities SYMBOL ambiguity Feb 26, 2018
geographika added a commit that referenced this issue Dec 6, 2022
…thon (#179)

* Parser: Update Lark dependency to lark 1.1.4

* Add benchmarks

* Project changes

* Parser: Add support for lark_cython

* Github CI: Remove tests for 2.7

* Fix issues #48 and #98 using Lark's interactive parser.

* Adhere to flake8

Co-authored-by: sethg <sethg@geographika.co.uk>
@geographika
Copy link
Owner Author

Fixed in the v1.0.0 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant