Loading ...
Sorry, an error occurred while loading the content.

New mode questions

Expand Messages
  • cp200205
    Another new mode, Falcon: http://falconpl.org... It s an easy language to write a mode for but none the less, I m running into a few problems... #1... /* ...
    Message 1 of 4 , Dec 25, 2007
    • 0 Attachment
      Another new mode, Falcon: http://falconpl.org...

      It's an easy language to write a mode for but none the less, I'm
      running into a few problems...

      #1... /* ... */ comments. I would like to do as in C and make it
      auto-continue comments on the fly. I am not seeing readily how that's
      done. Now, I do have it hilighting comments correctly, except for
      indentation. When you type:

      /*
      * Hello
      */

      and then format the buffer (or actually it happens also when pressing
      ENTER on the Hello line, you get:

      /*
      * Hello
      */

      #2... run on parameters (as I call them) in functions...

      function sayHello( greeting, name, age, dob, ssn,
      creditCardNo, mothersMaidenName, etc )
      printl("Hello")
      end

      So, the continuation should do as above, indent 8 characters, but then
      the function body only 4. But, what is happening is my indentation for
      function and indenting the creditCardNo, etc... to 4 characters. Thus,
      it's hard to see where the function signature ends and the function
      starts.

      #3... Code folding. Here is a snip of code:

      class Person
      function doSomething()
      printl("initing")
      end
      end

      function hello()
      printl("Hello")
      end


      So, you can probably already identify the problem. I state that:
      ^[ \t]\\(class\\|function\\) should start an fold and that:
      ^[ \t]end should end the fold. However, place your cursor on class
      Person and say fold, it folds to the first end, not the matching end
      based on indentation.

      Can that be fixed somehow?

      My code as it stands now is located at:

      http://jeremy.cowgar.com/files/hkfalcon.emf

      Once completed, it can be added to MicroEmacs if you wish. I also have
      a few other modes I need to dig up and make available.

      Thanks for any help on any of the above difficulties I am having.

      Jeremy Cowgar
    • cp200205
      ... I ve actually figured out the three problems listed in the previous message, however, I have identified one other problem that I am really having problems
      Message 2 of 4 , Dec 27, 2007
      • 0 Attachment
        --- In jasspa@yahoogroups.com, "cp200205" <jeremy@...> wrote:
        >
        > Another new mode, Falcon: http://falconpl.org...
        > ...
        > ...
        > My code as it stands now is located at:
        >
        > http://jeremy.cowgar.com/files/hkfalcon.emf
        >
        > Once completed, it can be added to MicroEmacs if you wish. I also have
        > a few other modes I need to dig up and make available.

        I've actually figured out the three problems listed in the previous
        message, however, I have identified one other problem that I am really
        having problems with, I am not sure if it can be done... Here is an
        example. PERIODS indicate a space.

        if 1 == 2
        ....printl( "Oh no. big error!" )
        end

        but, here's another way of doing a single line if...

        if 1 == 2: printl( "Oh no. big error!" )

        So, as you can bet, with the next line on the if 1 == 2: it's indented
        due to the if. My if rule is simple:

        indent .hilight.falcon n "if" t

        BTW... I updated my code on the URL listed above as a source and I've
        also made a falcon.eaf: http://jeremy.cowgar.com/files/falcon.eaf

        Thanks for any help.

        Jeremy Cowgar
      • cp200205
        One more question in regards to this mode... (again, period . means space in this message) message = Dear Mr. John Doe, n n This here is a message to you
        Message 3 of 4 , Dec 28, 2007
        • 0 Attachment
          One more question in regards to this mode... (again, period "." means
          space in this message)

          message = "Dear Mr. John Doe,\n\n"
          "This here is a message to you that is spanning "
          "several lines in it's source code file.\n\n"
          "I hope you enjoy!"

          That's how it currently formats, but I would like it to format as:

          message = "Dear Mr. John Doe,\n\n"
          ...."This here is a message to you that is spanning "
          ...."several lines in it's source code file.\n\n"
          ...."I hope you enjoy!"

          or indented all the way to the "'s, such as:

          message = "Dear Mr. John Doe,\n\n"
          .........."This here is a message to you that is spanning "
          .........."several lines in it's source code file.\n\n"
          .........."I hope you enjoy!"

          So. With the almost complete falcon mode, there is that issue as well as:

          if 1
          ....printl( "Hello ")
          end

          vs.

          if 1: printl( "Hello" )

          if 1:
          ....printl( "Hello" )

          The first if works great, I cannot figure out how to make the other
          two work.

          Jeremy Cowgar
        • cp200205
          Wow. Ok. I spent some time in both the falcon docs and Jasspa hk*emf files. I found a solution to my IF problem, largely due to me having the syntax wrong. if
          Message 4 of 4 , Dec 28, 2007
          • 0 Attachment
            Wow. Ok. I spent some time in both the falcon docs and Jasspa hk*emf
            files. I found a solution to my IF problem, largely due to me having
            the syntax wrong.

            if 1: print("HELLO")

            is valid, but my other:

            if 1:
            ....print("HELLO")

            is not. If multi line, you cannot use : and have to use an end. So, I
            now have a statement like:

            indent .hilight.falcon n "if[^:]*$" t

            which will work in "most" cases. I suppose,

            if line == "HELLO:WORLD"
            ....print("HELLO")
            end

            would fail.

            Anyway... my only outstanding issue now is indenting:

            name = "Dear Mr. John Doe,\n\n"
            ...."How are you doing today?\n"
            ...."This is a multiline string, one method at least.\n"

            I've tried a few weird things such as:

            indent .hilight.falcon s "^[ \t]*\"" t

            but that will cause each subsequent line to indent and also, it does
            not work if my string exclusion is on.

            Any thoughts on my final problem?

            Jeremy Cowgar
          Your message has been successfully submitted and would be delivered to recipients shortly.