runtime classes for components

master
Theunis J. Botha 2021-10-11 07:13:19 +02:00
parent 8e48d70ab2
commit f47c4f5ee1
3 changed files with 14 additions and 1 deletions

View File

@ -67,6 +67,10 @@ r3_completions() {
COMPREPLY=($(compgen -W "$(find "${R3_SRC_FOLDER}" -ls | grep drw | sed "s/.*src\/r3/./" | sed "s/$/\//" | sed "s/\/\//\//g" | perl -pe 's/\n/ /g')" "${COMP_WORDS[5]}"))
fi
if [[ "${#COMP_WORDS[@]}" == "7" && ( "${COMP_WORDS[3]}" =~ ^.*component_extends$ ) ]]; then
COMPREPLY=($(compgen -W "$(cat "${R3_SRC_FOLDER}"r3-runtime/* | grep "extends Runtime\b" | cut -d " " -f 2 | perl -pe 's/\n/ /g')" "${COMP_WORDS[6]}"))
fi
}
complete -F r3_completions r3

@ -1 +1 @@
Subproject commit dc929bfc2a1dffcf4f6bb45df734ad8468c3601a
Subproject commit 9b9691a248e7809ee933c7e0286b2745a1839e9e

9
r3.sh
View File

@ -135,6 +135,12 @@ then
EXTEND_CLASS_FILE_NAME="$(echo "r3${EXTEND_CLASS}" | sed 's/\([A-Z]\)/-\1/g' | awk '{print tolower($0)}' | sed 's/r3\-r3\-/r3-/' | sed 's/r3\-r3/r3/').js"
fi
if [[ "${ARG2}" = "component_extends" ]];
then
RUNTIME_CLASS="${ARG5}"
RUNTIME_CLASS_FILE_NAME="$(echo "r3${RUNTIME_CLASS}" | sed 's/\([A-Z]\)/-\1/g' | awk '{print tolower($0)}' | sed 's/r3\-r3\-/r3-/' | sed 's/r3\-r3/r3/').js"
fi
if [[ "${ARG2}" =~ ^.*base$ ]] ||
[ "${ARG2}" = "static" ];
then
@ -183,6 +189,9 @@ then
perl -p -i -e 's/^const Utils.*\n$//' "${R3_FOLDER}${FILE_NAME}"
fi
perl -p -i -e "s/\bRUNTIME_CLASS\b/${RUNTIME_CLASS}/" "${R3_FOLDER}${FILE_NAME}"
perl -p -i -e "s/\bRUNTIME_CLASS_FILE_NAME\b/${RUNTIME_CLASS_FILE_NAME}/" "${R3_FOLDER}${FILE_NAME}"
INCLUDE_PATH=$(echo "${INCLUDE_PATH}" | sed -E 's/([+,/,@])/\\\1/g')
sed -i "s/CLASS_NAME/${CLASS_NAME}/g" "${R3_FOLDER}${FILE_NAME}"