WingedSeal / jmc

A compiler for JMC (JavaScript-like Minecraft Function), a mcfunction extension language for making Minecraft Datapack
https://jmc.wingedseal.com
MIT License
64 stars 7 forks source link

JMC thinks `[-1]` is a string slice #79

Closed WingedSeal closed 5 months ago

WingedSeal commented 5 months ago
summon::entity.Pos = summon::objectives[-1].Pos;

raises

Unexpected token (Token(token_type=<TokenType.KEYWORD: 'Keyword'>, line=175, col=56, string='.Pos', _macro_length=0, quote='')) at line 175 col 56.
WingedSeal commented 5 months ago

This is actually caused by a misalignment of merging path tokens (AKA. I just missed a +1 but that took half an hr to find). Should be fixed in https://github.com/WingedSeal/jmc/commit/0393bed68d91ded9fba05a0488c2620805af9796