ToroCraft / Minecoprocessors

Increase your redstone possibilities and learn assembly programming at the same time with the Minecoprocessors Minecraft Mod!
https://minecraft.curseforge.com/projects/minecoprocessors
GNU General Public License v3.0
33 stars 10 forks source link

ASM Book Item #5

Closed frodare closed 6 years ago

frodare commented 7 years ago

Add a new book item that will work like a book and quill with the following options:

from: Suggestion on the wiki #3

josephcsible commented 7 years ago

TIS-3D's code bible already offers those features, and its code is available under the MIT license, so we could easily take it and tweak it to work with Minecoprocessors. If you don't have any objections to doing that, I can start working on a PR for it.

frodare commented 7 years ago

I noticed that, looks like he did a pretty good job at it too. It is opensource, but if it is used for more than just a reference, I would want to ask the author before merging the code in. A PR would be greatly appreciated! I forgot to include a style guide in this project, here is a link: https://github.com/ToroCraft/PowerProbe/blob/master/intellij-java-style.xml If you are not using intellij, just try your best to copy the style in the rest of the project, not really that big of a deal.

josephcsible commented 7 years ago

@frodare: I'm an Eclipse user. Anyway, I tried to match your style for all of the code I wrote myself, but when I took entire files from TIS-3D, I didn't touch their style.

@fnuecke: are you cool with this? Anything specific you want attribution-wise?

fnuecke commented 7 years ago

Absolutely, go right ahead! If you feel like it, add a comment in the source file, but you really don't have to.

josephcsible commented 7 years ago

I'll try to do another PR that makes error highlighting work in the next day or two.

frodare commented 6 years ago

@josephcsible The syntax highlighting is not critical for the next release, although it would be pretty darn cool. The single page loading needs to be fixed though. If that is something your not working on let me know so I can dive in. I don't want to cause conflicts if you were already working in there.

josephcsible commented 6 years ago

Re syntax highlighting, I'll try to do it this weekend. Re single pages, I kind of consider that a feature, to make it more convenient for if you want to quickly switch programs, especially since you can use "#BWTM" if you want a program to continue onto the next page.

frodare commented 6 years ago

I see, I didn't know about the continuation macro. Agreed, that is better.

josephcsible commented 6 years ago

So it looks like it's going to take some serious re-architecting of the way we do parsing to make error highlighting work. Here's what looks like needs to be done:

  1. Take care of #48
  2. Store line numbers while parsing code
  3. Get rid of compileLine and associated methods, and instead just return the original line from the book (given the line number)
  4. Make the parser keep track of the line number that it's on, and the position within the line, during the compiling process
  5. Replace our ParseException with the one from TIS-3D

Once all that's done, we should be able to uncomment the highlighting code and have it work.

frodare commented 6 years ago

I will take a look later to see if there is an easier way. I went ahead and split this off into another issue to track the error highlighting. Thanks for your help!