Closed pefribeiro closed 3 years ago
@pefribeiro I found this shell command is very helpful to update all rct files together.
find . -name "*.rct" | xargs sed -i '/^\t*trigger$/d'
Hi @RandallYe,
find . -name ".rct" | xargs sed -i '/^\ttrigger$/d'
Thanks for your suggestion.
I think that your solution only works for cases where the keyword trigger is followed by a new line? It could be followed by a sequence of one or more white spaces, followed by a clock reset, a deadline, or }
or even the condition
and action
keywords. The other issue I see with sed
is that usually it performs matches on a line-by-line basis, making multi-line matches somewhat tricky.
Thanks, Pedro
@pefribeiro,
Yes, the command may not work for all cases. In my case, I have 10+ RoboChart projects for different purposes,
This command works only for this case to remove all empty trigger lines in rct files under current folders. It cannot replace other cases as you mentioned.
Thanks.
This pull request reflects the changes required in the textual language and the validator in light of the changes to the RoboChart metamodel in commit deb7cfed of the
circus.robocalc.robochart.parent
repository.There is a breaking change in the RoboChart Textual language (.rct) in that the keyword trigger is now optional. It is only used if there is an actual trigger associated with the transition. The following example now flags up an error on the fourth line:
To rectify such issues, it is possible to use Find/Replace of Eclipse over a whole workspace/project to quickly update one or more examples by proceeding as follows:
Search
>File
.trigger\s*\n*(\<\{|\}|condition|#|action)
Regular expression
Workspace
)Replace
$1
in the input box labelledWith:
, so that the match(...)
in the regular expression can be substituted in place.Alternatively the traditional
Find/Replace
dialog can be used to perform the same on a file-by-file basis.If you hit a problem with a particular example, or would like help, please let me know.