Skip to content

Commit 9c7e681

Browse files
committed
Even More Documentation
1 parent e53b4d8 commit 9c7e681

File tree

4 files changed

+28
-36
lines changed

4 files changed

+28
-36
lines changed

doc/Operations.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
- [Utilities](#utilities)
4747
- [Return To Origin](#return-to-origin)
4848
- [Setting Initial Origin](#setting-initial-origin)
49-
- [More On Prefix Operations](#more-on-prefix-operations)
49+
- [More On Prefix Operations](#more-on-prefix-operations)
5050

5151
<!-- /MarkdownTOC -->
5252

@@ -286,6 +286,7 @@ This can be convenient when you want to delete one alternative, write some new c
286286

287287
Furthermore, similarly to selecting alternatives, you can simultaneously delete more than one alternatives! you just need to specify more than one colors!
288288

289+
289290
![](./gif/op10.gif)
290291

291292

@@ -545,6 +546,7 @@ for the most part pretty straightforward I think
545546
"[smart] swap <color> with <color2>"
546547
```
547548

549+
548550
![](./gif/op13.gif)
549551

550552
Do keep in mind that alternatives do persist, though they of course get updated
@@ -676,7 +678,7 @@ Was introduced
676678

677679

678680

679-
### More On Prefix Operations
681+
## More On Prefix Operations
680682

681683

682684
When we talked earlier about prefix operations, it was briefly mentioned that these are executed silently. But what does it mean? It means that actions can be taken such as selecting some text, inserting or removing some text but at the end of the day these double queries do not change the state the way simple selection queries do. They do not set

doc/SubIndexing.md

+24-34
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ The core idea behind it is that most regions of interest can be conceptually bro
3535
- [Attributes](#attributes)
3636
- [Subscript](#subscript)
3737
- [Old Name As New Name](#old-name-as-new-name)
38-
- [Forwarding Nodes](#forwarding-nodes)
39-
- [new with 0.0.4](#new-with-004)
38+
- [Range Of Elements](#range-of-elements)
39+
- [Looking Deeper Nodes](#looking-deeper-nodes)
4040

4141
<!-- /MarkdownTOC -->
4242

@@ -45,7 +45,10 @@ The core idea behind it is that most regions of interest can be conceptually bro
4545

4646
## Introduction
4747

48-
you can find more information about what parts you can extract [below](#selectable).
48+
You can find more information about what parts you can extract [below](#selectable). In general,I have tried to make sub indexing work as naturally as possible,because I really want you to be able to approach these commands as intuitively as possible without trying to remember all of the various rules. Nonetheless there were cases where design decisions need to be made. And also compromises needed to be reached regarding the issue that you can view code both in a more linear fashion (tokens one after the other) as well as more treelike fashion (like how it is represented in the AST). I hope that my end decisions are not too far away from what you consider as natural thing to do!
49+
50+
51+
4952

5053
Now there are two ways in which the sub indexing functionality becomes available to the end-user:
5154

@@ -280,7 +283,7 @@ I chose to include them commended.
280283

281284
## Selectable
282285

283-
We have hopefully clarified the syntax and you have already probably seen some examples of what parts you can pickup from a selection. But it is time to go through them and lead to bead Maureen dictate
286+
We have hopefully clarified the syntax and you have already probably seen some examples of what parts you can pickup from a selection. But it is time to go through some of them, though you should keep in mind that there are more variable!
284287

285288
### Multiple Values
286289

@@ -363,7 +366,7 @@ Compared to want to use to be the case in 0.0.4, this means that you can easily
363366

364367
* or combination of the above,
365368

366-
in order to grab the individual items,you need to go to level deep
369+
in order to grab the individual items,you need to go 2 levels deep,which is of course an additional cost compared to 0.0.4
367370

368371
![](./gif/sub17.gif)
369372

@@ -377,56 +380,43 @@ in order to grab the individual items,you need to go to level deep
377380

378381
![](./gif/sub18.gif)
379382

380-
### Forwarding Nodes
381-
382-
383-
384-
![](./gif/sub14.gif)
385-
386-
387-
388-
please note however that we can still pick up such regions as a whole, the whole "forwarding" thing applies only when we try to extract something from them (when we subindex them). To clarify:
389-
390-
![](./gif/sub15.gif)
391383

384+
### Range Of Elements
392385

386+
Only for dictionaries,sets, lists and tuples
393387

394388

389+
![](./gif/sub14.gif)
395390

396391

397392

393+
### Looking Deeper Nodes
398394

399-
As illustrated above, you need to pay attention to how the various conditions are bound together
400-
(or binds weaker causing it to be higher in the AST) in the can only select smaller conditions from the outermost level!
401395

402-
This feature existed ever since the initial release but was only documented on 0.0.1 . This release also expanded the feature from applying only to ast.BoolOp nodes to encompass ast.Compare nodes as well! in plain English:
396+
For certain types of regions such as unary operations, where you have something like
403397

404-
![](./gif/big7.gif)
398+
```python
399+
not some_condition
400+
```
405401

406-
furthermore, big_roi_sub_index can make our lives easier even in cases like the one below:
402+
sub indexing the unary operation returns the result of sub indexing the
407403

408-
![](./gif/big8.gif)
404+
```python
405+
some_condition
406+
```
409407

410-
where we want to play with the indexes of a subscript!
411408

412-
### new with 0.0.4
413409

414-
Sub indexing functionality has been expanded to include picking up parts of strings :
415410

416-
![](./gif/big10.gif)
411+
please note however that we can still pick up such regions as a whole, the whole "looking deeper" thing applies only when we try to extract something from them (when we subindex them). To clarify:
417412

418-
We can pick up parts from the URL, individual words or letters, or part of a camel or snake case. this feature is still immatur and needs more work, but I am planning to improve and also expand it with the ability to select a whole range.
413+
![](./gif/sub15.gif)
419414

420-
Also something that was kind of missing,you can now select a subset of an arithmetic expression :
421415

422-
![](./gif/big12.gif)
416+
you can find more examples that are similar to this one in the [big ROI](./SelectBigROI.md) documentation. Please note also that though partly arbitrarily,partly for compatibility with `caller`, partly because there are already many options for arguments, something similar applies for function calls , as sub indexing them yields the same result see if we walked only with the calling function part!
423417

424-
Once again you need to pay attention to operator precedence and as you can see there are some edge cases that need to be fixed.
425418

426-
Finally, we clarify one more thing! What about relative vertical offsets when using above? We know that these abstract vertical keywords only count interesting lines, but what do we count as interesting here? To stay compatible with all of the above, we count all lines containing our desired big region of interest regardless of whether we can extract or not from them information with the sub index! As an example:
419+
![](./gif/sub19.gif)
427420

428-
![](./gif/big9.gif)
429421

430422

431-
please note however that there are limitations and sub indexes are more of a solution to make the simplest case faster
432-
rather than a systematic way of handling complex code!

doc/gif/op37.gif

286 KB
Loading

doc/gif/sub19.gif

92.3 KB
Loading

0 commit comments

Comments
 (0)