benjamincorcoran / sasdocs Goto Github PK
View Code? Open in Web Editor NEWA small parsing library for SAS code
License: MIT License
A small parsing library for SAS code
License: MIT License
Hello,
I was very happy to find this library, thank you for making it open source!
When I tried to follow the simple example I got these error/warning messages:
Unable to directly resolve path: [WinError 3] The system cannot find the path specified: 'a\\bad\\path'
Unable to directly resolve path: [WinError 3] The system cannot find the path specified: 'a\\bad\\path'
Unable to directly resolve path: [WinError 3] The system cannot find the path specified: 'path\\to\\output'
ERROR:sasdocs.program: "a\bad\path": Unable to resolve path: [WinError 3] The system cannot find the path specified: 'a\\bad\\path'
It took me a little while to understand that it was due to the %include "a/bad/path";
and libname output "path/to/output";
statements in the samples.
Maybe you could consider to use an initial example that does result in error/warnings messages? Or mention something about the paths in the instructions? Just a suggestion.
Excited to start using your library! Thanks again. Cheers
/ Jonas
Call to macros are not parsed and so drop the over all parsed percentage for the sasProgram. Must be careful not to capture macro language as macro calls
/*This*/
%runMacro;
/*Not this*/
%put;
Make object level logging for better debugging.
Need to write unit tests for sasProgram class
The following should be resolved so that the library data
has a valid path. Repeat process for %include
statements.
%let mVar = C:\SASData;
libname data "&mVar.";
Parser currently fails when presented with a datastep or procedure with explicitly defined options.
data test / view=testvew;
set test;
run;
SAS proc sql
statements are not currently parsed. These should be parsed into a object similar to a datastep or procedure, with multiple potential inputs and outputs. Column creation and join methods can be largely ignored at this point.
proc sql;
create table work.foo from
select * from work.bar;
quit;
proc sql
and quit
tags.* text ;
is a valid inline comment delimiter in other contextsjoin
statements can be repeated multiple timesselect
statements can be nested indefinitelyselect into :mvar
is a valid method for creating macro variablesNeed to be able to get to parent program from individual SAS object. Add pointer to parent program where object was parsed.
rebuild_macros
fails when only a macro end is parsed from the SAS program.
Unknown target name
. Do no write out to markdown link if no available link.
Need to write unit tests for sasProject class
Parser fails when macro defined with options i.e.
%macro test /des='Hello' secure;
%mend;
Current parser does not capture multiple outputs in procedures.
proc summary data=test;
class a;
var b;
output out=sum sum=;
output out=cnt n=;
run;
Currently no data producing procedure statements are not parsed.
E.g.
proc datasets lib=work kill; run;
proc print data=test; run
In order to reference back to the raw code, need to grab the point in the raw code string that the parser extracts the object.
The following code
data test ;
set a;
run;
is parsed into two outputs work.data
and work.
proc sql
statements fail to parse when force_partial_parse
has mark argument set to True
. Issue is attempting to run set_found_posistion
on parsed list of SQL statements.
Clearing libname should be parsed correctly.
Produce network diagrams showing flow of data between steps and procedures in a single piece of SAS code.
Extension:
Display SAS code diagrams in context of large project.
Use _lib and _ds attributes, which have already encoded macrovariables into strings.
Macro object needs an about
attribute capturing the documentation of the macro variable. This should be the first set of comments inside the macro. The comments need to be collapsed into a single string object.
In the case of a html export from sphinx, it is possible to exploit additional javascript packages for code markup and d3.js see #49
Write a tutorial for using the Sphinx directive.
Use jinja2 templating library to output parsed SAS objects into markdown documents natural documentation
Test cases for the sasProgram class.
get_objects
yields objects as expectedLibname functions like below, fail when libname.path
is called as no path
attribute is generated.
libname test clear
Currently only datasteps with a set
or merge
statement are parsed. However this does not account for datalines
and cards
statements, as well as infile
statements
data a;
input a;
datalines;
1
;
run;
Should produce dataStep
object with single output of dataObject: a
Proc import parsing should capture the datafile
path as well as producing a dataObject
from the out
statement.
proc import datafile="path/to/file.csv" dbms=csv out=a; run;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.