Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in parser definition for embedded quotes or curly braces in strings #26

Open
fatso83 opened this issue Mar 23, 2023 · 1 comment
Open

Comments

@fatso83
Copy link

fatso83 commented Mar 23, 2023

We have a stmux config looking like this:

[ 
-s 1/30 ['./stmux-help.sh' ]
:
-s 1/10 [ 'npm run dev:app1' .. 'npm run dev:app2' ] 
: 
[ '$(pnpm bin)/tsc --watch' .. 'npm run test -- --watch'  ]
:
[ "npx chokidar 'code/*/src/**/*.{js,ts,jsx,tsx}' -c 'npx eslint {path}'"]
]

If firing this up it seems that the wrong data is sent over to Blessed, as it crashes with

TypeError: Cannot read properties of undefined (reading 'slice')
    at /home/carlerik/code/nimble/frontend/node_modules/.pnpm/blessed@0.1.81/node_modules/blessed/lib/program.js:2547:18

This is the Program.prototype._attr = function(param, val) { ... function and the value of param and val is js,ts,jsx,tsx and undefined respectively.

I had a quick glance at the parser PEG file, but could not immediately spotting what to look for, and since there is no test coverage in the project I do not dare touching it either in fear of breaking existing behavior 😰 Running the command in a shell works fine: sh -c 'npx chokidar "code/*/src/**/*.{js,ts,jsx,tsx}" -c "npx eslint {path}"'

@fatso83 fatso83 changed the title Bug in parser definition for embedded quotes in strings Bug in parser definition for embedded quotes or curly braces in strings Mar 23, 2023
@fatso83
Copy link
Author

fatso83 commented Mar 23, 2023

I think this might be related to the curly braces, as the previous definition had the same quotes, but no curly braces:
[ 'npx chokidar "code/*/src/**/*.ts*" -c "npx eslint {path}"']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant