[plt-scheme] help about javascript.plt

From: wwall (wwall at yandex.ru)
Date: Thu May 3 05:40:39 EDT 2007

Hello Dave,

Tuesday, May 1, 2007, 5:14:00 PM, you wrote:

DH> Sorry I didn't see this email sooner. I'm the owner of javascript.plt.
DH> Did Danny's suggestion help? I need to check the spec to see if it's
DH> correct.

Dave,sorry my bad English.

I write interpreter used source code of your javascript.plt.

I have problem with cyrilic symbol, now solve it here
(as say Matthew Flatt <mflatt at cs.utah.edu>)
 (define (regexp-match-peek-string-positions rs port)
        (let ([m (regexp-match-peek-positions rs port)])
          (and 
           m
           (let ([start (bytes-utf-8-length (peek-bytes (caar m) 0 port))])
             (list 
              (cons start
                    (+ start 
                       (bytes-utf-8-length 
                        (peek-bytes (- (cdar m) (caar m)) 0 port)))))))))
and replace all occurence of regexp-match-peek-positions on regexp-match-peek-string-positions
I don't know exist better way of correct or not.
Second problem what i had was: keyword may be represent by 2 string,
for exampe "return" and "возврат". I replace you code so
[(regexp-match-peek-string-positions rx:identifier source)
           => (lambda (match)
                (let* ([start (current-position)]
                       [contents (read-string (cdar match) source)]
                       [sym (toKeyWord contents)])
                  (if (memq sym (lexical-keywords))
                      (make-token sym sym (@ start))
                      (make-token 'ID sym (@ start)))))]
where (toKeyWord  x) return symbol of keyword if it is keyword or x
otherwise. So may be better way for correct this problem?
And now i hafe next problem: in my lang exists next construction -
function x(y=0, z, t=1) ....
and may call so
x(,2,2) equal call (0,2,2) - i don't know represent this fact in AST
if you can  - help me, please

DH> wwall wrote:
>> Hello all,
>>   Sory my bad English.
>>   
>>   I need help about javascript.plt.
>>   How i can use national char in declaration of ID?
>>   when i change declaration of
>>   [letter (union   (range #\a #\z) (range #\A #\Z))]
>>   to
>>   [letter (union   (range #\a #\z) (range #\A #\Z) (range #\а #\я)
>>   (range #\А #\Я))]
>>   i can't get end of lexeme, becouse not read space as delimiter
>> 
>>   Or, may be anybody can tell me e-mail of author this product?
>>   
>>   
>> 



-- 
Best regards,
 wwall                            mailto:wwall at yandex.ru



Posted on the users mailing list.