xbrlus / xule

An open-source XBRL processor for business rules, rendering and custom data reporting. See https://xbrl.us/xule for documentation and https://xbrl.us/xule-editor for a VS Code syntax highlighter.
Apache License 2.0
24 stars 10 forks source link

Make XULE compiler grammar compatible with pyparsing 3 #22

Closed austinmatherne-wk closed 1 year ago

austinmatherne-wk commented 1 year ago

Changes

  1. The first two commits (5bbfbc7b22e9417f1322bac3ddc00d409aaceec0, 42eb6254662902e690b10b642fe22bc7dfe7c4f1) handle differences between grammar behavior in pyparsing 2 and 3.
  2. The third commit (df4e8807ca647d94d2f0c91420aeda26d0ddb4ea) is general cleanup that removes unused pyparsing imports.
  3. The fourth and fifth commits (532b7360d82e22db8b102dd9b20bd42edb9fe25c, a446399c68255fa8ae0ac123f58624622947e381) transition the grammar from using pyparsing classes and functions which have been deprecated in pyparsing 3 and slated for removed in pyparsing 4. While there's quite a bit here, it's all renaming setResultsName() to set_results_name(), Optional(...) to Opt(...), etc. These two commits break compatibility with pyparsing 2 while the previous 3 do not.

Testing

I compiled each of the ESEF, US, and IFRS DQC sources using the json format (--xule-compile-type json) with both the current main branch and pyparsing 2 and then with this updated PR and pyparsing 3. I then ran a diff between the json output to verify there were no changes in the compiled output.

@campbellpryde @davidtauriello