Message Boards Message Boards

CodeParser and CodeInspector

enter image description here

POSTED BY: Brenton Bostick
10 Replies

Just for completeness reasons. It is possible to install these packages via PacletInstall on Mathematica 12.2 and older. So for example 12.0.0. The troubleshooting instruction is run Needs. It did get no error and no further assistance to the installation. There is a LibraryFunctions message in the notebook then.

Message in Mathematica Notebook version 12.0.0 Home

Thanks for the help in advance.

For versions older than 12.1, it is recommended to build from sources with the version that you will be using, so that you don't run into this problem.

https://github.com/WolframResearch/codeparser/blob/master/HowToBuild.md

I will add some more steps to Troubleshooting to help with this.

POSTED BY: Brenton Bostick

Thanks a lot. It took a while since I came back to this question. It worked brilliantly comfortable and with great ease. But ... It produced another incomprehensible message:

PacletInstall::compat: The paclet CodeInspector was successfully installed, but it will not be available in this session because it is not compatible with the currently running version of the Wolfram system.

I did obey the recommendation from github.com to build it with my version of Mathematica.

Same messages with PacletInstall and path as with cmake --install.

Modify the PacletInfo.wl.in file with WolframVersion -> 12.0 and build and install again.

POSTED BY: Brenton Bostick

enter image description here -- you have earned Featured Contributor Badge enter image description here

Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: Moderation Team

I was wondering about adding new rules to the linter. There is a tutorial in the documentation, but it is a bit outdated.

What is the difference between ConcreteRules, AbstractRules and AggregateRules, and which one should we look at first to get started?

POSTED BY: Szabolcs Horvát

The philosophy is that it is easy to convert from Concrete -> Aggregate syntax, and also from Aggregate -> Abstract. So at those 3 stages, we do scans for rules that are defined.

For people playing at home: Concrete Syntax: parse tree with whitespace are comments preserved (think InputForm) Aggregate Syntax: all whitespace and comments have been stripped. Abstract Syntax: nodes are transformed into more abstract forms (think FullForm)

Most rules will be for Abstract syntax.

You can ask yourself: Does the difference between 1+2 and Plus[1,2] matter for my rule? If no, then use Abstract Syntax. If yes, then ask: would whitespace affect the rule? If no, then use Aggregate Syntax. Otherwise use Concrete Syntax.

It should be noted: I am also thinking of the best way to represent a level lower than Concrete Syntax, working directly with tokens. This would be where a rule for ;; at the end of a line would be. It would be wrong to have the rule ";; at the end of a line" as Concrete Syntax, because it is hard to check "end of line" in a tree structure. But with a list of tokens, just need to check ;; token is next to \n token. Maybe it will be called TokenRules or something.

POSTED BY: Brenton Bostick

Thanks for sharing! Is there an explicit list of what types of errors get found?

POSTED BY: Sander Huisman

No explicit list right now. It is a goal to make the errors available programmatically, for better filtering and also easier translation to other languages, etc.

POSTED BY: Brenton Bostick

I just wanted to say that I have been using this tool for a while, and I find it to be excellent. It is a big step forward for Wolfram Language development. It helped me find multiple bugs in my IGraph/M package (as well as some other private packages I use), and it is now a regular part of the testing routine I use for IGraph/M.

Highly recommended for anyone who writes Wolfram Language packages!

POSTED BY: Szabolcs Horvát
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract