Minecoprocessors

Minecoprocessors

183k Downloads

ASM Book Item

frodare opened this issue · 10 comments

commented

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

  • the cursor can be moved to edit text
  • code errors will be shown in red
  • possible recipe: book and quill surrounded by iron and redstone dust

from: Suggestion on the wiki #3

commented

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

commented

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

commented

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.

commented

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.

commented

@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?

commented

@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.

commented

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.

commented

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

commented

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.

commented

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!