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

2547Re: [jasspa] Re: More indent questions

Expand Messages
  • Jon Green
    Apr 20, 2010
      Jeremy Cowgar wrote:
      > No input on this? Just to make sure formatting was correct, period = space
      >
      > say-hello
      > ...."Hello" println
      >
      > say-hello-10-times
      > ....10 times
      > ........say-hello
      > ....next
      >
      > main
      > ....say-hello-10-times
      >
      > I can make the things such as 10 times ... say-hello indent properly,
      > but how do I make things such as say-hello, then the next line (and all
      > subsequent lines) be indented?
      >
      > Jeremy

      Hi Jeremy,

      Sorry I have not had a lot of time and to help you then we have to actually
      write a complete template and find some examples.

      After looking at the examples on the web page then I am struggling because
      there is no clear anchor in the syntax to determine when the indent is supposed
      to end.

      Anyway I had a play around and have so far come up with nothing that works
      every case of your examples and the document on josl. When I look at your
      example below I am wondering how you got the indent working at all?

      My implementation is so far this:

      !if &sin "d" .fhook-josl.setup
      0 indent .hilight.josl 0 10
      indent .hilight.josl u "^\\w+" -t t
      indent .hilight.josl n "if" t
      ; indent .hilight.josl n "is" t
      ; indent .hilight.josl n "do" t
      indent .hilight.josl s "else" -t
      indent .hilight.josl o "end" -t
      ; indent .hilight.josl o "until" -t
      ; indent .hilight.josl n "begin" t
      indent .hilight.josl e "\"" "\"" "\\"
      indent .hilight.josl i "#"
      !endif

      And I am struggling.


      Regards
      Jon.



      >
      > On 4/12/2010 1:34 PM, Jeremy Cowgar wrote:
      >> I am trying to write a mode for the Josl programming language,
      >> http://www.josl.org
      >>
      >> I can get everything to indent, i.e.
      >>
      >> is-person? if
      >> "Hello, Person!" println
      >> end
      >>
      >> except for the new words...
      >>
      >> say-hello
      >> "Hello" println
      >>
      >> main
      >> say-hello
      >> say-hello
      >> 10 times
      >> say-hello
      >> next
      >>
      >> So, if a word starts in column 1, then it's a new top level word. That
      >> top level word's definition continues until a new top level word
      >> begins. Now, in practical use, you separate two top level words by two
      >> blank lines, so that could be used to detect the end of a word for
      >> indentation.
      >>
      >> Does anyone have an idea on how this can be accomplished?
      >>
      >> Jeremy
      >>
      >
      >
      >
      > ------------------------------------
      >
      > __________________________________________________________________________
      >
      > This is an unmoderated list, but new members are moderated to ensure that there are no spam users. JASSPA is not responsible for the content of
      > any material posted to this list.
      >
      > To un-subscribe, send a mail message to
      >
      > mailto:jasspa-unsubscribe@yahoogroups.com
      >
      > or visit http://groups.yahoo.com/group/jasspa and
      > modify your account settings manually.
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
    • Show all 11 messages in this topic