Position arg type in NAT

This commit is contained in:
2022-12-18 05:39:15 +00:00
parent 3c933e8b0d
commit 0ac7156366
4 changed files with 25 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ package nat;
import kiss.Prelude;
import kiss.List;
import kiss.Stream;
import nat.components.Position;
import haxe.Constraints;
import haxe.DynamicAccess;
import uuid.Uuid;
@@ -27,6 +28,8 @@ enum CommandArgType {
// TODO playground name -- choose from archive.playgrounds
Position;
// Then again the more of these I add the more convoluted CollectAndValidateArgs gets,
// and the more stream reader methods I need to write
}

View File

@@ -106,7 +106,9 @@
(continuation entries)))
min
max))
(null)))
(Position
(ui.choosePosition "${arg.name}:" continuation))
(never null)))
// TODO try catch and ui.reportError
// TODO maaaybe support escape sequences?
@@ -176,7 +178,8 @@
((exprOr (SelectedEntries _ _) (Entries _ _)) `:Array<nat.Entry> ,name)
((Text _) `:String ,name)
((VarText _) `:Array<String> ,name)
((Number _ _ _) `:Float ,name)))
((Number _ _ _) `:Float ,name)
(Position `:Position ,name)))
commandArgs
(for [name type] argPairs
`(object name ,(symbolName name) type ,type))]

View File

@@ -65,7 +65,12 @@ interface ArchiveUI {
* Update UI to show that the set of selected entries has changed
*/
function onSelectionChanged(selectedEntries:Array<Entry>, lastSelectedEntries:Array<Entry>):Void;
/**
* Prompt the user to choose a position
*/
function choosePosition(prompt:String, resolve:Position->Void):Void;
/**
* A way to tell NAT where the cursor is
*/