-
Notifications
You must be signed in to change notification settings - Fork 45
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
Conversion of shell script to batch file discards comments #73
Comments
But in case it doesn't work the same way when you try it, my shell script starts with #!/bin/bash # This script can be used for Linux or Mac OS to perform a digital simulation # of a single logical module, or portion thereof. It should be executed from # the folder containing the schematic file (module.kicad_sch) and a # user-created partial-testbench file called tb.v. # # Usage: # simulateModule MODULENAME [NETLISTFILE] # where MODULENAME is one of the names of Block II AGC logic modules: # A1, A2, A3, ..., A24. The optional parameter can give the name of a netlist # file. If it is not present, then KiCad v7 or later is required so that # we can generate the netlist file ourself from the command line. # First, parse the command line and perform sanity checks. if [ "$1" = "" ] then echo "No module number (A1, A2, ..., A24) given" exit 1 else modulenum=$1 fi and in the batch file this turns into @echo off IF "%~1" "=" "" ( echo "No module number (A1, A2, ..., A24) given" exit "1" ) ELSE ( SET "modulenum=%~1" ) |
This is no really possible based on the current stack - mainly because the parsing does not preserve comments - see: vorpaljs/bash-parser#62 |
It certainly seems possible, at least for full-line comments. Roughly speaking, a preprocessing step could convert full-line comments like # This is my comment into environment-variable assignments like _comment_="This is my comment" Conversion from shell-script to batch-file could then proceed normally, and afterward a postprocessing step could do the reverse conversion from SET _comment_="This is my comment" to REM This is my comment |
feat: convert full line comments - fixes #73
The title says it all.
This occurs on Linux Mint 21.3. If you want sample code in which this occurs, I attached such a file for issue #72.
The text was updated successfully, but these errors were encountered: