Skip to content

Lacia/Autocode

Code tools.

Public

  • convertNotebookToWLT[dir_,targetDir_] - convert notebooks in the directory to *.wlt test files.

    • This function will syntactically import cells of type "Input"|"Code"|"Output"|"Message", then regroup them into {"Input"|"Code","Output","Message"}, and convert the groups into VerificationTest.

    • An input cell with more than one outputs will be reported as an error, since there is no syntactical way to separate the input cell. For example,

      Code

      a
      b
      
      Out[] = a
      Out[] = b
      
    • Option:

      • "ExcludedFile"->{} - exclude certain notebooks in the directory.
    • Notice:

      • Currently format definitions cannot be parsed correctly, use the following workaround instead:

        Code

        ToExpression["Format[expr,format]:=expr1;"]
        

        TODO check the code NotebookImport[#,_->"HeldExpression"]& to see how NotebookImport handles Format.

      • TODO Another parser of input cell, controlled by (*$reformatCode = False;*) should be deprecated, since it cannot distinguish Power and Superscript.


  • ASTHierarchy - return the hierarchical structure of the AST.

  • ASTHierarchyPrint - print the hierarchical structure of the AST.

  • buildLibrary - build the library.
  • dependency - symbol dependency from definitions.

  • dependencyGraph - symbol dependency graph from definitions.

  • $dependencyLimit - the fixed-point limit in dependency*.

  • $dependencyExclusion - the excluded contexts in dependency*.

  • exportArgumentCompletion - export the argument completion data.

  • $argumentFileName - default name of the argument completion file.

  • exportPublicSymbolUsage - export the usages of public symbols in the directory.

  • $usageFileName - default name of the usage file.

  • reportSuspiciousSet - report suspicious set in the *.wl files in the directory.
  • reportWLT - report the unit test in the directory.