nushell / tree-sitter-nu

A tree-sitter grammar for nu-lang, the language of nushell
MIT License
97 stars 24 forks source link

Fixes to parsing of use, else & commands #90

Closed CabalCrow closed 4 months ago

CabalCrow commented 4 months ago

Description

Fix parsing of use, else & commands, by taking into account additional valid syntax.

Issues:

fixes #83 fixes #88 fixes #89

Details:

command

Split the command rule to accomodate 2 more syntaxes: ^'ls' and ^().

else

Allow non-block syntax for else (in comparison with if, which can't take anything, but a block).

use

Allow use to take pipe input.

fdncred commented 4 months ago

looks like we require prettier to be run - we might should say that somewhere.

CabalCrow commented 4 months ago

Formatted with prettier.

CabalCrow commented 4 months ago

Update the use rules to account for interpolated string as suggested by kubouch.

CabalCrow commented 4 months ago

Note that I didn't regenerate for the last change, in order to keep the diff minimal. After mergin the project should be regenerated with tree-sitter generate and the 3 generated src files should be commited for the project to work properly with python.

CabalCrow commented 4 months ago

Note that I didn't regenerate for the last change, in order to keep the diff minimal. After mergin the project should be regenerated with tree-sitter generate and the 3 generated src files should be commited for the project to work properly with python.

Actually not a good idea - the github tests require the grammar to already be generated. I regenerated it so it could pass the new tests.

fdncred commented 4 months ago

I updated the packages with npm update, npm outdated, and npm install and I got the windows stuff to work, at least on my windows system. let's see if ci passes.

fdncred commented 4 months ago

yay, it worked. let's move forward! Thanks @BigCrow!