Browse Source

Add unit tests for function list feature

go to notepad-plus-plus\PowerEditor\Test\FunctionList directory then
launch the following commands:
powershell ./unitTestLauncher.ps1
pull/4410/head
Don HO 7 years ago
parent
commit
3aaf083c1d
  1. 231
      PowerEditor/Test/FunctionList/asm/unitTest
  2. 1
      PowerEditor/Test/FunctionList/asm/unitTest.expected.result
  3. 45
      PowerEditor/Test/FunctionList/autoit/unitTest
  4. 1
      PowerEditor/Test/FunctionList/autoit/unitTest.expected.result
  5. 261
      PowerEditor/Test/FunctionList/bash/unitTest
  6. 1
      PowerEditor/Test/FunctionList/bash/unitTest.expected.result
  7. 115
      PowerEditor/Test/FunctionList/batch/unitTest
  8. 1
      PowerEditor/Test/FunctionList/batch/unitTest.expected.result
  9. 0
      PowerEditor/Test/FunctionList/c/unitTest
  10. 1
      PowerEditor/Test/FunctionList/c/unitTest.expected.result
  11. 6656
      PowerEditor/Test/FunctionList/cpp/unitTest
  12. 1
      PowerEditor/Test/FunctionList/cpp/unitTest.expected.result
  13. 37
      PowerEditor/Test/FunctionList/cs/unitTest
  14. 1
      PowerEditor/Test/FunctionList/cs/unitTest.expected.result
  15. 28
      PowerEditor/Test/FunctionList/ini/unitTest
  16. 1
      PowerEditor/Test/FunctionList/ini/unitTest.expected.result
  17. 394
      PowerEditor/Test/FunctionList/inno/unitTest
  18. 1
      PowerEditor/Test/FunctionList/inno/unitTest.expected.result
  19. 78
      PowerEditor/Test/FunctionList/java/unitTest
  20. 1
      PowerEditor/Test/FunctionList/java/unitTest.expected.result
  21. 364
      PowerEditor/Test/FunctionList/javascript/unitTest
  22. 1
      PowerEditor/Test/FunctionList/javascript/unitTest.expected.result
  23. 2014
      PowerEditor/Test/FunctionList/nsis/unitTest
  24. 1
      PowerEditor/Test/FunctionList/nsis/unitTest.expected.result
  25. 89
      PowerEditor/Test/FunctionList/perl/unitTest
  26. 1
      PowerEditor/Test/FunctionList/perl/unitTest.expected.result
  27. 89
      PowerEditor/Test/FunctionList/php/unitTest
  28. 1
      PowerEditor/Test/FunctionList/php/unitTest.expected.result
  29. 321
      PowerEditor/Test/FunctionList/powershell/unitTest
  30. 1
      PowerEditor/Test/FunctionList/powershell/unitTest.expected.result
  31. 280
      PowerEditor/Test/FunctionList/python/unitTest
  32. 1
      PowerEditor/Test/FunctionList/python/unitTest.expected.result
  33. 124
      PowerEditor/Test/FunctionList/ruby/unitTest
  34. 1
      PowerEditor/Test/FunctionList/ruby/unitTest.expected.result
  35. 46
      PowerEditor/Test/FunctionList/unitTestLauncher.ps1
  36. 58
      PowerEditor/Test/FunctionList/xml/unitTest
  37. 1
      PowerEditor/Test/FunctionList/xml/unitTest.expected.result
  38. 90
      PowerEditor/src/functionList.xml

231
PowerEditor/Test/FunctionList/asm/unitTest

@ -0,0 +1,231 @@
page ,132
title strcat - concatenate (append) one string to another
;***
;strcat.asm - contains strcat() and strcpy() routines
;
; Copyright (c) Microsoft Corporation. All rights reserved.
;
;Purpose:
; STRCAT concatenates (appends) a copy of the source string to the
; end of the destination string, returning the destination string.
;
;*******************************************************************************
.xlist
include cruntime.inc
.list
page
;***
;char *strcat(dst, src) - concatenate (append) one string to another
;
;Purpose:
; Concatenates src onto the end of dest. Assumes enough
; space in dest.
;
; Algorithm:
; char * strcat (char * dst, char * src)
; {
; char * cp = dst;
;
; while( *cp )
; ++cp; /* Find end of dst */
; while( *cp++ = *src++ )
; ; /* Copy src to end of dst */
; return( dst );
; }
;
;Entry:
; char *dst - string to which "src" is to be appended
; const char *src - string to be appended to the end of "dst"
;
;Exit:
; The address of "dst" in EAX
;
;Uses:
; EAX, ECX
;
;Exceptions:
;
;*******************************************************************************
page
;***
;char *strcpy(dst, src) - copy one string over another
;
;Purpose:
; Copies the string src into the spot specified by
; dest; assumes enough room.
;
; Algorithm:
; char * strcpy (char * dst, char * src)
; {
; char * cp = dst;
;
; while( *cp++ = *src++ )
; ; /* Copy src over dst */
; return( dst );
; }
;
;Entry:
; char * dst - string over which "src" is to be copied
; const char * src - string to be copied over "dst"
;
;Exit:
; The address of "dst" in EAX
;
;Uses:
; EAX, ECX
;
;Exceptions:
;*******************************************************************************
CODESEG
% public strcat, strcpy ; make both functions available
strcpy proc \
dst:ptr byte, \
src:ptr byte
OPTION PROLOGUE:NONE, EPILOGUE:NONE
push edi ; preserve edi
mov edi,[esp+8] ; edi points to dest string
jmp short copy_start
strcpy endp
align 16
strcat proc \
dst:ptr byte, \
src:ptr byte
OPTION PROLOGUE:NONE, EPILOGUE:NONE
.FPO ( 0, 2, 0, 0, 0, 0 )
mov ecx,[esp+4] ; ecx -> dest string
push edi ; preserve edi
test ecx,3 ; test if string is aligned on 32 bits
je short find_end_of_dest_string_loop
dest_misaligned: ; simple byte loop until string is aligned
mov al,byte ptr [ecx]
add ecx,1
test al,al
je short start_byte_3
test ecx,3
jne short dest_misaligned
align 4
find_end_of_dest_string_loop:
mov eax,dword ptr [ecx] ; read 4 bytes
mov edx,7efefeffh
add edx,eax
xor eax,-1
xor eax,edx
add ecx,4
test eax,81010100h
je short find_end_of_dest_string_loop
; found zero byte in the loop
mov eax,[ecx - 4]
test al,al ; is it byte 0
je short start_byte_0
test ah,ah ; is it byte 1
je short start_byte_1
test eax,00ff0000h ; is it byte 2
je short start_byte_2
test eax,0ff000000h ; is it byte 3
je short start_byte_3
jmp short find_end_of_dest_string_loop
; taken if bits 24-30 are clear and bit
; 31 is set
start_byte_3:
lea edi,[ecx - 1]
jmp short copy_start
start_byte_2:
lea edi,[ecx - 2]
jmp short copy_start
start_byte_1:
lea edi,[ecx - 3]
jmp short copy_start
start_byte_0:
lea edi,[ecx - 4]
; jmp short copy_start
; edi points to the end of dest string.
copy_start::
mov ecx,[esp+0ch] ; ecx -> sorc string
test ecx,3 ; test if string is aligned on 32 bits
je short main_loop_entrance
src_misaligned: ; simple byte loop until string is aligned
mov dl,byte ptr [ecx]
add ecx,1
test dl,dl
je short byte_0
mov [edi],dl
add edi,1
test ecx,3
jne short src_misaligned
jmp short main_loop_entrance
main_loop: ; edx contains first dword of sorc string
mov [edi],edx ; store one more dword
add edi,4 ; kick dest pointer
main_loop_entrance:
mov edx,7efefeffh
mov eax,dword ptr [ecx] ; read 4 bytes
add edx,eax
xor eax,-1
xor eax,edx
mov edx,[ecx] ; it's in cache now
add ecx,4 ; kick dest pointer
test eax,81010100h
je short main_loop
; found zero byte in the loop
; main_loop_end:
test dl,dl ; is it byte 0
je short byte_0
test dh,dh ; is it byte 1
je short byte_1
test edx,00ff0000h ; is it byte 2
je short byte_2
test edx,0ff000000h ; is it byte 3
je short byte_3
jmp short main_loop ; taken if bits 24-30 are clear and bit
; 31 is set
byte_3:
mov [edi],edx
mov eax,[esp+8] ; return in eax pointer to dest string
pop edi
ret
byte_2:
mov [edi],dx
mov eax,[esp+8] ; return in eax pointer to dest string
mov byte ptr [edi+2],0
pop edi
ret
byte_1:
mov [edi],dx
mov eax,[esp+8] ; return in eax pointer to dest string
pop edi
ret
byte_0:
mov [edi],dl
mov eax,[esp+8] ; return in eax pointer to dest string
pop edi
ret
strcat endp
end

1
PowerEditor/Test/FunctionList/asm/unitTest.expected.result

@ -0,0 +1 @@
{"leaves":["dst","src","dst","src","dest_misaligned","find_end_of_dest_string_loop","start_byte_3","start_byte_2","start_byte_1","start_byte_0","copy_start","src_misaligned","main_loop","main_loop_entrance","byte_3","byte_2","byte_1","byte_0"],"root":"unitTest"}

45
PowerEditor/Test/FunctionList/autoit/unitTest

@ -0,0 +1,45 @@
; Script Name : logoff.au3
; Author : Craig Richards
; Created : 6th February 2012
; Last Modified :
; Version : 1.0
; Modifications :
; Description : This is a simple splash screen to wrap around my logoff.bat incase someone presses my logoff button by mistake (New Microsoft Keyboard)
#Include <GuiConstants.au3> ; Include the GuiConstants Header File
#Include <StaticConstants.au3> ; Include the StaticConstants Header File
Opt('GuiOnEventMode', 1) ; Set the Option, and enable GuiOnEventMode
GUICreate ("Logoff Warning", 750, 750) ; Create a simple window
;GUISetIcon("icon.ico") ; Give it an icon
GUISetOnEvent($GUI_EVENT_CLOSE, 'GUIExit') ; Close the Window if the program is quit
GUICtrlCreatePic("1280.jpg",0,0,750,680) ; Put a picture in the background of the splash screen
GUICtrlCreateLabel("Please Choose an Option Below:", 220, 680, 300, 15, $SS_CENTER) ; A simple label on the screen
GUICtrlSetColor(-1,0xFF0000); ; Text of the label will be Red
GUICtrlCreateButton("Logoff", 170, 700, 200, 30) ; Create a simple button to run the logoff script
GUICTrlSetOnEvent(-1, 'logoff') ; If pressed run the logoff function
GUICtrlCreateButton("Cancel", 375, 700, 200, 30) ; Create a simple button to quit the program
GUICTrlSetOnEvent(-1, 'cancel') ; If pressed run the cancel function
Func logoff() ; Start of the logoff function
GUISetState(@SW_HIDE) ; Hide the Window
Run("u:\logoff.bat") ; Run the logoff batch file
Exit ; Quit the program
EndFunc ; End of the logoff Function
Func cancel() ; Start of the cancel function
GUISetState(@SW_HIDE) ; Hide the Window
Exit ; Quit the program
EndFunc ; End of the cancel Function
GUISetState(@SW_SHOW) ; Show the application Windows
While 1 ; A simple while loop
Sleep(500) ; Sleep to keep the window running
WEnd ; End of the While loop
Func GUIExit() ; Start of the GUIExit function
Exit ; Quit the program
EndFunc

1
PowerEditor/Test/FunctionList/autoit/unitTest.expected.result

@ -0,0 +1 @@
{"leaves":["logoff","cancel","GUIExit"],"root":"unitTest"}

261
PowerEditor/Test/FunctionList/bash/unitTest

@ -0,0 +1,261 @@
#!/bin/sh
setenv()
{
# Define and export.
eval ${1}="${2}"
export ${1}
}
case "${SCRIPTDIR}" in
/*) ;;
*) SCRIPTDIR="`pwd`/${SCRIPTDIR}"
esac
while true
do case "${SCRIPTDIR}" in
*/.) SCRIPTDIR="${SCRIPTDIR%/.}";;
*) break;;
esac
done
# The script directory is supposed to be in $TOPDIR/packages/os400.
TOPDIR=`dirname "${SCRIPTDIR}"`
TOPDIR=`dirname "${TOPDIR}"`
export SCRIPTDIR TOPDIR
# Extract the SONAME from the library makefile.
SONAME=`sed -e '/^VERSIONINFO=/!d' -e 's/^.* \([0-9]*\):.*$/\1/' -e 'q' \
< "${TOPDIR}/lib/Makefile.am"`
export SONAME
################################################################################
#
# Tunable configuration parameters.
#
################################################################################
setenv TARGETLIB 'CURL' # Target OS/400 program library.
setenv STATBNDDIR 'CURL_A' # Static binding directory.
setenv DYNBNDDIR 'CURL' # Dynamic binding directory.
setenv SRVPGM "CURL.${SONAME}" # Service program.
setenv TGTCCSID '500' # Target CCSID of objects.
setenv DEBUG '*ALL' # Debug level.
setenv OPTIMIZE '10' # Optimisation level
setenv OUTPUT '*NONE' # Compilation output option.
setenv TGTRLS 'V6R1M0' # Target OS release.
setenv IFSDIR '/curl' # Installation IFS directory.
# Define ZLIB availability and locations.
setenv WITH_ZLIB 0 # Define to 1 to enable.
setenv ZLIB_INCLUDE '/zlib/include' # ZLIB include IFS directory.
setenv ZLIB_LIB 'ZLIB' # ZLIB library.
setenv ZLIB_BNDDIR 'ZLIB_A' # ZLIB binding directory.
# Define LIBSSH2 availability and locations.
setenv WITH_LIBSSH2 0 # Define to 1 to enable.
setenv LIBSSH2_INCLUDE '/libssh2/include' # LIBSSH2 include IFS directory.
setenv LIBSSH2_LIB 'LIBSSH2' # LIBSSH2 library.
setenv LIBSSH2_BNDDIR 'LIBSSH2_A' # LIBSSH2 binding directory.
################################################################################
# Need to get the version definitions.
LIBCURL_VERSION=`grep '^#define *LIBCURL_VERSION ' \
"${TOPDIR}/include/curl/curlver.h" |
sed 's/.*"\(.*\)".*/\1/'`
LIBCURL_VERSION_MAJOR=`grep '^#define *LIBCURL_VERSION_MAJOR ' \
"${TOPDIR}/include/curl/curlver.h" |
sed 's/^#define *LIBCURL_VERSION_MAJOR *\([^ ]*\).*/\1/'`
LIBCURL_VERSION_MINOR=`grep '^#define *LIBCURL_VERSION_MINOR ' \
"${TOPDIR}/include/curl/curlver.h" |
sed 's/^#define *LIBCURL_VERSION_MINOR *\([^ ]*\).*/\1/'`
LIBCURL_VERSION_PATCH=`grep '^#define *LIBCURL_VERSION_PATCH ' \
"${TOPDIR}/include/curl/curlver.h" |
sed 's/^#define *LIBCURL_VERSION_PATCH *\([^ ]*\).*/\1/'`
LIBCURL_VERSION_NUM=`grep '^#define *LIBCURL_VERSION_NUM ' \
"${TOPDIR}/include/curl/curlver.h" |
sed 's/^#define *LIBCURL_VERSION_NUM *0x\([^ ]*\).*/\1/'`
LIBCURL_TIMESTAMP=`grep '^#define *LIBCURL_TIMESTAMP ' \
"${TOPDIR}/include/curl/curlver.h" |
sed 's/.*"\(.*\)".*/\1/'`
export LIBCURL_VERSION
export LIBCURL_VERSION_MAJOR LIBCURL_VERSION_MINOR LIBCURL_VERSION_PATCH
export LIBCURL_VERSION_NUM LIBCURL_TIMESTAMP
################################################################################
#
# OS/400 specific definitions.
#
################################################################################
LIBIFSNAME="/QSYS.LIB/${TARGETLIB}.LIB"
################################################################################
#
# Procedures.
#
################################################################################
# action_needed dest [src]
#
# dest is an object to build
# if specified, src is an object on which dest depends.
#
# exit 0 (succeeds) if some action has to be taken, else 1.
action_needed()
{
[ ! -e "${1}" ] && return 0
[ "${2}" ] || return 1
[ "${1}" -ot "${2}" ] && return 0
return 1
}
# canonicalize_path path
#
# Return canonicalized path as:
# - Absolute
# - No . or .. component.
canonicalize_path()
{
if expr "${1}" : '^/' > /dev/null
then P="${1}"
else P="`pwd`/${1}"
fi
R=
IFSSAVE="${IFS}"
IFS="/"
for C in ${P}
do IFS="${IFSSAVE}"
case "${C}" in
.) ;;
..) R=`expr "${R}" : '^\(.*/\)..*'`
;;
?*) R="${R}${C}/"
;;
*) ;;
esac
done
IFS="${IFSSAVE}"
echo "/`expr "${R}" : '^\(.*\)/'`"
}
# make_module module_name source_name [additional_definitions]
#
# Compile source name into ASCII module if needed.
# As side effect, append the module name to variable MODULES.
# Set LINK to "YES" if the module has been compiled.
make_module()
{
MODULES="${MODULES} ${1}"
MODIFSNAME="${LIBIFSNAME}/${1}.MODULE"
action_needed "${MODIFSNAME}" "${2}" || return 0;
SRCDIR=`dirname \`canonicalize_path "${2}"\``
# #pragma convert has to be in the source file itself, i.e.
# putting it in an include file makes it only active
# for that include file.
# Thus we build a temporary file with the pragma prepended to
# the source file and we compile that themporary file.
echo "#line 1 \"${2}\"" > __tmpsrcf.c
echo "#pragma convert(819)" >> __tmpsrcf.c
echo "#line 1" >> __tmpsrcf.c
cat "${2}" >> __tmpsrcf.c
CMD="CRTCMOD MODULE(${TARGETLIB}/${1}) SRCSTMF('__tmpsrcf.c')"
# CMD="${CMD} SYSIFCOPT(*IFS64IO) OPTION(*INCDIRFIRST *SHOWINC *SHOWSYS)"
CMD="${CMD} SYSIFCOPT(*IFS64IO) OPTION(*INCDIRFIRST)"
CMD="${CMD} LOCALETYPE(*LOCALE) FLAG(10)"
CMD="${CMD} INCDIR('/qibm/proddata/qadrt/include'"
CMD="${CMD} '${TOPDIR}/include/curl' '${TOPDIR}/include' '${SRCDIR}'"
CMD="${CMD} '${TOPDIR}/packages/OS400'"
if [ "${WITH_ZLIB}" != "0" ]
then CMD="${CMD} '${ZLIB_INCLUDE}'"
fi
if [ "${WITH_LIBSSH2}" != "0" ]
then CMD="${CMD} '${LIBSSH2_INCLUDE}'"
fi
CMD="${CMD} ${INCLUDES})"
CMD="${CMD} TGTCCSID(${TGTCCSID}) TGTRLS(${TGTRLS})"
CMD="${CMD} OUTPUT(${OUTPUT})"
CMD="${CMD} OPTIMIZE(${OPTIMIZE})"
CMD="${CMD} DBGVIEW(${DEBUG})"
DEFINES="${3} BUILDING_LIBCURL"
if [ "${WITH_ZLIB}" != "0" ]
then DEFINES="${DEFINES} HAVE_LIBZ HAVE_ZLIB_H"
fi
if [ "${WITH_LIBSSH2}" != "0" ]
then DEFINES="${DEFINES} USE_LIBSSH2 HAVE_LIBSSH2_H"
fi
if [ "${DEFINES}" ]
then CMD="${CMD} DEFINE(${DEFINES})"
fi
system "${CMD}"
rm -f __tmpsrcf.c
LINK=YES
}
# Determine DB2 object name from IFS name.
db2_name()
{
if [ "${2}" = 'nomangle' ]
then basename "${1}" |
tr 'a-z-' 'A-Z_' |
sed -e 's/\..*//' \
-e 's/^\(.\).*\(.........\)$/\1\2/'
else basename "${1}" |
tr 'a-z-' 'A-Z_' |
sed -e 's/\..*//' \
-e 's/^CURL_*/C/' \
-e 's/^\(.\).*\(.........\)$/\1\2/'
fi
}
# Copy IFS file replacing version info.
versioned_copy()
{
sed -e "s/@LIBCURL_VERSION@/${LIBCURL_VERSION}/g" \
-e "s/@LIBCURL_VERSION_MAJOR@/${LIBCURL_VERSION_MAJOR}/g" \
-e "s/@LIBCURL_VERSION_MINOR@/${LIBCURL_VERSION_MINOR}/g" \
-e "s/@LIBCURL_VERSION_PATCH@/${LIBCURL_VERSION_PATCH}/g" \
-e "s/@LIBCURL_VERSION_NUM@/${LIBCURL_VERSION_NUM}/g" \
-e "s/@LIBCURL_TIMESTAMP@/${LIBCURL_TIMESTAMP}/g" \
< "${1}" > "${2}"
}

1
PowerEditor/Test/FunctionList/bash/unitTest.expected.result

@ -0,0 +1 @@
{"leaves":["setenv","action_needed","canonicalize_path","make_module","db2_name","versioned_copy"],"root":"unitTest"}

115
PowerEditor/Test/FunctionList/batch/unitTest

@ -0,0 +1,115 @@
@echo off
rem Inno Setup
rem Copyright (C) 1997-2012 Jordan Russell
rem Portions by Martijn Laan
rem For conditions of distribution and use, see LICENSE.TXT.
rem
rem Batch file to compile all projects with Unicode support
setlocal
if exist compilesettings.bat goto compilesettingsfound
:compilesettingserror
echo compilesettings.bat is missing or incomplete. It needs to be created
echo with either of the following lines, adjusted for your system:
echo.
echo set DELPHI2009ROOT=C:\Program Files\CodeGear\RAD Studio\6.0 [Path to Delphi 2009 (or 2010)]
echo or
echo set DELPHIXEROOT=C:\Program Files\Embarcadero\RAD Studio\8.0 [Path to Delphi XE (or later)]
goto failed2
:compilesettingsfound
set DELPHI2009ROOT=
set DELPHIXEROOT=
call .\compilesettings.bat
if "%DELPHI2009ROOT%"=="" if "%DELPHIXEROOT%"=="" goto compilesettingserror
if not "%DELPHI2009ROOT%"=="" if not "%DELPHIXEROOT%"=="" goto compilesettingserror
rem -------------------------------------------------------------------------
rem Compile each project separately because it seems Delphi
rem carries some settings (e.g. $APPTYPE) between projects
rem if multiple projects are specified on the command line.
rem Note:
rem Command line parameter "--peflags:1" below equals the
rem {$SetPEFlags IMAGE_FILE_RELOCS_STRIPPED} directive.
rem This causes the Delphi compiler to not just set the flag
rem but also it actually strips relocations. Used instead of
rem calling StripReloc like compile.bat does.
cd Projects
if errorlevel 1 goto exit
cd ISPP
if errorlevel 1 goto failed
echo - ISPP.dpr
if "%DELPHIXEROOT%"=="" (
"%DELPHI2009ROOT%\bin\dcc32.exe" --no-config --string-checks:off -Q -B -H -W %1 -U"%DELPHI2009ROOT%\lib" -E..\..\Files ISPP.dpr
) else (
"%DELPHIXEROOT%\bin\dcc32.exe" --no-config -NSsystem;system.win;winapi -Q -B -H -W %1 -U"%DELPHIXEROOT%\lib\win32\release" -E..\..\Files ISPP.dpr
)
if errorlevel 1 goto failed
cd ..
echo - Compil32.dpr
if "%DELPHIXEROOT%"=="" (
"%DELPHI2009ROOT%\bin\dcc32.exe" --no-config --peflags:1 --string-checks:off -Q -B -H -W %1 -U"%DELPHI2009ROOT%\lib;..\Components;..\Components\UniPs\Source" -E..\Files -DPS_MINIVCL;PS_NOGRAPHCONST;PS_PANSICHAR;PS_NOINTERFACEGUIDBRACKETS Compil32.dpr
) else (
"%DELPHIXEROOT%\bin\dcc32.exe" --no-config --peflags:1 -NSsystem;system.win;winapi;vcl -Q -B -H -W %1 -U"%DELPHIXEROOT%\lib\win32\release;..\Components;..\Components\UniPs\Source" -E..\Files -DPS_MINIVCL;PS_NOGRAPHCONST;PS_PANSICHAR;PS_NOINTERFACEGUIDBRACKETS Compil32.dpr
)
if errorlevel 1 goto failed
echo - ISCC.dpr
if "%DELPHIXEROOT%"=="" (
"%DELPHI2009ROOT%\bin\dcc32.exe" --no-config --peflags:1 --string-checks:off -Q -B -H -W %1 -U"%DELPHI2009ROOT%\lib;..\Components;..\Components\UniPs\Source" -E..\Files -DPS_MINIVCL;PS_NOGRAPHCONST;PS_PANSICHAR;PS_NOINTERFACEGUIDBRACKETS ISCC.dpr
) else (
"%DELPHIXEROOT%\bin\dcc32.exe" --no-config --peflags:1 -NSsystem;system.win;winapi -Q -B -H -W %1 -U"%DELPHIXEROOT%\lib\win32\release;..\Components;..\Components\UniPs\Source" -E..\Files -DPS_MINIVCL;PS_NOGRAPHCONST;PS_PANSICHAR;PS_NOINTERFACEGUIDBRACKETS ISCC.dpr
)
if errorlevel 1 goto failed
echo - ISCmplr.dpr
if "%DELPHIXEROOT%"=="" (
"%DELPHI2009ROOT%\bin\dcc32.exe" --no-config --string-checks:off -Q -B -H -W %1 -U"%DELPHI2009ROOT%\lib;..\Components;..\Components\UniPs\Source" -E..\Files -DPS_MINIVCL;PS_NOGRAPHCONST;PS_PANSICHAR;PS_NOINTERFACEGUIDBRACKETS ISCmplr.dpr
) else (
"%DELPHIXEROOT%\bin\dcc32.exe" --no-config -NSsystem;system.win;winapi -Q -B -H -W %1 -U"%DELPHIXEROOT%\lib\win32\release;..\Components;..\Components\UniPs\Source" -E..\Files -DPS_MINIVCL;PS_NOGRAPHCONST;PS_PANSICHAR;PS_NOINTERFACEGUIDBRACKETS ISCmplr.dpr
)
if errorlevel 1 goto failed
echo - SetupLdr.dpr
if "%DELPHIXEROOT%"=="" (
"%DELPHI2009ROOT%\bin\dcc32.exe" --no-config --peflags:1 --string-checks:off -Q -B -H -W %1 -U"%DELPHI2009ROOT%\lib;..\Components" -E..\Files SetupLdr.dpr
) else (
"%DELPHIXEROOT%\bin\dcc32.exe" --no-config --peflags:1 -NSsystem;system.win;winapi -Q -B -H -W %1 -U"%DELPHIXEROOT%\lib\win32\release;..\Components" -E..\Files SetupLdr.dpr
)
if errorlevel 1 goto failed
echo - Setup.dpr
if "%DELPHIXEROOT%"=="" (
"%DELPHI2009ROOT%\bin\dcc32.exe" --no-config --peflags:1 --string-checks:off -Q -B -H -W %1 -U"%DELPHI2009ROOT%\lib;..\Components;..\Components\UniPs\Source" -E..\Files -DPS_MINIVCL;PS_NOGRAPHCONST;PS_PANSICHAR;PS_NOINTERFACEGUIDBRACKETS Setup.dpr
) else (
"%DELPHIXEROOT%\bin\dcc32.exe" --no-config --peflags:1 -NSsystem;system.win;winapi;vcl -Q -B -H -W %1 -U"%DELPHIXEROOT%\lib\win32\release;..\Components;..\Components\UniPs\Source" -E..\Files -DPS_MINIVCL;PS_NOGRAPHCONST;PS_PANSICHAR;PS_NOINTERFACEGUIDBRACKETS Setup.dpr
)
if errorlevel 1 goto failed
echo - Renaming files
cd ..\Files
if errorlevel 1 goto failed
move SetupLdr.exe SetupLdr.e32
if errorlevel 1 goto failed
move Setup.exe Setup.e32
if errorlevel 1 goto failed
echo Success!
cd ..
goto exit
:failed
echo *** FAILED ***
cd ..
:failed2
exit /b 1
:exit

1
PowerEditor/Test/FunctionList/batch/unitTest.expected.result

@ -0,0 +1 @@
{"leaves":["compilesettingserror","compilesettingsfound","failed","failed2"],"root":"unitTest"}

0
PowerEditor/Test/FunctionList/c/unitTest

1
PowerEditor/Test/FunctionList/c/unitTest.expected.result

@ -0,0 +1 @@
{"root":"unitTest"}

6656
PowerEditor/Test/FunctionList/cpp/unitTest

File diff suppressed because it is too large Load Diff

1
PowerEditor/Test/FunctionList/cpp/unitTest.expected.result

@ -0,0 +1 @@
{"leaves":["strVal","decStrVal","hexStrVal","getKwClassFromName","getAsciiLenFromBase64Len","base64ToAscii","cutString","EnumFontFamExProc","RGB2int","convertIntToFormatType"],"nodes":[{"leaves":["addLanguageFromXml","switchToLang"],"name":"LocalizationSwitcher"},{"leaves":["getThemeFromXmlFileName"],"name":"ThemeSwitcher"},{"leaves":["getWindowsVersion","reloadStylers","reloadLang","getSpecialFolderLocation","getSettingsFolder","load","destroyInstance","saveConfig_xml","setWorkSpaceFilePath","removeTransparent","SetTransparent","isExistingExternalLangName","getUserDefinedLangNameFromExt","getExternalLangIndexFromName","getULCFromName","getCurLineHilitingColour","setCurLineHilitingColour","setFontList","isInFontList","getLangKeywordsFromXmlTree","getExternalLexerFromXmlTree","addExternalLangToEnd","getUserStylersFromXmlTree","getUserParametersFromXmlTree","getUserDefineLangsFromXmlTree","getShortcutsFromXmlTree","getMacrosFromXmlTree","getUserCmdsFromXmlTree","getPluginCmdsFromXmlTree","getScintKeysFromXmlTree","getBlackListFromXmlTree","initMenuKeys","initScintillaKeys","reloadContextMenuFromXmlTree","getCmdIdFromMenuEntryItemName","getPluginCmdIdFromMenuEntryItemName","getContextMenuFromXmlTree","setWorkingDir","loadSession","getSessionFromXmlTree","feedFileListParameters","feedProjectPanelsParameters","feedFileBrowserParameters","feedFindHistoryParameters","feedShortcut","feedMacros","getActions","feedUserCmds","feedPluginCustomizedCmds","feedScintKeys","feedBlacklist","getShortcuts","feedUserLang","importUDLFromFile","exportUDLToFile","getLangFromExt","setCloudChoice","removeCloudChoice","isCloudPathChanged","writeSettingsFilesOnCloudForThe1stTime","writeUserDefinedLang","insertCmd","insertMacro","insertUserCmd","insertPluginCmd","insertScintKey","writeSession","writeShortcuts","addUserLangToEnd","removeUserLang","feedUserSettings","feedUserKeywordList","feedUserStyles","feedStylerArray","writeRecentFileHistorySettings","writeProjectPanelsSettings","writeFileBrowserSettings","writeHistory","getChildElementByAttribut","getLangIDFromStr","getLocPathFromStr","feedKeyWordsParameters","feedGUIParameters","feedScintillaParam","feedDockingManager","writeScintillaParams","createXmlTreeFromGUIParams","writeFindHistory","insertDockingParamNode","writePrintSetting","writeExcludedLangList","insertGUIConfigBoolNode","langTypeToCommandID","getWinVerBitStr","writeStyles","insertTabInfo","writeStyle2Element","insertUserLang2Tree","stylerStrOp","addUserModifiedIndex","addPluginModifiedIndex","addScintillaModifiedIndex","safeWow64EnableWow64FsRedirection"],"name":"NppParameters"},{"leaves":["addLexerStyler","eraseAll"],"name":"LexerStylerArray"},{"leaves":["addStyler"],"name":"StyleArray"},{"leaves":["now"],"name":"Date"}],"root":"unitTest"}

37
PowerEditor/Test/FunctionList/cs/unitTest

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.Linq;
using System.Web;
using Owin;
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.Cookies;
using Microsoft.Owin.Security.OpenIdConnect;
namespace $OwinNamespace$
{
public partial class $OwinClass$
{
private static string clientId = ConfigurationManager.AppSettings["ida:ClientId"];
private static string aadInstance = ConfigurationManager.AppSettings["ida:AADInstance"];
private static string tenantId = ConfigurationManager.AppSettings["ida:TenantId"];
private static string postLogoutRedirectUri = ConfigurationManager.AppSettings["ida:PostLogoutRedirectUri"];
private static string authority = aadInstance + tenantId;
public void ConfigureAuth(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions());
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
ClientId = clientId,
Authority = authority,
PostLogoutRedirectUri = postLogoutRedirectUri
});
}
}
}

1
PowerEditor/Test/FunctionList/cs/unitTest.expected.result

@ -0,0 +1 @@
{"leaves":["ConfigureAuth"],"root":"unitTest"}

28
PowerEditor/Test/FunctionList/ini/unitTest

@ -0,0 +1,28 @@
[Flow]
CurrentPhase=OOBEBoot,Start
CurrentOperation=132,end
OperationResult=0
[BootEntries]
DownlevelCurrent={B92EB69E-B2DB-11E7-934D-C49DED11D19D}
DownlevelDefault={B92EB69E-B2DB-11E7-934D-C49DED11D19D}
NewOS={541947F5-B2DC-11E7-BA3E-C49DED11D19E}
Rollback={7254A080-1510-4E85-AC0F-E7FB3D444736}
RollbackExternal=No
[BootManager]
Timeout=0
[OldOS]
ConnectedStandby=Yes
[RecoveryPartition]
Backup=Yes
[Quarantine.WinOld]
0=GlobalPath,{826A734A-88FA-4773-AF09-B90072E096D3},0,407896064,2727568020,Windows.old
[Quarantine.NewPaths]
0=GlobalPath,{826A734A-88FA-4773-AF09-B90072E096D3},0,407896064,2727568020,PerfLogs
1=GlobalPath,{826A734A-88FA-4773-AF09-B90072E096D3},0,407896064,2727568020,Program Files
2=GlobalPath,{826A734A-88FA-4773-AF09-B90072E096D3},0,407896064,2727568020,Program Files (x86)
3=GlobalPath,{826A734A-88FA-4773-AF09-B90072E096D3},0,407896064,2727568020,ProgramData
4=GlobalPath,{826A734A-88FA-4773-AF09-B90072E096D3},0,407896064,2727568020,Users
5=GlobalPath,{826A734A-88FA-4773-AF09-B90072E096D3},0,407896064,2727568020,Windows
[Profiles]
S-1-5-21-1753568369-220679467-1382890926-1001.Profile.Old=GlobalPath,{826A734A-88FA-4773-AF09-B90072E096D3},0,407896064,2727568020,Users\Don Ho
S-1-5-21-1753568369-220679467-1382890926-1001.Profile.New=GlobalPath,{826A734A-88FA-4773-AF09-B90072E096D3},0,407896064,2727568020,Users\Don Ho

1
PowerEditor/Test/FunctionList/ini/unitTest.expected.result

@ -0,0 +1 @@
{"leaves":["Flow","BootEntries","BootManager","OldOS","RecoveryPartition","Quarantine.WinOld","Quarantine.NewPaths","Profiles"],"root":"unitTest"}

394
PowerEditor/Test/FunctionList/inno/unitTest

@ -0,0 +1,394 @@
;contribute: http://github.com/stfx/innodependencyinstaller
;original article: http://codeproject.com/Articles/20868/NET-Framework-1-1-2-0-3-5-Installer-for-InnoSetup
;comment out product defines to disable installing them
;#define use_iis
#define use_kb835732
#define use_msi20
#define use_msi31
#define use_msi45
#define use_ie6
#define use_dotnetfx11
#define use_dotnetfx11lp
#define use_dotnetfx20
#define use_dotnetfx20lp
#define use_dotnetfx35
#define use_dotnetfx35lp
#define use_dotnetfx40
#define use_wic
#define use_dotnetfx45
#define use_dotnetfx46
#define use_dotnetfx47
#define use_msiproduct
#define use_vc2005
#define use_vc2008
#define use_vc2010
#define use_vc2012
#define use_vc2013
#define use_vc2015
#define use_vc2017
;requires dxwebsetup.exe in src dir
;#define use_directxruntime
#define use_mdac28
#define use_jet4sp8
#define use_sqlcompact35sp2
#define use_sql2005express
#define use_sql2008express
#define MyAppSetupName 'MyProgram'
#define MyAppVersion '6.0'
[Setup]
AppName={#MyAppSetupName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppSetupName} {#MyAppVersion}
AppCopyright=Copyright © 2007-2017 stfx
VersionInfoVersion={#MyAppVersion}
VersionInfoCompany=stfx
AppPublisher=stfx
;AppPublisherURL=http://...
;AppSupportURL=http://...
;AppUpdatesURL=http://...
OutputBaseFilename={#MyAppSetupName}-{#MyAppVersion}
DefaultGroupName={#MyAppSetupName}
DefaultDirName={pf}\{#MyAppSetupName}
UninstallDisplayIcon={app}\MyProgram.exe
OutputDir=bin
SourceDir=.
AllowNoIcons=yes
;SetupIconFile=MyProgramIcon
SolidCompression=yes
;MinVersion default value: "0,5.0 (Windows 2000+) if Unicode Inno Setup, else 4.0,4.0 (Windows 95+)"
;MinVersion=0,5.0
PrivilegesRequired=admin
ArchitecturesAllowed=x86 x64 ia64
ArchitecturesInstallIn64BitMode=x64 ia64
; downloading and installing dependencies will only work if the memo/ready page is enabled (default and current behaviour)
DisableReadyPage=no
DisableReadyMemo=no
; supported languages
#include "scripts\lang\english.iss"
#include "scripts\lang\german.iss"
#include "scripts\lang\french.iss"
#include "scripts\lang\italian.iss"
#include "scripts\lang\dutch.iss"
#ifdef UNICODE
#include "scripts\lang\chinese.iss"
#include "scripts\lang\polish.iss"
#include "scripts\lang\russian.iss"
#include "scripts\lang\japanese.iss"
#endif
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "src\MyProgram-x64.exe"; DestDir: "{app}"; DestName: "MyProgram.exe"; Check: IsX64
Source: "src\MyProgram-IA64.exe"; DestDir: "{app}"; DestName: "MyProgram.exe"; Check: IsIA64
Source: "src\MyProgram.exe"; DestDir: "{app}"; Check: not Is64BitInstallMode
[Icons]
Name: "{group}\{#MyAppSetupName}"; Filename: "{app}\MyProgram.exe"
Name: "{group}\{cm:UninstallProgram,{#MyAppSetupName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppSetupName}"; Filename: "{app}\MyProgram.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppSetupName}"; Filename: "{app}\MyProgram.exe"; Tasks: quicklaunchicon
[Run]
Filename: "{app}\MyProgram.exe"; Description: "{cm:LaunchProgram,{#MyAppSetupName}}"; Flags: nowait postinstall skipifsilent
[CustomMessages]
DependenciesDir=MyProgramDependencies
WindowsServicePack=Windows %1 Service Pack %2
; shared code for installing the products
#include "scripts\products.iss"
; helper functions
#include "scripts\products\stringversion.iss"
#include "scripts\products\winversion.iss"
#include "scripts\products\fileversion.iss"
#include "scripts\products\dotnetfxversion.iss"
; actual products
#ifdef use_iis
#include "scripts\products\iis.iss"
#endif
#ifdef use_kb835732
#include "scripts\products\kb835732.iss"
#endif
#ifdef use_msi20
#include "scripts\products\msi20.iss"
#endif
#ifdef use_msi31
#include "scripts\products\msi31.iss"
#endif
#ifdef use_msi45
#include "scripts\products\msi45.iss"
#endif
#ifdef use_ie6
#include "scripts\products\ie6.iss"
#endif
#ifdef use_dotnetfx11
#include "scripts\products\dotnetfx11.iss"
#include "scripts\products\dotnetfx11sp1.iss"
#ifdef use_dotnetfx11lp
#include "scripts\products\dotnetfx11lp.iss"
#endif
#endif
#ifdef use_dotnetfx20
#include "scripts\products\dotnetfx20.iss"
#include "scripts\products\dotnetfx20sp1.iss"
#include "scripts\products\dotnetfx20sp2.iss"
#ifdef use_dotnetfx20lp
#include "scripts\products\dotnetfx20lp.iss"
#include "scripts\products\dotnetfx20sp1lp.iss"
#include "scripts\products\dotnetfx20sp2lp.iss"
#endif
#endif
#ifdef use_dotnetfx35
;#include "scripts\products\dotnetfx35.iss"
#include "scripts\products\dotnetfx35sp1.iss"
#ifdef use_dotnetfx35lp
;#include "scripts\products\dotnetfx35lp.iss"
#include "scripts\products\dotnetfx35sp1lp.iss"
#endif
#endif
#ifdef use_dotnetfx40
#include "scripts\products\dotnetfx40client.iss"
#include "scripts\products\dotnetfx40full.iss"
#endif
#ifdef use_dotnetfx45
#include "scripts\products\dotnetfx45.iss"
#endif
#ifdef use_dotnetfx46
#include "scripts\products\dotnetfx46.iss"
#endif
#ifdef use_dotnetfx47
#include "scripts\products\dotnetfx47.iss"
#endif
#ifdef use_wic
#include "scripts\products\wic.iss"
#endif
#ifdef use_msiproduct
#include "scripts\products\msiproduct.iss"
#endif
#ifdef use_vc2005
#include "scripts\products\vcredist2005.iss"
#endif
#ifdef use_vc2008
#include "scripts\products\vcredist2008.iss"
#endif
#ifdef use_vc2010
#include "scripts\products\vcredist2010.iss"
#endif
#ifdef use_vc2012
#include "scripts\products\vcredist2012.iss"
#endif
#ifdef use_vc2013
#include "scripts\products\vcredist2013.iss"
#endif
#ifdef use_vc2015
#include "scripts\products\vcredist2015.iss"
#endif
#ifdef use_vc2017
#include "scripts\products\vcredist2017.iss"
#endif
#ifdef use_directxruntime
#include "scripts\products\directxruntime.iss"
#endif
#ifdef use_mdac28
#include "scripts\products\mdac28.iss"
#endif
#ifdef use_jet4sp8
#include "scripts\products\jet4sp8.iss"
#endif
#ifdef use_sqlcompact35sp2
#include "scripts\products\sqlcompact35sp2.iss"
#endif
#ifdef use_sql2005express
#include "scripts\products\sql2005express.iss"
#endif
#ifdef use_sql2008express
#include "scripts\products\sql2008express.iss"
#endif
[Code]
function InitializeSetup(): boolean;
begin
// initialize windows version
initwinversion();
#ifdef use_iis
if (not iis()) then exit;
#endif
#ifdef use_msi20
msi20('2.0'); // min allowed version is 2.0
#endif
#ifdef use_msi31
msi31('3.1'); // min allowed version is 3.1
#endif
#ifdef use_msi45
msi45('4.5'); // min allowed version is 4.5
#endif
#ifdef use_ie6
ie6('5.0.2919'); // min allowed version is 5.0.2919
#endif
#ifdef use_dotnetfx11
dotnetfx11();
#ifdef use_dotnetfx11lp
dotnetfx11lp();
#endif
dotnetfx11sp1();
#endif
// install .netfx 2.0 sp2 if possible; if not sp1 if possible; if not .netfx 2.0
#ifdef use_dotnetfx20
// check if .netfx 2.0 can be installed on this OS
if not minwinspversion(5, 0, 3) then begin
MsgBox(FmtMessage(CustomMessage('depinstall_missing'), [FmtMessage(CustomMessage('WindowsServicePack'), ['2000', '3'])]), mbError, MB_OK);
exit;
end;
if not minwinspversion(5, 1, 2) then begin
MsgBox(FmtMessage(CustomMessage('depinstall_missing'), [FmtMessage(CustomMessage('WindowsServicePack'), ['XP', '2'])]), mbError, MB_OK);
exit;
end;
if minwinversion(5, 1) then begin
dotnetfx20sp2();
#ifdef use_dotnetfx20lp
dotnetfx20sp2lp();
#endif
end else begin
if minwinversion(5, 0) and minwinspversion(5, 0, 4) then begin
#ifdef use_kb835732
kb835732();
#endif
dotnetfx20sp1();
#ifdef use_dotnetfx20lp
dotnetfx20sp1lp();
#endif
end else begin
dotnetfx20();
#ifdef use_dotnetfx20lp
dotnetfx20lp();
#endif
end;
end;
#endif
#ifdef use_dotnetfx35
//dotnetfx35();
dotnetfx35sp1();
#ifdef use_dotnetfx35lp
//dotnetfx35lp();
dotnetfx35sp1lp();
#endif
#endif
#ifdef use_wic
wic();
#endif
// if no .netfx 4.0 is found, install the client (smallest)
#ifdef use_dotnetfx40
if (not netfxinstalled(NetFx40Client, '') and not netfxinstalled(NetFx40Full, '')) then
dotnetfx40client();
#endif
#ifdef use_dotnetfx45
dotnetfx45(50); // min allowed version is 4.5.0
#endif
#ifdef use_dotnetfx46
dotnetfx46(50); // min allowed version is 4.5.0
#endif
#ifdef use_dotnetfx47
dotnetfx47(50); // min allowed version is 4.5.0
#endif
#ifdef use_vc2005
vcredist2005('6'); // min allowed version is 6.0
#endif
#ifdef use_vc2008
vcredist2008('9'); // min allowed version is 9.0
#endif
#ifdef use_vc2010
vcredist2010('10'); // min allowed version is 10.0
#endif
#ifdef use_vc2012
vcredist2012('11'); // min allowed version is 11.0
#endif
#ifdef use_vc2013
//SetForceX86(true); // force 32-bit install of next products
vcredist2013('12'); // min allowed version is 12.0
//SetForceX86(false); // disable forced 32-bit install again
#endif
#ifdef use_vc2015
vcredist2015('14'); // min allowed version is 14.0
#endif
#ifdef use_vc2017
vcredist2017('14'); // min allowed version is 14.0
#endif
#ifdef use_directxruntime
// extracts included setup file to temp folder so that we don't need to download it
// and always runs directxruntime installer as we don't know how to check if it is required
directxruntime();
#endif
#ifdef use_mdac28
mdac28('2.7'); // min allowed version is 2.7
#endif
#ifdef use_jet4sp8
jet4sp8('4.0.8015'); // min allowed version is 4.0.8015
#endif
#ifdef use_sqlcompact35sp2
sqlcompact35sp2();
#endif
#ifdef use_sql2005express
sql2005express();
#endif
#ifdef use_sql2008express
sql2008express();
#endif
Result := true;
end;

1
PowerEditor/Test/FunctionList/inno/unitTest.expected.result

@ -0,0 +1 @@
{"leaves":["Setup","Tasks","Files","Icons","Run","CustomMessages"],"root":"unitTest"}

78
PowerEditor/Test/FunctionList/java/unitTest

@ -0,0 +1,78 @@
//this file is part of Notepad++ plugin Pork2Sausage
//Copyright (C)2010 Don HO <donho@altern.org>
//
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either
//version 2 of the License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
import org.apache.commons.codec.binary.Base64;
import java.util.zip.*;
import java.util.*;
import java.text.*;
import java.io.*;
class zipB64 {
protected static String encodeMessage(String messageStr) {
try {
ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
Deflater deflater = new Deflater(Deflater.DEFLATED);
DeflaterOutputStream deflaterStream = new DeflaterOutputStream(bytesOut, deflater);
deflaterStream.write(messageStr.getBytes("UTF-8"));
deflaterStream.finish();
Base64 b = new Base64(-1);
return new String(b.encode(bytesOut.toByteArray()));
} catch (Exception e) {
return "crotte";
}
}
protected static String decodeMessage(String encodedMessage) {
try {
Base64 b = new Base64();
byte[] decodedBase64 = b.decode(encodedMessage.getBytes());
// Decompress the bytes
ByteArrayInputStream bytesIn = new ByteArrayInputStream(decodedBase64);
InflaterInputStream inflater = new InflaterInputStream(bytesIn);
int nbRead = 0;
StringBuilder sb = new StringBuilder();
while (nbRead >= 0) {
byte[] result = new byte[500];
nbRead = inflater.read(result,0,result.length);
if (nbRead > 0) {
sb.append(new String(result, 0, nbRead, "UTF-8"));
}
}
return sb.toString();
} catch (Exception e) {
return "zut";
}
}
public static void main (String args[]) {
if (args.length != 2 || (args[0].compareTo("-zip") != 0 && args[0].compareTo("-unzip") != 0))
{
System.out.println("java zipB64 <-zip|-unzip> \"message\"");
return;
}
boolean doZip = args[0].compareTo("-zip") == 0;
if (doZip)
System.out.println(encodeMessage(args[1]));
else
System.out.println(decodeMessage(args[1]));
}
}

1
PowerEditor/Test/FunctionList/java/unitTest.expected.result

@ -0,0 +1 @@
{"nodes":[{"leaves":["encodeMessage","decodeMessage"],"name":"zipB64"}],"root":"unitTest"}

364
PowerEditor/Test/FunctionList/javascript/unitTest

@ -0,0 +1,364 @@
var crypto = require('crypto'),
Friends,
User,
Post,
WallPost,
Comment,
LoginToken;
function extractKeywords(text) {
if (!text) return [];
return text.
split(/\s+/).
filter(function(v) { return v.length > 2; }).
filter(function(v, i, a) { return a.lastIndexOf(v) === i; });
}
function convertBasicMarkup(input, allowHtml) {
var strongRe = /[*]{2}([^*]+)[*]{2}/gm;
var emRe = /[*]{1}([^*]+)[*]{1}/gm;
var linkRe = /\[([^\]]*)\]\(([^\)]*?)\)/gm;
var nlRe = /\r\n/gm;
var crRe = /\r/gm;
// special re's to revert linebreaks from <br />
var codeRe = /(<code\b[^>]*>(.*?)<\/code>)/gm;
// cleanup newlines
input = input.replace(nlRe, "\n");
input = input.replace(crRe, "\n");
// strip existing html before inserting breaks/markup
if (!allowHtml) {
// strip html
input = input
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;');
}
// convert newlines to breaks
input = input.replace(/\n/gm, '<br />');
// replace basic markup
input = input.replace(strongRe, function(whole, m1, m2, m3) {
return '<strong>' + m1 + '</strong>';
});
input = input.replace(emRe, function(whole, m1, m2, m3) {
return '<em>' + m1 + '</em>';
});
input = input.replace(linkRe, function(whole, m1, m2) {
// fix up protocol
if (!m2.match(/(http(s?)|ftp(s?)):\/\//gm))
// prepend http as default
m2 = 'http://' + m2;
return '<a href=\"' + m2 + '\" target=\"_blank\">' + m1 + '</a>';
});
// revert code blocks
input = input.replace(codeRe, function(whole, m1) {
return m1.replace(/<br \/>/gm, '\n');
});
return input;
}
function defineModels(mongoose, fn) {
var Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
/**
* Comment model
*
* Used for persisting user comments
*/
var Comment = new Schema({
user_id: ObjectId,
//photo:String,
date: Date,
body: String,
post_id:ObjectId,
});
// register virtual members
Comment.virtual('readableday')
.get(function() {
var day = this.date.getDate();
return (day < 10 ? '0' + day : day);
});
Comment.virtual('readablemonth')
.get(function() {
return monthNamesShort[this.date.getMonth()];
});
Comment.virtual('readabletime')
.get(function() {
var hour = this.date.getHours();
var minute = this.date.getMinutes();
return (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute);
});
Comment.virtual('bodyParsed')
.get(function() {
return convertBasicMarkup(this.body, false);
});
// register validators
/*Comment.path('author').validate(function(val) {
return val.length > 0;
}, 'AUTHOR_MISSING');*/
Comment.path('body').validate(function(val) {
return val.length > 0;
}, 'BODY_MISSING');
/**
* Model: WallPost
*/
var WallPost = new Schema({
friend_id: String,
preview: String,
body: String,
//rsstext: String,
slug: String,
created: Date,
modified: Date,
//tags: [String],
user_id:ObjectId,
posted_on_user_id : ObjectId,
//comments: [Comment]
});
var monthNames = [ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli',
'August', 'September', 'Oktober', 'November', 'Dezember' ];
var monthNamesShort = [ 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul',
'Aug', 'Sep', 'Okt', 'Nov', 'Dez' ];
// define virtual getter method for id (readable string)
WallPost.virtual('id')
.get(function() {
return this._id.toHexString();
});
WallPost.virtual('url')
.get(function() {
// build url for current post
var year = this.created.getFullYear();
var month = this.created.getMonth() + 1;
var day = this.created.getDate();
return '/' + year + '/' + (month < 10 ? '0' + month : month) + '/' + (day < 10 ? '0' + day : day) + '/' + this.slug + '/';
});
WallPost.virtual('rfc822created')
.get(function() {
return this.created.toGMTString();
});
WallPost.virtual('readabledate')
.get(function() {
var year = this.created.getFullYear();
var month = monthNames[this.created.getMonth()];
var day = this.created.getDate();
return (day < 10 ? '0' + day : day) + '. ' + month + ' ' + year;
});
WallPost.virtual('readableday')
.get(function() {
var day = this.created.getDate();
return (day < 10 ? '0' + day : day);
});
WallPost.virtual('readablemonth')
.get(function() {
return monthNamesShort[this.created.getMonth()];
});
WallPost.virtual('previewParsed')
.get(function() {
return convertBasicMarkup(this.preview, true);
});
WallPost.virtual('bodyParsed')
.get(function() {
return convertBasicMarkup(this.body, true);
});
// register validators
/*WallPost.path('title').validate(function(val) {
return val.length > 0;
}, 'TITLE_MISSING');
WallPost.path('preview').validate(function(val) {
return val.length > 0;
}, 'PREVIEW_MISSING');
WallPost.path('rsstext').validate(function(val) {
return val.length > 0;
}, 'RSSTEXT_MISSING');*/
WallPost.path('body').validate(function(val) {
return val.length > 0;
}, 'BODY_MISSING');
// generate a proper slug value for Wallpost
function slugGenerator (options){
options = options || {};
var key = options.key || 'body';
return function slugGenerator(schema){
schema.path(key).set(function(v){
this.slug = v.toLowerCase().replace(/[^a-z0-9]/g, '-').replace(/\++/g, '');
return v;
});
};
};
// attach slugGenerator plugin to Wallpost schema
WallPost.plugin(slugGenerator());
/**
* Model: User
*/
function validatePresenceOf(value) {
return value && value.length;
}
var User = new Schema({
'first_name': { type: String, validate: /[a-z]/ },
'last_name':{ type: String, validate: /[a-z]/ },
'age':Number,
'sex':{ type: String},
'photo':String,
'location':{ type: String, validate: /[a-z]/ },
'latitude' : String,
'longitude' : String,
'keywords': [String],
'username':String,
'email': { type: String, validate: [validatePresenceOf, 'an email is required'], index: { unique: true }, required:true },
'hashed_password': { type: String},
'salt': String,
});
User.virtual('id')
.get(function() {
return this._id.toHexString();
});
User.virtual('password')
.set(function(password) {
this._password = password;
this.salt = this.makeSalt();
this.hashed_password = this.encryptPassword(password);
})
.get(function() { return this._password; });
User.method('authenticate', function(plainText) {
return this.encryptPassword(plainText) === this.hashed_password;
});
User.method('makeSalt', function() {
return Math.round((new Date().valueOf() * Math.random())) + '';
});
User.method('encryptPassword', function(password) {
return crypto.createHmac('sha1', this.salt).update(password).digest('hex');
});
User.pre('save', function(next) {
this.keywords = extractKeywords(this.first_name);
next();
if (!validatePresenceOf(this.password)) {
next(new Error('Invalid password'));
} else {
next();
}
});
var Friends = new Schema({
requestor : String
, acceptor : String
, date_requested : Date
, status:Number
});
Friends.virtual('id')
.get(function() {
return this._id.toHexString();
});
var Post = new Schema({
filename : { type: String, index: true }
, file : String
, created_at : Date
, user_id: ObjectId
});
Post.virtual('id')
.get(function() {
return this._id.toHexString();
});
/**
* Model: LoginToken
*
* Used for session persistence.
*/
var LoginToken = new Schema({
email: { type: String, index: true },
series: { type: String, index: true },
token: { type: String, index: true }
});
LoginToken.method('randomToken', function() {
return Math.round((new Date().valueOf() * Math.random())) + '';
});
LoginToken.pre('save', function(next) {
// Automatically create the tokens
this.token = this.randomToken();
if (this.isNew)
this.series = this.randomToken();
next();
});
LoginToken.virtual('id')
.get(function() {
return this._id.toHexString();
});
LoginToken.virtual('cookieValue')
.get(function() {
return JSON.stringify({ email: this.email, token: this.token, series: this.series });
});
mongoose.model('User', User);
mongoose.model('Post', Post);
mongoose.model('Friends', Friends);
mongoose.model('LoginToken', LoginToken);
mongoose.model('WallPost', WallPost);
mongoose.model('Comment', Comment);
fn();
}
exports.defineModels = defineModels;

1
PowerEditor/Test/FunctionList/javascript/unitTest.expected.result

@ -0,0 +1 @@
{"leaves":["extractKeywords","convertBasicMarkup","function","function","function","function","defineModels","slugGenerator","slugGenerator","validatePresenceOf","function","function","function","function","function","function"],"root":"unitTest"}

2014
PowerEditor/Test/FunctionList/nsis/unitTest

File diff suppressed because it is too large Load Diff

1
PowerEditor/Test/FunctionList/nsis/unitTest.expected.result

@ -0,0 +1 @@
{"leaves":["GetWindowsVersion","GetWindowsVersion OUTPUT_VALUE","LaunchNpp","ExtraOptions","OnChange_NoUserDataCheckBox","OnChange_PluginLoadFromUserDataCheckBox","OnChange_ShortcutCheckBox","OnChange_OldIconCheckBox",".onInit",".onInstSuccess","-\"Notepad++\" mainSection","\"Context Menu Entry\" explorerContextMenu","\"Auto-Updater\" AutoUpdater","-FinishSection","un.htmlViewer","un.AutoUpdater","un.explorerContextMenu","un.UnregisterFileExt","un.UserManual","Uninstall","un.onInit"],"nodes":[{"leaves":["\"C\" C","\"C++\" C++","\"Java\" Java","\"C","\"HTML\" HTML","\"RC\" RC","\"SQL\" SQL","\"PHP\" PHP","\"CSS\" CSS","\"VB\" VB","\"Perl\" Perl","\"JavaScript\" JavaScript","\"Python\" Python","\"ActionScript\" ActionScript","\"LISP\" LISP","\"VHDL\" VHDL","\"TeX\" TeX","\"DocBook\" DocBook","\"NSIS\" NSIS","\"CMAKE\" CMAKE"],"name":"Auto-completion Files"},{"leaves":["\"NppExport\" NppExport","\"Plugin Manager\" PluginManager","\"Mime Tools\" MimeTools","\"Converter\" Converter"],"name":"Plugins"},{"leaves":["\"Black Board\" BlackBoard","\"Choco\" Choco","\"Hello Kitty\" HelloKitty","\"Mono Industrial\" MonoIndustrial","\"Monokai\" Monokai","\"Obsidian\" Obsidian","\"Plastic Code Wrap\" PlasticCodeWrap","\"Ruby Blue\" RubyBlue","\"Twilight\" Twilight","\"Vibrant Ink\" VibrantInk","\"Deep Black\" DeepBlack","\"vim Dark Blue\" vimDarkBlue","\"Bespin\" Bespin","\"Zenburn\" Zenburn","\"Solarized\" Solarized","\"Solarized Light\" Solarized-light","\"Hot Fudge Sundae\" HotFudgeSundae","\"khaki\" khaki","\"Mossy Lawn\" MossyLawn","\"Navajo\" Navajo"],"name":"Themes"},{"leaves":["un.PHP","un.CSS","un.HTML","un.SQL","un.RC","un.VB","un.Perl","un.C","un.C++","un.Java","un.C","un.JavaScript","un.Python","un.ActionScript","un.LISP","un.VHDL","un.TeX","un.DocBook","un.NSIS","un.AWK","un.CMAKE"],"name":"un.autoCompletionComponent"},{"leaves":["un.NPPTextFX","un.NppAutoIndent","un.MIMETools","un.FTP_synchronize","un.NppFTP","un.NppExport","un.SelectNLaunch","un.DocMonitor","un.LightExplorer","un.HexEditor","un.ConvertExt","un.SpellChecker","un.DSpellCheck","un.NppExec","un.QuickText","un.ComparePlugin","un.Converter","un.MimeTools","un.PluginManager","un.ChangeMarkers"],"name":"un.Plugins"},{"leaves":["un.BlackBoard","un.Choco","un.HelloKitty","un.MonoIndustrial","un.Monokai","un.Obsidian","un.PlasticCodeWrap","un.RubyBlue","un.Twilight","un.VibrantInk","un.DeepBlack","un.vimDarkBlue","un.Bespin","un.Zenburn","un.Solarized","un.Solarized-light","un.HotFudgeSundae","un.khaki","un.MossyLawn","un.Navajo"],"name":"un.Themes"},{"leaves":["un.afrikaans","un.albanian","un.arabic","un.aragonese","un.aranese","un.azerbaijani","un.basque","un.belarusian","un.bengali","un.bosnian","un.brazilian_portuguese","un.bulgarian","un.catalan","un.chineseTraditional","un.chineseSimplified","un.croatian","un.czech","un.danish","un.dutch","un.english_customizable","un.esperanto","un.estonian","un.extremaduran","un.farsi","un.finnish","un.friulian","un.french","un.galician","un.georgian","un.german","un.greek","un.gujarati","un.hebrew","un.hungarian","un.hungarianA","un.indonesian","un.italian","un.japanese","un.kazakh","un.korean","un.kyrgyz","un.latvian","un.ligurian","un.lithuanian","un.luxembourgish","un.macedonian","un.malay","un.marathi","un.mongolian","un.norwegian","un.nynorsk","un.occitan","un.polish","un.kannada","un.portuguese","un.punjabi","un.romanian","un.russian","un.samogitian","un.sardinian","un.serbian","un.serbianCyrillic","un.sinhala","un.slovak","un.slovakA","un.slovenian","un.spanish","un.spanish_ar","un.swedish","un.tagalog","un.tajik","un.tamil","un.tatar","un.telugu","un.thai","un.turkish","un.ukrainian","un.urdu","un.uyghur","un.uzbek","un.uzbekCyrillic","un.vietnamese","un.welsh"],"name":"un.localization"}],"root":"unitTest"}

89
PowerEditor/Test/FunctionList/perl/unitTest

@ -0,0 +1,89 @@
<?php
/*
************************************************************************
Copyright [2014] [PagSeguro Internet Ltda.]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
************************************************************************
*/
require_once "../PagSeguroLibrary/PagSeguroLibrary.php";
class NotificationListener
{
public static function main()
{
$code = (isset($_POST['notificationCode']) && trim($_POST['notificationCode']) !== "" ?
trim($_POST['notificationCode']) : null);
$type = (isset($_POST['notificationType']) && trim($_POST['notificationType']) !== "" ?
trim($_POST['notificationType']) : null);
if ($code && $type) {
$notificationType = new PagSeguroNotificationType($type);
$strType = $notificationType->getTypeFromValue();
switch ($strType) {
case 'TRANSACTION':
self::transactionNotification($code);
break;
case 'APPLICATION_AUTHORIZATION':
self::authorizationNotification($code);
break;
case 'PRE_APPROVAL':
self::preApprovalNotification($code);
break;
default:
LogPagSeguro::error("Unknown notification type [" . $notificationType->getValue() . "]");
}
self::printLog($strType);
} else {
LogPagSeguro::error("Invalid notification parameters.");
self::printLog();
}
}
private static function transactionNotification($notificationCode)
{
$credentials = PagSeguroConfig::getAccountCredentials();
try {
$transaction = PagSeguroNotificationService::checkTransaction($credentials, $notificationCode);
// Do something with $transaction
} catch (PagSeguroServiceException $e) {
die($e->getMessage());
}
}
private static function authorizationNotification($notificationCode)
{
$credentials = PagSeguroConfig::getApplicationCredentials();
try {
$authorization = PagSeguroNotificationService::checkAuthorization($credentials, $notificationCode);
// Do something with $authorization
} catch (PagSeguroServiceException $e) {
die($e->getMessage());
}
}
private static function preApprovalNotification($preApprovalCode)
{
$credentials = PagSeguroConfig::getAccountCredentials();
try {
$preApproval = PagSeguroNotificationService::checkPreApproval($credentials, $preApprovalCode);
// Do something with $preApproval
} catch (PagSeguroServiceException $e) {
die($e->getMessage());
}
}
private static function printLog($strType = null)
{
$count = 4;
echo "<h2>Receive notifications</h2>";
if ($strType) {
echo "<h4>notifcationType: $strType</h4>";
}
echo "<p>Last <strong>$count</strong> items in <strong>log file:</strong></p><hr>";
echo LogPagSeguro::getHtml($count);
}
}
NotificationListener::main();

1
PowerEditor/Test/FunctionList/perl/unitTest.expected.result

@ -0,0 +1 @@
{"root":"unitTest"}

89
PowerEditor/Test/FunctionList/php/unitTest

@ -0,0 +1,89 @@
<?php
/*
************************************************************************
Copyright [2014] [PagSeguro Internet Ltda.]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
************************************************************************
*/
require_once "../PagSeguroLibrary/PagSeguroLibrary.php";
class NotificationListener
{
public static function main()
{
$code = (isset($_POST['notificationCode']) && trim($_POST['notificationCode']) !== "" ?
trim($_POST['notificationCode']) : null);
$type = (isset($_POST['notificationType']) && trim($_POST['notificationType']) !== "" ?
trim($_POST['notificationType']) : null);
if ($code && $type) {
$notificationType = new PagSeguroNotificationType($type);
$strType = $notificationType->getTypeFromValue();
switch ($strType) {
case 'TRANSACTION':
self::transactionNotification($code);
break;
case 'APPLICATION_AUTHORIZATION':
self::authorizationNotification($code);
break;
case 'PRE_APPROVAL':
self::preApprovalNotification($code);
break;
default:
LogPagSeguro::error("Unknown notification type [" . $notificationType->getValue() . "]");
}
self::printLog($strType);
} else {
LogPagSeguro::error("Invalid notification parameters.");
self::printLog();
}
}
private static function transactionNotification($notificationCode)
{
$credentials = PagSeguroConfig::getAccountCredentials();
try {
$transaction = PagSeguroNotificationService::checkTransaction($credentials, $notificationCode);
// Do something with $transaction
} catch (PagSeguroServiceException $e) {
die($e->getMessage());
}
}
private static function authorizationNotification($notificationCode)
{
$credentials = PagSeguroConfig::getApplicationCredentials();
try {
$authorization = PagSeguroNotificationService::checkAuthorization($credentials, $notificationCode);
// Do something with $authorization
} catch (PagSeguroServiceException $e) {
die($e->getMessage());
}
}
private static function preApprovalNotification($preApprovalCode)
{
$credentials = PagSeguroConfig::getAccountCredentials();
try {
$preApproval = PagSeguroNotificationService::checkPreApproval($credentials, $preApprovalCode);
// Do something with $preApproval
} catch (PagSeguroServiceException $e) {
die($e->getMessage());
}
}
private static function printLog($strType = null)
{
$count = 4;
echo "<h2>Receive notifications</h2>";
if ($strType) {
echo "<h4>notifcationType: $strType</h4>";
}
echo "<p>Last <strong>$count</strong> items in <strong>log file:</strong></p><hr>";
echo LogPagSeguro::getHtml($count);
}
}
NotificationListener::main();

1
PowerEditor/Test/FunctionList/php/unitTest.expected.result

@ -0,0 +1 @@
{"nodes":[{"leaves":["main","transactionNotification","authorizationNotification","preApprovalNotification","printLog"],"name":"NotificationListener"}],"root":"unitTest"}

321
PowerEditor/Test/FunctionList/powershell/unitTest

@ -0,0 +1,321 @@
#
# PowerConsole profile
#
<#
.SYNOPSIS
Clear the host content.
.DESCRIPTION
This function replaces the standard Clear-Host and is aliased by "cls".
#>
function Clear-Host
{
$host.PrivateData.ClearHost()
}
<#
.SYNOPSIS
Simple path completion function for PowerConsole.
#>
function _TabExpansionPath($line)
{
function UnquoteString($s) {
if ($s.StartsWith('"') -or $s.StartsWith("'")) {
$s = $s.Substring(1)
}
if ($s.EndsWith('"') -or $s.EndsWith("'")) {
$s = $s.Substring(0, $s.Length - 1)
}
return $s
}
$e = $null
$tokens = @([System.Management.Automation.PSParser]::Tokenize($line, [ref]$e))
$lastToken = $tokens | Select-Object -Last 1
$replaceStart = -1
$lastWord = $null
if ($lastToken -and ($lastToken.EndColumn -gt $line.Length)) {
#Last token is terminated
if ($tokens.Length -gt 1) {
$prevToken = $tokens[$tokens.Length - 2]
if ($prevToken.EndColumn -eq $lastToken.StartColumn) {
$replaceStart = $prevToken.StartColumn - 1
$lastWord = (UnquoteString $prevToken.Content) + (UnquoteString $lastToken.Content)
}
}
if ($replaceStart -lt 0) {
$replaceStart = $lastToken.StartColumn - 1
$lastWord = UnquoteString $lastToken.Content
}
} else {
#There is unrecognized/unterminated words
if(!$lastToken) {
$lastWord = $line
} else {
$lastWord = $line.Substring($lastToken.EndColumn - 1).TrimStart()
}
$replaceStart = $line.Length - $lastWord.Length
$lastWord = UnquoteString $lastWord
}
# If previously unquoted, put back quote in results
$unquoted = ($replaceStart -lt ($line.Length - $lastWord.Length))
$relative = !(($lastWord.IndexOf(':') -ge 0) -or $lastWord.StartsWith('/') -or $lastWord.StartsWith('\'))
$result = "" | select ReplaceStart, Paths
$result.ReplaceStart = $replaceStart
$result.Paths = @(Resolve-Path ${lastWord}* -ErrorAction SilentlyContinue -Relative:$relative | %{
# Resolve-Path may return PathInfo or String (e.g. when passing different -Relative)
$path = $_.ToString()
if ($unquoted -or ($path.IndexOf(' ') -ge 0)) {
"'$path'"
} else {
$path
}
})
$result
}
<#
.SYNOPSIS
Get an explict interface on an object so that you can invoke the interface members.
.DESCRIPTION
PowerShell object adapter does not provide explict interface members. For COM objects
it only makes IDispatch members available.
This function helps access interface members on an object through reflection. A new
object is returned with the interface members as ScriptProperties and ScriptMethods.
.EXAMPLE
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
#>
function Get-Interface
{
Param(
$Object,
[type]$InterfaceType
)
[NuGetConsole.Host.PowerShell.Implementation.PSTypeWrapper]::GetInterface($Object, $InterfaceType)
}
<#
.SYNOPSIS
Get a VS service.
.EXAMPLE
Get-VSService ([Microsoft.VisualStudio.Shell.Interop.SVsShell]) ([Microsoft.VisualStudio.Shell.Interop.IVsShell])
#>
function Get-VSService
{
Param(
[type]$ServiceType,
[type]$InterfaceType
)
$service = [Microsoft.VisualStudio.Shell.Package]::GetGlobalService($ServiceType)
if ($service -and $InterfaceType) {
$service = Get-Interface $service $InterfaceType
}
$service
}
<#
.SYNOPSIS
Get VS IComponentModel service to access VS MEF hosting.
#>
function Get-VSComponentModel
{
Get-VSService ([Microsoft.VisualStudio.ComponentModelHost.SComponentModel]) ([Microsoft.VisualStudio.ComponentModelHost.IComponentModel])
}
# Set initial directory
Set-Location "$env:USERPROFILE"
# For PowerShell v2, we need to create a reference to the default TabExpansion function
# so we can delegate back to it in our custom function. This isn't needed in PowerShell v3,
# as omitting output in a custom TabExpansion function signals to TabExpansion2 that it
# should use its own completion list.
if ((Test-Path Function:\DefaultTabExpansion) -eq $false -and (Test-Path Function:\TabExpansion)) {
Rename-Item Function:\TabExpansion DefaultTabExpansion
}
function TabExpansion([string]$line, [string]$lastWord) {
$nugetSuggestions = & (Get-Module NuGet) NuGetTabExpansion $line $lastWord
if ($nugetSuggestions.NoResult) {
# We only want to delegate back to the default tab completion in PowerShell v2.
# PowerShell v3's TabExpansion2 will use its own command completion list if the
# custom TabExpansion doesn't return anything.
if (Test-Path Function:\DefaultTabExpansion) {
$line = $line.ToUpperInvariant()
$lastWord = $lastWord.ToUpperInvariant()
return DefaultTabExpansion $line $lastWord
}
}
else {
return $nugetSuggestions
}
}
# default prompt
function prompt {
"PM>"
}
# SIG # Begin signature block
# MIIavQYJKoZIhvcNAQcCoIIarjCCGqoCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQS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sDyNt6dKHwuBHqrpeG5Q
# 2zMlAU1KT4ychtzPoIEyg7mDZBXFSebYD3FRGNr40QQP5ssZNp4aYkPc+OBbhZVN
# qECrNN6hggIoMIICJAYJKoZIhvcNAQkGMYICFTCCAhECAQEwgY4wdzELMAkGA1UE
# BhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAc
# BgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0
# IFRpbWUtU3RhbXAgUENBAhMzAAAAb2UtWG0HEUYoAAAAAABvMAkGBSsOAwIaBQCg
# XTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xNTA2
# MjQyMjUwNThaMCMGCSqGSIb3DQEJBDEWBBS3xuq3t+Yhu0yNOu+21zKtvYUE7DAN
# BgkqhkiG9w0BAQUFAASCAQCMFelTEi4zOXfdU6BBbGdP9O3MhBsgOrzG7cTJuZnG
# EYy9vvEafoyPg7hI07CXBRxkqOzo6YAYw3OiX7NuGYXb6wpfK38c6ub9UB2+MNay
# 6BbOyNIkFCqdGycIpyfWZgGNGjLVtZ/uAx0pCis6dSVFor+e+rVemjkeDyS4r9Jd
# XThMKXiuAljaQwWJGSRpwxHaBfa9bS4RV5PU0GvR6WGi+fEGZ9w8ujW2kW7/kH0e
# i2Gxzsgjd9yxw04IDt6swr2/iXw7TTU1RU1Wwb/BPlVMfW4oxvzJtDQUAVI2KsBL
# +dMO7jCcLk5rnY66+3WrxXsLmudCDm54BbOPn/mmZO1P
# SIG # End signature block

1
PowerEditor/Test/FunctionList/powershell/unitTest.expected.result

@ -0,0 +1 @@
{"leaves":["Clear-Host","_TabExpansionPath","UnquoteString","Get-Interface","Get-VSService","Get-VSComponentModel","TabExpansion","prompt"],"root":"unitTest"}

280
PowerEditor/Test/FunctionList/python/unitTest

@ -0,0 +1,280 @@
from __future__ import print_function
try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3
try:
xrange # Python 2
except NameError:
xrange = range # Python 3
# Accept No. of Nodes and edges
n, m = map(int, raw_input().split(" "))
# Initialising Dictionary of edges
g = {}
for i in xrange(n):
g[i + 1] = []
"""
--------------------------------------------------------------------------------
Accepting edges of Unweighted Directed Graphs
--------------------------------------------------------------------------------
"""
for _ in xrange(m):
x, y = map(int, raw_input().split(" "))
g[x].append(y)
"""
--------------------------------------------------------------------------------
Accepting edges of Unweighted Undirected Graphs
--------------------------------------------------------------------------------
"""
for _ in xrange(m):
x, y = map(int, raw_input().split(" "))
g[x].append(y)
g[y].append(x)
"""
--------------------------------------------------------------------------------
Accepting edges of Weighted Undirected Graphs
--------------------------------------------------------------------------------
"""
for _ in xrange(m):
x, y, r = map(int, raw_input().split(" "))
g[x].append([y, r])
g[y].append([x, r])
"""
--------------------------------------------------------------------------------
Depth First Search.
Args : G - Dictionary of edges
s - Starting Node
Vars : vis - Set of visited nodes
S - Traversal Stack
--------------------------------------------------------------------------------
"""
def dfs(G, s):
vis, S = set([s]), [s]
print(s)
while S:
flag = 0
for i in G[S[-1]]:
if i not in vis:
S.append(i)
vis.add(i)
flag = 1
print(i)
break
if not flag:
S.pop()
"""
--------------------------------------------------------------------------------
Breadth First Search.
Args : G - Dictionary of edges
s - Starting Node
Vars : vis - Set of visited nodes
Q - Traveral Stack
--------------------------------------------------------------------------------
"""
from collections import deque
def bfs(G, s):
vis, Q = set([s]), deque([s])
print(s)
while Q:
u = Q.popleft()
for v in G[u]:
if v not in vis:
vis.add(v)
Q.append(v)
print(v)
"""
--------------------------------------------------------------------------------
Dijkstra's shortest path Algorithm
Args : G - Dictionary of edges
s - Starting Node
Vars : dist - Dictionary storing shortest distance from s to every other node
known - Set of knows nodes
path - Preceding node in path
--------------------------------------------------------------------------------
"""
def dijk(G, s):
dist, known, path = {s: 0}, set(), {s: 0}
while True:
if len(known) == len(G) - 1:
break
mini = 100000
for i in dist:
if i not in known and dist[i] < mini:
mini = dist[i]
u = i
known.add(u)
for v in G[u]:
if v[0] not in known:
if dist[u] + v[1] < dist.get(v[0], 100000):
dist[v[0]] = dist[u] + v[1]
path[v[0]] = u
for i in dist:
if i != s:
print(dist[i])
"""
--------------------------------------------------------------------------------
Topological Sort
--------------------------------------------------------------------------------
"""
from collections import deque
def topo(G, ind=None, Q=[1]):
if ind == None:
ind = [0] * (len(G) + 1) # SInce oth Index is ignored
for u in G:
for v in G[u]:
ind[v] += 1
Q = deque()
for i in G:
if ind[i] == 0:
Q.append(i)
if len(Q) == 0:
return
v = Q.popleft()
print(v)
for w in G[v]:
ind[w] -= 1
if ind[w] == 0:
Q.append(w)
topo(G, ind, Q)
"""
--------------------------------------------------------------------------------
Reading an Adjacency matrix
--------------------------------------------------------------------------------
"""
def adjm():
n, a = input(), []
for i in xrange(n):
a.append(map(int, raw_input().split()))
return a, n
"""
--------------------------------------------------------------------------------
Floyd Warshall's algorithm
Args : G - Dictionary of edges
s - Starting Node
Vars : dist - Dictionary storing shortest distance from s to every other node
known - Set of knows nodes
path - Preceding node in path
--------------------------------------------------------------------------------
"""
def floy(A_and_n):
(A, n) = A_and_n
dist = list(A)
path = [[0] * n for i in xrange(n)]
for k in xrange(n):
for i in xrange(n):
for j in xrange(n):
if dist[i][j] > dist[i][k] + dist[k][j]:
dist[i][j] = dist[i][k] + dist[k][j]
path[i][k] = k
print(dist)
"""
--------------------------------------------------------------------------------
Prim's MST Algorithm
Args : G - Dictionary of edges
s - Starting Node
Vars : dist - Dictionary storing shortest distance from s to nearest node
known - Set of knows nodes
path - Preceding node in path
--------------------------------------------------------------------------------
"""
def prim(G, s):
dist, known, path = {s: 0}, set(), {s: 0}
while True:
if len(known) == len(G) - 1:
break
mini = 100000
for i in dist:
if i not in known and dist[i] < mini:
mini = dist[i]
u = i
known.add(u)
for v in G[u]:
if v[0] not in known:
if v[1] < dist.get(v[0], 100000):
dist[v[0]] = v[1]
path[v[0]] = u
"""
--------------------------------------------------------------------------------
Accepting Edge list
Vars : n - Number of nodes
m - Number of edges
Returns : l - Edge list
n - Number of Nodes
--------------------------------------------------------------------------------
"""
def edglist():
n, m = map(int, raw_input().split(" "))
l = []
for i in xrange(m):
l.append(map(int, raw_input().split(' ')))
return l, n
"""
--------------------------------------------------------------------------------
Kruskal's MST Algorithm
Args : E - Edge list
n - Number of Nodes
Vars : s - Set of all nodes as unique disjoint sets (initially)
--------------------------------------------------------------------------------
"""
def krusk(E_and_n):
# Sort edges on the basis of distance
(E, n) = E_and_n
E.sort(reverse=True, key=lambda x: x[2])
s = [set([i]) for i in range(1, n + 1)]
while True:
if len(s) == 1:
break
print(s)
x = E.pop()
for i in xrange(len(s)):
if x[0] in s[i]:
break
for j in xrange(len(s)):
if x[1] in s[j]:
if i == j:
break
s[j].update(s[i])
s.pop(i)
break

1
PowerEditor/Test/FunctionList/python/unitTest.expected.result

@ -0,0 +1 @@
{"leaves":["dfs(G, s)","bfs(G, s)","dijk(G, s)","topo(G, ind=None, Q=[1])","adjm()","floy(A_and_n)","prim(G, s)","edglist()","krusk(E_and_n)"],"root":"unitTest"}

124
PowerEditor/Test/FunctionList/ruby/unitTest

@ -0,0 +1,124 @@
#!/usr/local/bin/ruby
#
# biorhythm.rb -
# $Release Version: $
# $Revision$
# by Yasuo OHBA(STAFS Development Room)
#
# --
#
#
#
# probably based on:
#
# Newsgroups: comp.sources.misc,de.comp.sources.os9
# From: fkk@stasys.sta.sub.org (Frank Kaefer)
# Subject: v41i126: br - Biorhythm v3.0, Part01/01
# Message-ID: <1994Feb1.070616.15982@sparky.sterling.com>
# Sender: kent@sparky.sterling.com (Kent Landfield)
# Organization: Sterling Software
# Date: Tue, 1 Feb 1994 07:06:16 GMT
#
# Posting-number: Volume 41, Issue 126
# Archive-name: br/part01
# Environment: basic, dos, os9
include Math
require "date.rb"
require "optparse"
require "optparse/date"
def print_header(y, m, d, p, w)
print "\n>>> Biorhythm <<<\n"
printf "The birthday %04d.%02d.%02d is a %s\n", y, m, d, w
printf "Age in days: [%d]\n\n", p
end
def get_position(z)
pi = Math::PI
z = Integer(z)
phys = (50.0 * (1.0 + sin((z / 23.0 - (z / 23)) * 360.0 * pi / 180.0))).to_i
emot = (50.0 * (1.0 + sin((z / 28.0 - (z / 28)) * 360.0 * pi / 180.0))).to_i
geist =(50.0 * (1.0 + sin((z / 33.0 - (z / 33)) * 360.0 * pi / 180.0))).to_i
return phys, emot, geist
end
def prompt(msg)
$stderr.print msg
return gets.chomp
end
#
# main program
#
options = {
:graph => true,
:date => Date.today,
:days => 9,
}
ARGV.options do |opts|
opts.on("-b", "--birthday=DATE", Date, "specify your birthday"){|v|
options[:birthday] = v
}
opts.on("--date=DATE", Date, "specify date to show"){|v|
options[:date] = v
}
opts.on("-g", "--show-graph", TrueClass, "show graph (default)"){|v|
options[:graph] = v
}
opts.on("-v", "--show-values", TrueClass, "show values"){|v|
options[:graph] = !v
}
opts.on("--days=DAYS", Integer, "graph range (only in effect for graph)"){|v|
options[:days] = v - 1
}
opts.on_tail("-h", "--help", "show this message"){puts opts; exit}
begin
opts.parse!
rescue => ex
puts "Error: #{ex.message}"
puts opts
exit
end
end
bd = options[:birthday] || Date.parse(prompt("Your birthday (YYYYMMDD): "))
dd = options[:date] || Date.today
ausgabeart = options[:graph] ? "g" : "v"
display_period = options[:days]
if ausgabeart == "v"
print_header(bd.year, bd.month, bd.day, dd - bd, bd.strftime("%a"))
print "\n"
phys, emot, geist = get_position(dd - bd)
printf "Biorhythm: %04d.%02d.%02d\n", dd.year, dd.month, dd.day
printf "Physical: %d%%\n", phys
printf "Emotional: %d%%\n", emot
printf "Mental: %d%%\n", geist
print "\n"
else
print_header(bd.year, bd.month, bd.day, dd - bd, bd.strftime("%a"))
print " P=physical, E=emotional, M=mental\n"
print " -------------------------+-------------------------\n"
print " Bad Condition | Good Condition\n"
print " -------------------------+-------------------------\n"
(dd - bd).step(dd - bd + display_period) do |z|
phys, emot, geist = get_position(z)
printf "%04d.%02d.%02d : ", dd.year, dd.month, dd.day
p = (phys / 2.0 + 0.5).to_i
e = (emot / 2.0 + 0.5).to_i
g = (geist / 2.0 + 0.5).to_i
graph = "." * 51
graph[25] = ?|
graph[p] = ?P
graph[e] = ?E
graph[g] = ?M
print graph, "\n"
dd = dd + 1
end
print " -------------------------+-------------------------\n\n"
end

1
PowerEditor/Test/FunctionList/ruby/unitTest.expected.result

@ -0,0 +1 @@
{"leaves":["print_header","get_position","prompt"],"root":"unitTest"}

46
PowerEditor/Test/FunctionList/unitTestLauncher.ps1

@ -0,0 +1,46 @@
..\..\bin\notepad++.exe -export=functionList -lasm .\asm\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -lautoit .\autoit\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -lbash .\bash\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -lbatch .\batch\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -lc .\c\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -lcpp .\cpp\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -lcs .\cs\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -lini .\ini\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -linno .\inno\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -ljava .\java\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -ljavascript .\javascript\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -lnsis .\nsis\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -lperl .\perl\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -lphp .\php\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -lpowershell .\powershell\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -lpython .\python\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -lruby .\ruby\unitTest | Out-Null
..\..\bin\notepad++.exe -export=functionList -lxml .\xml\unitTest | Out-Null
$testRoot = ".\"
Get-ChildItem $testRoot -Filter *.* |
Foreach-Object {
if ((Get-Item $testRoot$_) -is [System.IO.DirectoryInfo])
{
$expectedRes = Get-Content $testRoot$_\unitTest.expected.result
$generatedRes = Get-Content $testRoot$_\unitTest.result.json
if ($generatedRes -eq $expectedRes)
{
Remove-Item $testRoot$_\unitTest.result.json
""
"OK"
}
else
{
"$generatedRes"
exit -1
}
}
}
exit 0

58
PowerEditor/Test/FunctionList/xml/unitTest

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="Windows-1252" ?>
<NotepadPlus>
<GUIConfigs>
<GUIConfig name="ToolBar" visible="yes">standard</GUIConfig>
<GUIConfig name="StatusBar">show</GUIConfig>
<GUIConfig name="TabBar" dragAndDrop="yes" drawTopBar="yes" drawInactiveTab="yes" reduce="yes" closeButton="yes" doubleClick2Close="no" vertical="no" multiLine="no" hide="no" quitOnEmpty="no" />
<GUIConfig name="ScintillaViewsSplitter">vertical</GUIConfig>
<GUIConfig name="UserDefineDlg" position="undocked">hide</GUIConfig>
<GUIConfig name="TabSetting" replaceBySpace="no" size="4" />
<GUIConfig name="AppPosition" x="0" y="0" width="1100" height="700" isMaximized="no" />
<GUIConfig name="noUpdate" intervalDays="15" nextUpdateDate="20180427">no</GUIConfig>
<GUIConfig name="Auto-detection">yes</GUIConfig>
<GUIConfig name="CheckHistoryFiles">no</GUIConfig>
<GUIConfig name="TrayIcon">no</GUIConfig>
<GUIConfig name="MaitainIndent">yes</GUIConfig>
<GUIConfig name="TagsMatchHighLight" TagAttrHighLight="yes" HighLightNonHtmlZone="no">yes</GUIConfig>
<GUIConfig name="RememberLastSession">yes</GUIConfig>
<GUIConfig name="DetectEncoding">yes</GUIConfig>
<GUIConfig name="NewDocDefaultSettings" format="0" encoding="4" lang="0" codepage="-1" openAnsiAsUTF8="yes" />
<GUIConfig name="langsExcluded" gr0="0" gr1="0" gr2="0" gr3="0" gr4="0" gr5="0" gr6="0" gr7="0" gr8="0" gr9="0" gr10="0" gr11="0" gr12="0" langMenuCompact="yes" />
<GUIConfig name="Print" lineNumber="yes" printOption="3" headerLeft="" headerMiddle="" headerRight="" footerLeft="" footerMiddle="" footerRight="" headerFontName="" headerFontStyle="0" headerFontSize="0" footerFontName="" footerFontStyle="0" footerFontSize="0" margeLeft="0" margeRight="0" margeTop="0" margeBottom="0" />
<GUIConfig name="Backup" action="0" useCustumDir="no" dir="" isSnapshotMode="yes" snapshotBackupTiming="7000" />
<GUIConfig name="TaskList">yes</GUIConfig>
<GUIConfig name="MRU">yes</GUIConfig>
<GUIConfig name="URL">2</GUIConfig>
<GUIConfig name="globalOverride" fg="no" bg="no" font="no" fontSize="no" bold="no" italic="no" underline="no" />
<GUIConfig name="auto-completion" autoCAction="3" triggerFromNbChar="1" autoCIgnoreNumbers="yes" funcParams="yes" />
<GUIConfig name="auto-insert" parentheses="no" brackets="no" curlyBrackets="no" quotes="no" doubleQuotes="no" htmlXmlTag="no" />
<GUIConfig name="sessionExt"></GUIConfig>
<GUIConfig name="workspaceExt"></GUIConfig>
<GUIConfig name="MenuBar">show</GUIConfig>
<GUIConfig name="Caret" width="1" blinkRate="600" />
<GUIConfig name="ScintillaGlobalSettings" enableMultiSelection="no" />
<GUIConfig name="openSaveDir" value="0" defaultDirPath="" />
<GUIConfig name="titleBar" short="no" />
<GUIConfig name="stylerTheme" path="C:\sources\notepad-plus-plus\PowerEditor\bin\stylers.xml" />
<GUIConfig name="wordCharList" useDefault="yes" charsAdded="" />
<GUIConfig name="delimiterSelection" leftmostDelimiter="40" rightmostDelimiter="41" delimiterSelectionOnEntireDocument="no" />
<GUIConfig name="multiInst" setting="0" />
<GUIConfig name="MISC" fileSwitcherWithoutExtColumn="no" backSlashIsEscapeCharacterForSql="yes" newStyleSaveDlg="no" isFolderDroppedOpenFiles="no" docPeekOnTab="no" docPeekOnMap="no" />
<GUIConfig name="searchEngine" searchEngineChoice="2" searchEngineCustom="" />
<GUIConfig name="SmartHighLight" matchCase="no" wholeWordOnly="yes" useFindSettings="no" onAnotherView="no">yes</GUIConfig>
<GUIConfig name="ScintillaPrimaryView" lineNumberMargin="show" bookMarkMargin="show" indentGuideLine="show" folderMarkStyle="box" lineWrapMethod="aligned" currentLineHilitingShow="show" scrollBeyondLastLine="no" disableAdvancedScrolling="no" wrapSymbolShow="hide" Wrap="no" borderEdge="yes" edge="no" edgeNbColumn="80" zoom="0" zoom2="0" whiteSpaceShow="hide" eolShow="hide" borderWidth="2" smoothFont="no" />
<GUIConfig name="DockingManager" leftWidth="200" rightWidth="200" topHeight="200" bottomHeight="200">
<ActiveTabs cont="0" activeTab="-1" />
<ActiveTabs cont="1" activeTab="-1" />
<ActiveTabs cont="2" activeTab="-1" />
<ActiveTabs cont="3" activeTab="-1" />
</GUIConfig>
</GUIConfigs>
<FindHistory nbMaxFindHistoryPath="10" nbMaxFindHistoryFilter="10" nbMaxFindHistoryFind="10" nbMaxFindHistoryReplace="10" matchWord="no" matchCase="no" wrap="yes" directionDown="yes" fifRecuisive="yes" fifInHiddenFolder="no" dlgAlwaysVisible="no" fifFilterFollowsDoc="no" fifFolderFollowsDoc="no" searchMode="0" transparencyMode="1" transparency="150" dotMatchesNewline="no" isSearch2ButtonsMode="no" />
<History nbMaxFile="10" inSubMenu="no" customLength="-1" />
<ProjectPanels>
<ProjectPanel id="0" workSpaceFile="" />
<ProjectPanel id="1" workSpaceFile="" />
<ProjectPanel id="2" workSpaceFile="" />
</ProjectPanels>
</NotepadPlus>

1
PowerEditor/Test/FunctionList/xml/unitTest.expected.result

@ -0,0 +1 @@
{"leaves":["GUIConfig name=\"ToolBar\" visible=\"yes\"","GUIConfig name=\"StatusBar\"","GUIConfig name=\"TabBar\" dragAndDrop=\"yes\" drawTopBar=\"yes\" drawInactiveTab=\"yes\" reduce=\"yes\" closeButton=\"yes\" doubleClick2Close=\"no\" vertical=\"no\" multiLine=\"no\" hide=\"no\" quitOnEmpty=\"no\"","GUIConfig name=\"ScintillaViewsSplitter\"","GUIConfig name=\"UserDefineDlg\" position=\"undocked\"","GUIConfig name=\"TabSetting\" replaceBySpace=\"no\" size=\"4\"","GUIConfig name=\"AppPosition\" x=\"0\" y=\"0\" width=\"1100\" height=\"700\" isMaximized=\"no\"","GUIConfig name=\"noUpdate\" intervalDays=\"15\" nextUpdateDate=\"20180427\"","GUIConfig name=\"Auto-detection\"","GUIConfig name=\"CheckHistoryFiles\"","GUIConfig name=\"TrayIcon\"","GUIConfig name=\"MaitainIndent\"","GUIConfig name=\"TagsMatchHighLight\" TagAttrHighLight=\"yes\" HighLightNonHtmlZone=\"no\"","GUIConfig name=\"RememberLastSession\"","GUIConfig name=\"DetectEncoding\"","GUIConfig name=\"NewDocDefaultSettings\" format=\"0\" encoding=\"4\" lang=\"0\" codepage=\"-1\" openAnsiAsUTF8=\"yes\"","GUIConfig name=\"langsExcluded\" gr0=\"0\" gr1=\"0\" gr2=\"0\" gr3=\"0\" gr4=\"0\" gr5=\"0\" gr6=\"0\" gr7=\"0\" gr8=\"0\" gr9=\"0\" gr10=\"0\" gr11=\"0\" gr12=\"0\" langMenuCompact=\"yes\"","GUIConfig name=\"Print\" lineNumber=\"yes\" printOption=\"3\" headerLeft=\"\" headerMiddle=\"\" headerRight=\"\" footerLeft=\"\" footerMiddle=\"\" footerRight=\"\" headerFontName=\"\" headerFontStyle=\"0\" headerFontSize=\"0\" footerFontName=\"\" footerFontStyle=\"0\" footerFontSize=\"0\" margeLeft=\"0\" margeRight=\"0\" margeTop=\"0\" margeBottom=\"0\"","GUIConfig name=\"Backup\" action=\"0\" useCustumDir=\"no\" dir=\"\" isSnapshotMode=\"yes\" snapshotBackupTiming=\"7000\"","GUIConfig name=\"TaskList\"","GUIConfig name=\"MRU\"","GUIConfig name=\"URL\"","GUIConfig name=\"globalOverride\" fg=\"no\" bg=\"no\" font=\"no\" fontSize=\"no\" bold=\"no\" italic=\"no\" underline=\"no\"","GUIConfig name=\"auto-completion\" autoCAction=\"3\" triggerFromNbChar=\"1\" autoCIgnoreNumbers=\"yes\" funcParams=\"yes\"","GUIConfig name=\"auto-insert\" parentheses=\"no\" brackets=\"no\" curlyBrackets=\"no\" quotes=\"no\" doubleQuotes=\"no\" htmlXmlTag=\"no\"","GUIConfig name=\"sessionExt\"","GUIConfig name=\"workspaceExt\"","GUIConfig name=\"MenuBar\"","GUIConfig name=\"Caret\" width=\"1\" blinkRate=\"600\"","GUIConfig name=\"ScintillaGlobalSettings\" enableMultiSelection=\"no\"","GUIConfig name=\"openSaveDir\" value=\"0\" defaultDirPath=\"\"","GUIConfig name=\"titleBar\" short=\"no\"","GUIConfig name=\"stylerTheme\" path=\"C:\\sources\\notepad-plus-plus\\PowerEditor\\bin\\stylers.xml\"","GUIConfig name=\"wordCharList\" useDefault=\"yes\" charsAdded=\"\"","GUIConfig name=\"delimiterSelection\" leftmostDelimiter=\"40\" rightmostDelimiter=\"41\" delimiterSelectionOnEntireDocument=\"no\"","GUIConfig name=\"multiInst\" setting=\"0\"","GUIConfig name=\"MISC\" fileSwitcherWithoutExtColumn=\"no\" backSlashIsEscapeCharacterForSql=\"yes\" newStyleSaveDlg=\"no\" isFolderDroppedOpenFiles=\"no\" docPeekOnTab=\"no\" docPeekOnMap=\"no\"","GUIConfig name=\"searchEngine\" searchEngineChoice=\"2\" searchEngineCustom=\"\"","GUIConfig name=\"SmartHighLight\" matchCase=\"no\" wholeWordOnly=\"yes\" useFindSettings=\"no\" onAnotherView=\"no\"","GUIConfig name=\"ScintillaPrimaryView\" lineNumberMargin=\"show\" bookMarkMargin=\"show\" indentGuideLine=\"show\" folderMarkStyle=\"box\" lineWrapMethod=\"aligned\" currentLineHilitingShow=\"show\" scrollBeyondLastLine=\"no\" disableAdvancedScrolling=\"no\" wrapSymbolShow=\"hide\" Wrap=\"no\" borderEdge=\"yes\" edge=\"no\" edgeNbColumn=\"80\" zoom=\"0\" zoom2=\"0\" whiteSpaceShow=\"hide\" eolShow=\"hide\" borderWidth=\"2\" smoothFont=\"no\"","GUIConfig name=\"DockingManager\" leftWidth=\"200\" rightWidth=\"200\" topHeight=\"200\" bottomHeight=\"200\"","ActiveTabs cont=\"0\" activeTab=\"-1\"","ActiveTabs cont=\"1\" activeTab=\"-1\"","ActiveTabs cont=\"2\" activeTab=\"-1\"","ActiveTabs cont=\"3\" activeTab=\"-1\"","FindHistory nbMaxFindHistoryPath=\"10\" nbMaxFindHistoryFilter=\"10\" nbMaxFindHistoryFind=\"10\" nbMaxFindHistoryReplace=\"10\" matchWord=\"no\" matchCase=\"no\" wrap=\"yes\" directionDown=\"yes\" fifRecuisive=\"yes\" fifInHiddenFolder=\"no\" dlgAlwaysVisible=\"no\" fifFilterFollowsDoc=\"no\" fifFolderFollowsDoc=\"no\" searchMode=\"0\" transparencyMode=\"1\" transparency=\"150\" dotMatchesNewline=\"no\" isSearch2ButtonsMode=\"no\"","History nbMaxFile=\"10\" inSubMenu=\"no\" customLength=\"-1\"","ProjectPanel id=\"0\" workSpaceFile=\"\"","ProjectPanel id=\"1\" workSpaceFile=\"\"","ProjectPanel id=\"2\" workSpaceFile=\"\""],"root":"unitTest"}

90
PowerEditor/src/functionList.xml

@ -76,7 +76,6 @@
<association id= "csharp_class" langID= "4" />
<association id= "java_syntax" langID= "6" />
<association id= "xml_node" langID= "9" />
<!-- <association id="functionlist_syntax" langID= "9" /> -->
<association id= "batch_label" langID="12" />
<association id= "ini_section" langID="13" />
<association id= "perl_function" langID="21" />
@ -89,6 +88,7 @@
<association id= "innosetup_syntax" langID="46" />
<association id= "powershell_function" langID="53" />
<association id= "javascript_function" langID="58" />
<!-- ======================================================================== -->
<association id= "baanc_section" langID="60" />
<!-- ======================================================================== -->
<association id= "krl_function" userDefinedLangName="KRL" />
@ -572,93 +572,7 @@
</functionName>
</function>
</parser>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Show each FunctionList `association`-node as a leaf in an
| `assiociationMap` branch and each `parser`-node as a leaf in a
| `parsers` branch of the FunctionList tree
\-->
<parser
displayName="XML of Function List"
id ="functionlist_syntax"
commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
(?:\x3C!--(?:[^\-]|-(?!-\x3E))*--\x3E) # Multi Line Comment
"
>
<classRange
mainExpr ="(?xs) # can span multiple lines
\x3C(?'COMPOUND'associationMap|parsers)\x3E # begin of a `associationMap` or `parsers`-node
.*? # include anything between the node`s tags
\x3C/\k'COMPOUND'\x3E # end of the applicable node
"
>
<!--
| Use the node's name as label for the branch
\-->
<className>
<nameExpr expr="\x3C\w+\x3E" />
<nameExpr expr="\w+" />
</className>
<function
mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
\x3C(?:association|parser) # begin of a `association` or `parser`-node
(?: # match attributes
\s+\w+ # at least one whitespace before attribute-name
\h*=\h* # name-value separator can be surrounded by blanks
(?: # quoted attribute value, embedded escaped quotes allowed...
\x22(?:[^\x22\x5C]|\x5C.)*?\x22 # ...double quoted...
| \x27(?:[^\x27\x5C]|\x5C.)*?\x27 # ...single quoted
)
)+ # only match nodes with at least one attribute
\s*/?\x3E # end of the node or node-tag resp.
"
>
<!--
| For `association`-nodes use its `id`-attribute value as its leaf
| name and for `parser`-nodes use its `displayName`-attribute value.
| NOTE: to be able to use the node's `displayName`-attribute,
| make sure it's defined before the `id`-attribute.
\-->
<functionName>
<funcNameExpr expr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
(?:displayName|\bid)
\h*=\h*
(?:
\x22(?:[^\x22\x5C]|\x5C.)*?\x22
| \x27(?:[^\x27\x5C]|\x5C.)*?\x27
)
"
/>
<funcNameExpr expr="(?&lt;=[\x22\x27])(?:[^\x22\x27\x5C]|\x5C.)*?(?=[\x22\x27])" />
</functionName>
</function>
</classRange>
<!--
| Fallback: show each `parser`-node as a leaf of the root in the FunctionList tree
\-->
<function
mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
\x3Cparser # begin of a `parser`-node
(?: # match attributes
\s+\w+ # at least one whitespace before attribute-name
\h*=\h* # name-value separator can be surrounded by blanks
(?: # quoted attribute value, embedded escaped quotes allowed..
\x22(?:[^\x22\x5C]|\x5C.)*?\x22 # ...double quoted...
| \x27(?:[^\x27\x5C]|\x5C.)*?\x27 # ...single quoted
)
)+ # only match nodes with at least one attribute
\s*/?\x3E # end of the `parser`-node-tag
"
>
<!--
| Use the `displayName`-attribute value as leaf name.
\-->
<functionName>
<nameExpr expr="displayName\h*=\h*(?:\x22(?:[^\x22\x5C]|\x5C.)*?\x22|\x27(?:[^\x27\x5C]|\x5C.)*?\x27)" />
<nameExpr expr="(?&lt;=[\x22\x27])(?:[^\x22\x27\x5C]|\x5C.)*?(?=[\x22\x27])" />
</functionName>
</function>
</parser>
<!-- ================================ [ Batch / Command Shell Script ] -->
<parser

Loading…
Cancel
Save