Map Parsing - #635
Conversation
|
OK, so failing the In our codebase this has hits (and all (INCDIR followed by two regions of non-whitespace before semicolon) INCDIR\s+(\S+)\s+(\S+)\s+;There are no hits for the pattern in the test (INCDIR followed by three regions of non-whitespace before semicolon) INCDIC\s+(\S+)\s+(\S+)\s+(\S+)\s*;Does your code have any hits on this regex @markusamshove ? |
|
There are some basic docs about rules here, but they're not very good at explaining the source code structure. Happily I have lots of examples to work with .... Ultimately I really want to get rid of all the Predict Free Rules ... or at least convert them into inline rules in a pre-build step, rather than depend on source code which is hidden away in a database somewhere and isn't under version control. Aha, there's something about that
So Applies to a field array and marks the Most of the error marks are gone from my maps now (that error on
The N1 map editor stores a bunch of metadata in magic comments but it's entirely possible to just write maps as source. Sadly when you do, sometimes the map editor will completely ruin your source code if it doesn't "understand" it... even if it catalogs and works just fine. |
|
b7cb725 to
9582766
Compare
|
At this point, codebase (which mostly catalogs fine but contains errors that are more obvious with from less noisy linting .. ) has gone from
Next biggest categories of diagnostics that don't look like errors in the code...
This seems to be valid in most places you can accept a database field as an operand ...
For modules that are known to be present but not visible in the source code. Would be nice to have a way to declare external module names (extending the assumptions like USRnnnnN is a system API)
this revision makes a stab at widening the pool of keywords that can be identifiers ... but we have a lot more and this method starts to break tests if you include them all. Need a better way to do this. |
- Progress : the define data block in map rules is parsed - Todo : there is no access to the new variables so the code checkers still hates them
- Rule type
- Rule index (in type)
- Field Name
- This can include `*PF-KEY` which splits the token
1e544e3 to
ea43209
Compare






Vast majority of (wrong) lints in our codebase come from map rules ... so starting some map parsing
Map rules start
And then
The
RULEVARcontinues until anotherRULEVARstarts, or a normal object end happens.INCDIRmeans "use the Predict rule for this Adabas field"INCDIRwith a name is a Predict Free RuleINCDIRwith no name is an inline ruleInline rules are effectively a nested program. Inline rules are allowed their own
DEFINE DATAblock.Inline rules may access all the variables in the scope of the current map plus any variables declared in their own block.
Where this branch is right now ....
INCDIRnodesINCDICnodes a node-with-bodyINCDICnodesWhat needs to be added