mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-02-17 05:13:26 +00:00
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
47 lines
1002 B
Nu
47 lines
1002 B
Nu
### These examples are here to show the user
|
|
### How the parser works by showing examples that will not parse
|
|
### The beginning nushell script writer / user may get confused
|
|
### as to why their script is not working
|
|
###
|
|
### If you uncomment any of the defs below these are
|
|
### the error messages you will see
|
|
#
|
|
#
|
|
#
|
|
### Examples p1 - p3 below elucidate the following idea:
|
|
### That a brace has to be on the same line as the def
|
|
###
|
|
###
|
|
### Error: nu::parser::missing_positional
|
|
### The error message is: "Missing required positional argument"
|
|
### missing block
|
|
###
|
|
### help: Usage: def <def_name> <params> <block>
|
|
###
|
|
#
|
|
### https://github.com/nushell/nushell/issues/2972
|
|
#
|
|
### All of these examples will not parse.
|
|
|
|
### def p1 [arg]
|
|
### { echo $arg }
|
|
|
|
### def p2 [arg]
|
|
### {
|
|
### echo $arg }
|
|
|
|
### def p3 [arg]
|
|
### {
|
|
### echo $arg
|
|
### }
|
|
|
|
### This breaks because you need a space between
|
|
### between foo and the left bracket
|
|
### def foo[] {
|
|
### "bar"
|
|
### }
|
|
### This works
|
|
### def foo [] {
|
|
### "bar"
|
|
### }
|