Comments (2)
Child macros and their position and stuff aren't validated as of now. Currently, the parser only sees the entire if
block, and not different sections inside it.
from twee3-language-tools.
We might be able to do this:
- Get the range for the
if
macro we're looking at - Iterate over all macros (starting after current). Filter so that their start is within the
if
macros range. - For each of those macros, if they're a container macro then we filter out all the macros within its range, this avoids checking the macros inside the container which would be bad
- If it is one of our
children
macros then we keep a count of it (probably only for ones withmax
field defined on them, where we need to do that) - If it goes over the
max
field (we could also easily add amin
, but I'm unsure if there's any which would benefit from that?) then we warn.
It is a bit more expensive to compute than I'd like, but avoids generating an entire tree since we don't need it. I'll try implementing this.
It would allow for a min
requirement, as well as requirements like else
must always be after either nothing (if
) or elseif
(though this one is a bit more complex).
from twee3-language-tools.
Related Issues (20)
- extension is catching closing tags, but not opening tags. [bug] HOT 2
- Syntax highlighting issue with Twee link markup inside SugarCube macro HOT 2
- SugarCube, bad highlighting for `$var.prop_name` HOT 1
- Feature request: Syntax highlighting inside SugarCube backquotes
- Allow warnings about IFID missing in StoryData to be turned off HOT 1
- The quickfix link sometimes disappears on mouse hover HOT 1
- New (July) update causes CPU to run continuously HOT 2
- Support relative path variable substitution in SugarCube 2 macro definition descriptions HOT 1
- Add enums for sc2 macro definitions
- Auto-indentation rules HOT 4
- Reopen Story Map on reload
- Story Map view resets when going to it from another file/tab HOT 3
- If the passage has a [nobr] tag or a section wrapped in a <<nobr>><<script>>, give a warning about // comments
- Add light-mode to story-map.
- Group: Tag and :: Passage vs :: Passage []
- [Sugarcube 2] "Malformed container macro! Opening tag not found!" in backtick-enclosed multi-line string
- Harlowe StoryMap missing arrow links between passages when changers are used HOT 3
- Add setting to toggle the "Go to macro definition" feature
- Request: Display folder relative to workspace folder
- Large Twee 3 Projects have a hard time with vscode. 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 twee3-language-tools.