Comments (6)
Also probably this solution should include indicating an invalid tag set, specifically an open without a close or a close without an open. That should actually run on save?
from qcoder.
I've written a function that can handle nested qcodes now, it's a significant change since you can't just do it with a straight regex in R (as far as I know you can't do recursive regex in R?). I'll fit my solution into into the existing code and put it up soon.
For flagging an invalid tag set ... with nested codes I don't think we could necessarily tell which open or close went with which for reporting the specific invalid tag? We could however do the following pretty easily: 1) indicate if the number of (QCODE) and (/QCODE) tags do not match, 2) indicate if there is a (/QCODE) not immediately followed by {#code}
. Would that be sufficient? How would you like this to be reported?
from qcoder.
from qcoder.
I've submitted a pull request. I also added some simple error checking and generated warnings if these are detected.
I don't see an easy way with my function to identify what specific text block is missing an opening or closing block. I can think about it a bit -- if you spot one, add it! It would be a lot easier if we had a tree structure, which I suppose could be easier to build with your str_locate_all solution?
from qcoder.
Not sure, but it's possible. One thing we can do is just count the open and closes and make sure the numbers match? I merged what you have. Definitely a big deal to have nested support!
from qcoder.
Globally, for me, nested coding is working. Expect when it is exactly the same strings. I open a new issue and I proposed a little thing that can resolved in a PR
from qcoder.
Related Issues (20)
- Project status? HOT 6
- Unclear how to save coded data HOT 3
- Installation error with Qcoder HOT 4
- Installation Error HOT 3
- Unable to add units, data or codes. HOT 3
- Package issues HOT 4
- Switch to github actions
- Can’t do anything within the Shiny app HOT 13
- Allow access to a data other directories on Windows. HOT 10
- Function documentation
- Button for adding a new code should be below fillable fields HOT 2
- Create a way to read project data from a spread sheet HOT 1
- Function for reading html data from the web. HOT 1
- minor fixes in "Contributing" article (spacing, typos, heading level, link...)
- Add messages when data frames are empty
- doc_path must be unique HOT 1
- Explore git for versioning
- Create UI for editing codes HOT 2
- Using Qcoder in Real Time
- Merging in RQDA code/files HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qcoder.