develooper Front page | perl.perl6.internals.api.parser | Postings from December 2000

Re: Now, to try again...

Thread Previous | Thread Next
From:
Nathan Torkington
Date:
December 17, 2000 14:26
Subject:
Re: Now, to try again...
Message ID:
14909.11286.246069.496459@prometheus.frii.com
Nicholas Clark writes:
> Would it be sane to get the parser to return suitable information on the
> source to let a syntax analyser (such as a highlighting editor) know that
> character positions 5123 to 5146 are a qq() string (So it can change the
> font or the colour or whatever)

I think the problems with this that were raised in the past are:
 * parsing partial source
 * does this mean that the parser has to reparse the whole sourcefile
   every time you type a character?

I think the better solution is to make Perl just a little more regular
(as suggested in RFCs about making m in matches mandatory) so that it
becomes easier to parse.  Of course with

  $a = \"foo";

your text editor needs to learn a little more about Perl :-)  Or you
could write your own little language, so that you would write:

  $a = reference_to("foo");

Or, better yet, simply write in unambiguous XML:

  <operator name="=">
    <operand position=0>
      <variable type="scalar">a</variable>
    </operand>
    <operand position=1>
      <operator name="reference_to">
        <operand position=0>
          <constant type="string">foo</constant>
        </operand>
      </operator>
    </operand>
  </operator>

:-)

Nat

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About