Community
    • Login

    Debugging Funtion Lists

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    function list
    6 Posts 3 Posters 2.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Robert MurrellR
      Robert Murrell
      last edited by

      I’m trying to add MooTools support to Function Lists. MooTools is a JQuery-like OOP Javascript framework. I’ve edited functionList.xml to replace the Javascript definition for langID=“58”. I can’t get it to work. The regexps I defined work with Find. Is there any way to determine what Function List is failing on?

      Here are the particulars.
      functionList.xml

      <association id=      "mootools_syntax"   langID="58"                          />
      
      		<!-- ========================================================= [ MooTools ] -->
      
      		<parser
      			displayName="MooTools"
      			id         ="mootools_syntax"
      			commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"
      		>
      			<classRange
      				mainExpr    ="^var[\t\x20]+\w+\s*\=\s*\{"
      				openSymbole ="\{"
      				closeSymbole="\}"
      			>
      				<className>
      					<nameExpr expr="[\t\x20]+\w+" />
      					<nameExpr expr="\w+" />
      				</className>
      				<function
      					mainExpr="^[\t\x20]+\w+[\t\x20]*\:[\t\x20]*function[\t\x20]*\(.*\)[\t\x20]*\{"
      				>
      					<functionName>
      						<funcNameExpr expr="[\t\x20]+\w+" />
      						<funcNameExpr expr="\w+" />
      					</functionName>
      				</function>
      			</classRange>
      			<function
      				mainExpr="^[\t\x20]*function[\t\x20]+\w*[\t\x20]*\(.*\)[\t\x20]*\{"
      			>
      				<functionName>
      					<nameExpr expr="[\t\x20]+\w+" />
      					<nameExpr expr="\w+" />
      				</functionName>
      				<className>
      					<nameExpr expr="\w+(?=\s*::)" />
      				</className>
      			</function>
      		</parser>
      

      tst.js:
      var Class1 = {
      method1:function() {
      }
      }

      function func1 () {
      }

      1 Reply Last reply Reply Quote 0
      • MAPJe71M
        MAPJe71
        last edited by

        Try language ID 19 instead.

        1 Reply Last reply Reply Quote 0
        • Robert MurrellR
          Robert Murrell
          last edited by

          That works. Thanks for the input.

          1 Reply Last reply Reply Quote 0
          • Robert MurrellR
            Robert Murrell
            last edited by

            Next problem. With the following source code, Function List only shows method1 but not method2:

            var Class1 = {
            method1:function() {
            },
            method2:function() {
            }
            }

            1 Reply Last reply Reply Quote 0
            • YaronY
              Yaron
              last edited by

              Hello Robert,

              Follow the instructions here.
              Both functions are displayed.

              Best regards.

              1 Reply Last reply Reply Quote 0
              • Robert MurrellR
                Robert Murrell
                last edited by

                Thanks for the help. Here is a simple parser for MooTools. I’ll expand it as I become more familiar with PCRE.

                		<association id=      "mootools_syntax"   langID="19"                          />
                
                		<parser
                			displayName="MooTools"
                			id         ="mootools_syntax"
                			commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"
                		>
                			<classRange
                				mainExpr    ="(^var[\t\x20]+[A-Za-z_]\w*\s*\=\s*\{|(\bvar)?[\t\x20]+[A-Za-z_]\w*\s*\=\s*new\s+[A-Za-z_]\w*\s*\(\s*\{)"
                				openSymbole ="\{"
                				closeSymbole="\}"
                			>
                				<className>
                					<nameExpr expr="[\t\x20]+[A-Za-z_]\w*" />
                					<nameExpr expr="[A-Za-z_]\w*" />
                				</className>
                				<function
                					mainExpr="^[\t\x20]+\w+[\t\x20]*\:[\t\x20]*function"
                				>
                					<functionName>
                						<funcNameExpr expr="[\t\x20]+\w+" />
                						<funcNameExpr expr="\w+" />
                					</functionName>
                				</function>
                			</classRange>
                			<function
                				mainExpr="((^|\s+|[;\}\.])([A-Za-z_]\w*\.)*[A-Za-z_]\w*\s*[=:]|^|[\s;\}]+)\s*function(\s+[A-Za-z_]?\w*\s*\([^\)\(]*\)|\([^\)\(]*\))[\n\s]*\{"
                			>
                				<functionName>
                					<nameExpr expr="[A-Za-z_]\w*\s*[=:]|[A-Za-z_]?\w*\s*\(" />
                					<nameExpr expr="[A-Za-z_]?\w*" />
                				</functionName>
                				<className>
                					<nameExpr expr="([A-Za-z_]\w*\.)*[A-Za-z_]\w*\." />
                					<nameExpr expr="([A-Za-z_]\w*\.)*[A-Za-z_]\w*" />
                				</className>
                			</function>
                		</parser>
                
                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors