Community
    • Login

    Function List incomplete

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    25 Posts 3 Posters 5.7k Views 2 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.
    • MAPJe71M Offline
      MAPJe71 @greg-michael
      last edited by

      @greg-michael

      Any part of the source that matches the commentExpr of the parser is skipped during the search for class, method and function definitions.
      For the majority of the available parsers this feature is used to prevent detection of function definitions in text definitions (aka string literals). The detection of string literals highly depends on the proper i.e. quote balanced text definitions. Any improper definition can lead to all kinds of unexpected results.

      For instance double quoted string literals start and end with a double quote and any double quote within must be escaped.

      AFAICT a lot of the double quoted string definitions in the provided source contain un-escaped double quotes.

      greg-michaelG 1 Reply Last reply Reply Quote 2
      • greg-michaelG Offline
        greg-michael @MAPJe71
        last edited by

        @MAPJe71 said in Function List incomplete:

        For instance double quoted string literals start and end with a double quote and any double quote within must be escaped.

        This is true, except when using a subshell call : $( … ). The double quotes within the subshell execution are treated separately from the string literal definition. At least that’s the way I’ve learned to use them in Shell scripting.

        AFAICT a lot of the double quoted string definitions in the provided source contain un-escaped double quotes.

        For those strings within a string, yes, they are escaped. For those commands being executed within a subshell call, and the results being returned and stored as a String, no.

        MAPJe71M 1 Reply Last reply Reply Quote 0
        • MAPJe71M Offline
          MAPJe71 @greg-michael
          last edited by MAPJe71

          @greg-michael

          those strings within a string

          for the parser (presuming ... does not contain double quotes):
          string_literal_name=" ... \" ... \" ... "
          string_literal_name="${ ... \" ... \" ... }"
          and those strings within a string within a string:
          string_literal_name="${ ... \" ... \\\" ... \\\" ... \" ... }"

          commands being executed within a sub shell call, and the results being returned and stored as a String

          string_literal_name=${ ... }

          The parser will see at least two string literals in the following line:
          string_literal_name="${ part1 " part2 " part3 }"
          i.e. "${ part1 " and " part3 }"

          greg-michaelG 1 Reply Last reply Reply Quote 2
          • greg-michaelG Offline
            greg-michael @MAPJe71
            last edited by

            @MAPJe71 said in Function List incomplete:

            for the parser (presuming ... does not contain double quotes):
            string_literal_name=" ... \" ... \" ... "
            string_literal_name="${ ... \" ... \" ... }"
            and those strings within a string within a string:
            string_literal_name="${ ... \" ... \\\" ... \\\" ... \" ... }"

            commands being executed within a sub shell call, and the results being returned and stored as a String

            string_literal_name=${ ... }

            The parser will see at least two string literals in the following line:
            string_literal_name="${ part1 " part2 " part3 }"
            i.e. "${ part1 " and " part3 }"

            Is it safe to assume that your use of the curly braces in lieu of the parentheses is accidental?

            MAPJe71M 1 Reply Last reply Reply Quote 0
            • MAPJe71M Offline
              MAPJe71 @greg-michael
              last edited by

              @greg-michael Yes

              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