Fena

Latest version: v8.0.0

Safety actively analyzes 621622 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.4.0

config/config.ini:
- Added a version config option to specify "1.12" or "1.13"
- Removed target_selector_arguments and target_selector_variables and replaced it with selector_arguments and selector_variables in the json file
- moved to /src/config instead of just being under /src

config_data.py:
- Changed all logging errors to syntax error
- Renamed config options to match up with the wiki https://minecraft.gamepedia.com/CommandsTarget_selector_arguments
- config.ini now supports comments, trailing whitespace and empty lines
- Changed list of valid options into frozenset because it is only used for containment tests

token_classes.py: (created)
- Changed string constants to multiple Enum values (token classes) to better organize the constants
- Created a bunch of frozenset constants to be used for containment tests
- Contains specifically specific token classes and token types
- Created a class "TokenValues" which gets all token values given a token class
- Uses dynamic programming to cache values (maps the token class to the values)
- Renamed a bunch of token classes to better match up with what token types they represent (Simple or Typed)

lexical_token.py:
- Removed a bunch of staticmethods that aren't being used anymore by the token
- Added a cast method that assumes the type can be properly changed when used
- Works with both token classes and token types

token_position.py: (created)
- Created a TokenPosition class
- Prevents confusion between the line number and the column number of the previous representation (a tuple of two ints)
- Stores more attributes to allow representation of a range of chars
- Created a TokenPositionRecorder class:
- Mutable version of the TokenPosition class used in during the tokenizing process
- Does the main locking and unlocking of the char position

lexer.py:
- Fixed a glitch involving whitespace on empty lines
- Fixed a glitch involving no empty line at the end of the file
- Redo how newlines are converted to tab space tokens
- Changed into an iterator which allows all possible lexing to be done within this class
- There is no need for common lexers anymore
- All commands, selectors and nbt tags will be separated into its own tokens
- Added some new delimiter tokens as ":", ",", "(" and ")" for execute and chained commands

parser.py:
- Added a !folder statement block to define what file all the defined mcfunctions will be in
- Added a one liner !prefix statement to determine what prefix will be used throughout the file
- Added a one liner !constobj statement to determine what objective name will be used for operations with constant numbers
- eg. "s _ti * 5" requires an objective for scoreboard players operation, which wiil be defined with !constobj
- Added a command chain option by having a command end with ":" and starting as a new block -> REMOVED
- Equivalent to CBP or CCUv1 "USE"

mcfunction.py:
- A simple object to hold the full path to the mcfunction and all commands as strings within it
- Used to hold a list of Command objects, which hold a list of token objects

coord_utils.py: (created)
- Made a bunch of functions to assist in validating coord types from strings and tokens

in_file_config.py: (created)
- Singleton class to hold information gotten from the parser:
- objectives dict (maps no prefix to prefix)
- tags dict (maps no prefix to prefix)
- teams dict (maps no prefix to prefix)
- functions dict (maps shortcut to minecraft path)
- constobj (str from !constobj)
- prefix (str from !prefix)

nodes.py: (created)
- Made a node class to be inherited from all other node classes
- Only an ABC class with no abstract methods
- Node visitor class taken straight from the tutorial -> moved to node_visitors.py
- Each section that can contain more than one token will be a node
- It used to have its own build method, but that has been moved to command_builder.py

node_visitors.py: (created)
- Created a general base visitor for statement visiting and command building

command_builder.py: (created)
- Added a bunch of builder classes (command, execute, scoreboard, function, simplecommand) -> DELETED
- The general command builder class will have all class vars moved to in_file_config.py
- Changed to be a node visitor that builds all individual nodes for either 1.12 or 1.13 depending on the object

terminology.txt: (created)
- Created a general list of terms that will remain constant throughout the code documentation and naming conventions

token_types.py: (created -> renamed to token_classes.py)
- Renamed after setting the terminology.txt as the standard across all files

commands.py: (created -> renamed to command_builder.py)

config files (created to hold info for versions 1.12 and 1.13):
blocks.json: contains the list of all blocks
bossbar.json: contains how to parse "bossbar set" and contains "bossbar get" values
command_names.json: contains all command names
entities.json: contains all entities
execute.json: contains how to parse dimension names and comparison operators for 1.13 executes
scoreboard.json: contains how to parse math and special operators given to scoreboard shortcuts
selector.json: contains how to parse selector arguments, what selector arguments exist and what selector variable specifiers exist
team_options.json: contains all arguments and values for team options


config/selector_1.12.json, config/selector_1.13.json: (created -> DELETED)
- Holds all config data specifically for selector based things for 1.12
- json is used instead of a regular ini because more complex formatting is required (lists and dicts)

config/blocks_1.12.txt, config/blocks_1.13.txt,
config/commands_1.12.txt, config/commands_1.13.txt,
config/entities_1.12.txt, config/entites_1.13.txt: (created -> DELETED):
- Holds all data as said by the file name (formatted with each line being a valid item)

exec_nodes.py: (created -> DELETED)
- used to hold all nodes for the execute shortcut
- all nodes are now moved over to nodes.py

optional.py: (DELETED)
- literally useless

scoped_symbol_table.py: (created -> DELETED)
- Created an object to handle basic information gotten from statements
- General handling is separated from the original parser
- Contains:
- all folders to the mcfunction
- current mcfunction
- prefix
- constobj
- current command builder

builder.py: (created -> DELETED)
- Made a simple class that all builders must inherit from
- Requires all builder classes to have the "build" method

coroutine.py: (created -> DELETED)
- Made a decorator for coroutines (might not be used due to asyncio maddness)

constants.py: (DELETED)
- Replaced with token_types.py and config_data.py

lexical_token_immutable_bak.py: (created -> DELETED)
- Backup version of prototype immutable token
- Was later scrapped because casting would change the physical token and that has to be mutable

common_lexer.py: (created -> DELETED)
- Added a prototype lexer to be used by tokenizing datatags and selectors
- Made it inherit ABC

common_parser.py: (created -> DELETED)
- Added a prototype parser to be used for parsing datatags and selectors

statement_lexer.py: (created -> DELETED)
- Added a lexer specifically for converting a statement line into their respective tokens

command_lexer.py: (created -> DELETED)
- Lexer specifically for getting tokens in a command

command_parser.py: (created -> DELETED)
- parser specifically for commands

selector_config.json: (created -> DELETED)
- Holds all config data specifically for selector based things
- json is used instead of a regular ini because more formatting is required (lists and dicts)

TODO:
- Allow all forms of "minecraft:"
- Have the lexer output whitespace tokens in certain situations
- Include type hinting as introduced by python 3.5+ (unless it requires 3.7+)
- Look into using dataclasses or NamedTuple for various objects (eg. nodes)

- Command line arguments:
- Debug file only when "-dl" or "--debug-log"
- Specify custom version under "-v" or "--version" as 1.12 or 1.13 that overrides the config specification

- formatted and custom exceptions
- generator for immutable struct-like classes for nodes

1.13:
- !blocktag, !itemtag, !functiontag, !fluidtag
- Change format of execute commands to use ":" and all sub execute commands
- mcfunction format in datapacks (different namespace)
- general change in file system

fenasplit:
- pass

0.3.0

-Removed the Common, Post and Mid folders

0.2.1

-Honestly a lot of stuff changed during this time but I forgot to record it
-The main thing that was changed is how the shortcuts are made, since literally the entirity of interpreter.py was redone
-Now everything is much more strict and a bit more readable and usable since it used to be almost a
one to one port from the old java code, which is just absolutely disgusting

-Added the function shortcut where you can just type "function name" -> "function ego:EVENT_NAME/name"

0.1.3

-Changed tab spaces to 4 spaces

0.1.2

-Integrated pyexpander with the program

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.