FunctionList with file Informix-4gl
-
Hello, first excuse me for my bad english.
I used the normally FunctionList plugin with Informix-4gl language, but after reinstalling Notepad++ is no longer working , does not have the list ( shows "No Rule Defined " ) .
Before I used the settings in FunctionListRules.xml file, but now it seems that no longer works this way …
The basic structure of an Informix-4gl file has functions as follows:
#--------------------------------------#
FUNCTION <function name>(<parameters>)
#--------------------------------------#
function body
END FUNCTIONIn the %APPDATA%\Notepad++\functionList.xml:
<association ext=“.4gl” userDefinedLangName=“Informix-4GL” id=“4gl_function”/>
And I have the following parser , which I copied from somewhere else :
<parser id=“4gl_function” displayName=“Informix-4GL” commentExpr=“(!.?$)“>
<function
mainExpr=”^\sfunction\s*[\w_]+\s*(.)^\send\sfunction\s[\w_]+”
displayMode=“$functionName$”>
<functionName>
<nameExpr expr=“[\w_]+”/>
</functionName>
</function>
</parser>What is wrong?
-
Hello @Anderson-Quandt-Venancio,
the file in question is the functionlist.xml which is either in the installation directory of npp or in the
%APPDATA%\notepad++ directory.From the given example I assume that # is the char for comments but
your commentExpr used the exclamation mark! ???The mainExpr is looking for
- one whitespace char
- followed by the word function
- followed by whitepsace char (no or unlimited times) ???
- followed by a group of either word chars or underscore char (one or unlimited times)
- followed by whitepsace char (no or unlimited times) ???
- followed by any single char ???
- followed by ^ = reset to start of line … ???
Did this ever work ?? I’m in douubt.
From my point of view it must look more like<parser id="4gl_function" displayName="Informix-4GL" commentExpr="(#.?$)"> <function mainExpr="^\s*function\s+\K[\w_]+(?=\s*\()" displayMode="$functionName$"> <functionName> <nameExpr expr=".+"/> </functionName> </function> </parser>
And all of this only works if you have a UDL named Informix-4GL.
Cheers
Claudia -
This post is deleted! -
Thanks for answering.
Excuse me, I do not have much practice with REGEX .
On the first question, yes, # is the character to comment.
And I also have the “Informix-4GL” as a UDL.
I tested your suggestion, placing it in the file “functionlist.xml” in the %APPDATA%/Notepad++ directory, but it did not work even using this simple code :
FUNCTION test(cTest) DEFINE cTest VARCHAR(10) LET cTest = 'Hello!' DISPLAY cTest AT 3,1 END FUNCTION
Continues to present "No Rule Defined "…
-
Hell @Anderson-Quandt-Venancio,
I tested it, it is working see here.
So question is, what did you do?
What makes me confuse is the message that you get “No rules defined”
I don’t get such message, which npp version do you use.
In addition, can you post your functionList.xml and userDefineLang.xml?Cheers
Claudia -
Hello Claudia,
" No rules defined" is what appears in the header of FunctionList box.
This is my functionlist.xml:
<?xml version="1.0" encoding="UTF-8" ?> <NotepadPlus> <functionList> <associationMap> <!-- langID: L_TEXT: 0 L_PHP: 1 L_C: 2 L_CPP: 3 L_CS: 4 L_OBJC: 5 L_JAVA: 6 L_RC: 7 L_HTML: 8 L_XML: 9 L_MAKEFILE: 10 L_PASCAL: 11 L_BATCH:12 L_INI: 13 L_ASCII: 14 L_USER: 15 L_ASP: 16 L_SQL: 17 L_VB: 18 L_JS: 19 L_CSS: 20 L_PERL: 21 L_PYTHON: 22 L_LUA: 23 L_TEX: 24 L_FORTRAN: 25 L_BASH: 26 L_FLASH: 27 L_NSIS: 28 L_TCL: 29 L_LISP: 30 L_SCHEME: 31 L_ASM: 32 L_DIFF: 33 L_PROPS: 34 L_PS: 35 L_RUBY: 36 L_SMALLTALK:37 L_VHDL: 38 L_KIX: 39 L_AU3: 40 L_CAML: 41 L_ADA: 42 L_VERILOG: 43 L_MATLAB: 44 L_HASKELL: 45 L_INNO: 46 L_SEARCHRESULT: 47 L_CMAKE: 48 L_YAML: 49 L_COBOL 50 L_GUI4CLI: 51 L_D: 52 L_POWERSHELL: 53 L_R: 54 L_JSP: 55 --> <association ext=".4gl" userDefinedLangName="Informix-4GL" id="4gl_function"/> <!-- if langID cannot be found above, you can still set the file extensions <association ext="my_passer_ext1" id="my_passer_id"/> <association ext="my_passer_ext2" id="my_passer_id"/> --> </associationMap> <parsers> <parser id="4gl_function" displayName="Informix-4GL" commentExpr="(#.?$)"> <function mainExpr="^\s*function\s+\K[\w_]+(?=\s*\()" displayMode="$functionName$"> <functionName> <nameExpr expr=".+"/> </functionName> </function> </parser> </parsers> </functionList> </NotepadPlus>
And this is my userDefineLang.xml:
<NotepadPlus> <UserLang name="Informix-4GL" ext="4gl per sql apl" udlVersion="2.1"> <Settings> <Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="2" /> <Prefix Keywords1="no" Keywords2="no" Keywords3="yes" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" /> </Settings> <KeywordLists> <Keywords name="Comments">03{ 04} 00# 01 02</Keywords> <Keywords name="Operators1">- ! $ % & ( ) , . : [ ] ^ + < = ></Keywords> <Keywords name="Folders in code1, open">"AFTER" "BEFORE" "CASE" "GLOBALS" "IF" "INPUT" "MAIN" "MENU" "WHILE"</Keywords> <Keywords name="Folders in code1, middle">"ELSE" "WHEN"</Keywords> <Keywords name="Folders in code1, close">"END GLOBALS" "END IF" "END WHILE" "END INPUT"</Keywords> <Keywords name="Keywords1">arg_val errorlog fgl_keyval fgl_lastkey get_fldbuf int_flag num_args startlog AFTER ALL AND ANY ARR_COUNT ARR_CURR ARRAY AS ASC ASCII ASCENDING AT ATTRIBUTE ATTRIBUTES AUTONEXT AVG BEFORE BEGIN BETWEEN BORDER BOTTOM BY CALL CASE CAST CHAR CLEAR CLIPPED CLOSE COLUMN COLUMNS COMMAND COMMENTS COMMIT CONSTRAINT CONSTRUCT CONTINUE COUNT CREATE CURRENT CURSOR DATABASE DATE DATETIME DAY DECIMAL DECLARE DEFAULTS DEFER DEFINE DELETE DELIMITERS DELIMITER DESC DESCENDING DIRTY DISPLAY DISTINCT DOWNSHIFT DROP ELSE END ERROR EVERY EXCLUSIVE EXECUTE EXIT EXISTS EXTEND EXTERNAL FALSE FETCH FIELD FILE FINISH FIRST FLUSH FOR FOREACH FORM FORMAT FRACTION FREE FROM FUNCTION GLOBALS GRANT GROUP HAVING HEADER HELP HIDE HOLD HOUR IF IN INCLUDE INDEX INNER INITIALIZE INPUT INSERT INSTRUCTIONS INTEGER INTERRUPT INTERVAL INTO IS ISOLATION JOIN KEY LABEL LAST LEFT LENGTH LET LIKE LINE LINES LOAD LOCK LOG MAIN MARGIN MATCHES MAX MDY MENU MESSAGE MIN MINUTE MOD MODE MONTH NAME NEED NEXT NO NOENTRY NOT NOTFOUND NULL OF ON OPEN OPTION OPTIONS OR ORDER OTHERWISE OUTER OUTPUT PAGE PAGENO PIPE PREPARE PREVIOUS PRIMARY PRINT PROGRAM PROMPT PUT QUIT READ RECORD REFERENCES REPORT RETURN RETURNING REVERSE RIGTH ROLLBACK ROW ROWS RUN SCR_LINE SCREEN SCROLL SECOND SELECT SET SET_COUNT SHARE SHOW SKIP SLEEP SMALLINT SPACE SPACES START STEP STOP SUM TABLE TABLES TEMP THEN TIME TO TODAY TOP TRAILER TRUE TYPE UNCONSTRAINED UNION UNIQUE UNITS UNLOAD UNLOCK UNLOAD UPDATE UPSHIFT USING VALUES VARCHAR WAIT WAITING WEEKDAY WHEN WHENEVER WHERE WHILE WINDOW WITH WITHOUT WORDWRAP WORK YEAR</Keywords> <Keywords name="Delimiters">00" 01 02" 03' 04 05' 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords> </KeywordLists> <Styles> <WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" fontName="Courier New" fontStyle="0" fontSize="10" nesting="0" /> <WordsStyle name="COMMENTS" fgColor="A2A2A2" bgColor="FFFFFF" fontName="Courier New" fontStyle="2" fontSize="10" nesting="0" /> <WordsStyle name="LINE COMMENTS" fgColor="A2A2A2" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" /> <WordsStyle name="NUMBERS" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> <WordsStyle name="KEYWORDS1" fgColor="0000FF" bgColor="FFFFFF" fontName="Courier New" fontStyle="1" fontSize="10" nesting="0" /> <WordsStyle name="OPERATORS" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> <WordsStyle name="DELIMITERS1" fgColor="008040" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> </Styles> </UserLang> </NotepadPlus>
-
Hello Anderson,
i used your files and it is working for me.
Could it be that you use an older npp version?
Mine is npp 6.8.8.
Did you press the refresh button in function list window?Cheers
Claudia -
Hello Claudia,
I found out what was happening, it is working properly .
In my toolbar appear two buttons on the FunctionList, I was clicking in the second , it does not work . When I used the first appeared properly functions.
Thanks a lot for the help!