Community
    • Login

    Function List incomplete

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

              @greg-michael Yes

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors