MerlinofMines / EasyCommands

Github Repository for Ingame Scripts built by MerlinofMines. Uses MDK to Deploy to SpaceEngineerse
GNU General Public License v3.0
8 stars 3 forks source link

Remove `IgnoreCommandParameter` #237

Closed jgersti closed 2 years ago

jgersti commented 2 years ago

This PR introduces the following changes:

Changes not yet included are:

As a side note : I would propose to rename *CommandParameter => *Token, *DataProcessor => *Match and the current Token => Lexeme. And maybe also renaming a few files to reflect what they contain ParameterParser.cs => Lexer.cs, ProcessingEngine.cs => Parser.cs

_edit:

  1. April: updated some points above_
jgersti commented 2 years ago

Move the detection of Primitives into ParseCommandParameter(...) This commit disallows the usage of tokenized primitves as selectors and function names. The changed behaviour should only be noticeable if the predefined color names where used since hex colors, vectors and numbers should not be used as identifiers anyway.

Add IdentifierCommandParameter This commit replaces all VariableCommandParameters which contain an AmbiguousStringVariable where only the string value is used with an IdentifierCommandParameter.
The first rule in branches for AmbiguousSelector is currently unnecessary. If an implicit (unquoted) string can never be an implicit (ambiguous) selector this rule will never used. All implict AmbiguousStringCommandParameters have an empty token list and can therefore never be an AmbiguousSelector (because no block type can be inferred).

jgersti commented 2 years ago

Add AbsoluteCommandParameters to various rules and ... This commit removes the rule that discards AbsoluteCommandParameter. Any rule that needs to be aware of this has been changed to include an data processor that reads AbsoluteCommandParameter.

This commit is more a quick fix and not proper solution since BlockCommandProcessor now matches even more patterns (50+ million assuming only up to 2 assignment matches).

MerlinofMines commented 2 years ago

Multi-Word property support has some conflicts with this one, going in a different direction in order to support "To" separation.

closing this draft for now; we can revisit later.