Community
    • Login

    Debugging Funtion Lists

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    function list
    6 Posts 3 Posters 2.9k Views 3 Watching
    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 Offline
      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 Offline
        MAPJe71
        last edited by

        Try language ID 19 instead.

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

          That works. Thanks for the input.

          1 Reply Last reply Reply Quote 0
          • Robert MurrellR Offline
            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 Offline
              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 Offline
                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

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors