Skip to content

Commit 92e031b

Browse files
committed
refactor: tree-sitter-nu friendly alternative expressions
1 parent e926919 commit 92e031b

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

crates/nu-std/std-rfc/tables/mod.nu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export def aggregate [
5555
}
5656
}
5757

58-
def "error not-a-table" [span: record<start: int, end:int>] {
58+
def error-not-a-table [span: record<start: int, end:int>] {
5959
error make {
6060
msg: "input must be a table",
6161
label: {
@@ -69,9 +69,9 @@ export def aggregate [
6969
let IN = $in
7070
let md = metadata $in
7171

72-
let first = try { $IN | first } catch { error not-a-table $md.span }
72+
let first = try { $IN | first } catch { error-not-a-table $md.span }
7373
if not (($first | describe) starts-with record) {
74-
error not-a-table $md.span
74+
error-not-a-table $md.span
7575
}
7676

7777
let grouped = "items" in $first

crates/nu-std/std/help/mod.nu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def "nu-complete main-help" [] {
109109
}
110110

111111
def "nu-complete list-externs" [] {
112-
scope commands | where is_extern | select name description | rename value description
112+
scope commands | where is_extern == true | select name description | rename value description
113113
}
114114

115115
def build-help-header [
@@ -397,7 +397,7 @@ export def externs [
397397
] {
398398
let externs = (
399399
scope commands
400-
| where is_extern
400+
| where is_extern == true
401401
| select name module_name description
402402
| sort-by name
403403
| str trim
@@ -761,7 +761,7 @@ Here are some tips to help you get started.
761761
* ('help <name>' | pretty-cmd) - display help about a particular command, alias, or module
762762
* ('help --find <text to search>' | pretty-cmd) - search through all help commands table
763763
764-
Nushell works on the idea of a "(ansi default_italic)pipeline(ansi reset)". Pipelines are commands connected with the '|' character.
764+
Nushell works on the idea of a '(ansi default_italic)pipeline(ansi reset)'. Pipelines are commands connected with the '|' character.
765765
Each stage in the pipeline works together to load, parse, and display information to you.
766766
767767
(ansi green)Examples(ansi reset):

scripts/build-all.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std log warning
1+
use std/log warning
22

33
print '-------------------------------------------------------------------'
44
print 'Building nushell (nu) and all the plugins'

scripts/coverage-local.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env nu
2-
use std log warning
2+
use std/log warning
33

44
warning "./scripts/coverage-local.nu will be deprecated, please use the `toolkit cov` command instead"
55

scripts/test_virtualenv.nu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ let exe = $paths.1
1919

2020
let test_lines = [
2121
"python -c 'import sys; print(sys.executable)'" # 1
22-
"python -c 'import os; import sys; v = os.environ.get("VIRTUAL_ENV"); print(v)'" # 2
22+
`python -c 'import os; import sys; v = os.environ.get("VIRTUAL_ENV"); print(v)'` # 2
2323
$"overlay use '([$env.PWD $env_name $subdir activate.nu] | path join)'"
2424
"python -c 'import sys; print(sys.executable)'" # 3
25-
"python -c 'import os; import sys; v = os.environ.get("VIRTUAL_ENV"); print(v)'" # 4
25+
`python -c 'import os; import sys; v = os.environ.get("VIRTUAL_ENV"); print(v)'` # 4
2626
"print $env.VIRTUAL_ENV_PROMPT" # 5
2727
"deactivate"
2828
"python -c 'import sys; print(sys.executable)'" # 6
29-
"python -c 'import os; import sys; v = os.environ.get("VIRTUAL_ENV"); print(v)'" # 7
29+
`python -c 'import os; import sys; v = os.environ.get("VIRTUAL_ENV"); print(v)'` # 7
3030
]
3131

3232
def main [] {

0 commit comments

Comments
 (0)