From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ramin Honary Newsgroups: gmane.lisp.guile.devel Subject: How to submit a small patch, update to Emacs Lisp parser Date: Wed, 20 Nov 2024 08:43:08 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000004c287b062754249a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16396"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Nov 20 09:44:10 2024 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tDgJl-00046I-4L for guile-devel@m.gmane-mx.org; Wed, 20 Nov 2024 09:44:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDgJL-0007Kn-A2; Wed, 20 Nov 2024 03:43:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tDgJB-0007IU-Hq for guile-devel@gnu.org; Wed, 20 Nov 2024 03:43:35 -0500 Original-Received: from mail-ua1-x934.google.com ([2607:f8b0:4864:20::934]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tDgJ9-00053I-UE for guile-devel@gnu.org; Wed, 20 Nov 2024 03:43:33 -0500 Original-Received: by mail-ua1-x934.google.com with SMTP id a1e0cc1a2514c-856e849af48so2111855241.2 for ; Wed, 20 Nov 2024 00:43:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732092200; x=1732697000; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=brvX6Ybc8/cNUaXAsnCaXi7xoBBfSCk/YOKto+Y5eUg=; b=PvJJwOs3J3H6UISLOZ6ZSFRmRA2BmjZlPQ0GRYVDnw8yh1TGxYSxSS9v1aBlT/l0Qw Ibhd5SDf1Ij/Vt0pU7u6jveqxlaMSCSJkepoQb9B5tWGs+FbJmSY9CmA6L0TnmVu7ORe jvyyY/DdqqYCMQf1GWfwHZRUdeOcFReO/BHZzWwjNMIuRllZnYDE0SS9RyXzMnfuYklf /J2xSFYITALiGeHswnD+875X4VifloeKRin+Kinj6WGY/vBkWg2rvDVMYAb8KMPqRtUw VasltwnEQHyJksq+f1d1Br5ReDWDw/9ivAvUH4CKltesUhqrXqUOVxbxX/d3iVx6rn5g hx3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732092200; x=1732697000; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=brvX6Ybc8/cNUaXAsnCaXi7xoBBfSCk/YOKto+Y5eUg=; b=XBg9/alrhHyZaXJ/LTKtqmtGgSaaYaPIrzm+9ZgoQ1DtnCQFBX8mEdxM0iiuS/fr0Q r7yZCjCd/v5uW9skKu3UtjfKJB9eA2SrwPFACeZ6bJuWTVQn58WUyF6sNl4DUA1KEy1N qVE1GuYEj//f69WHHSa8qqD2kGhPpf9yCWQg1ZRU43xUyRFKgxu3bPgKTIMxF05k8Iim FPlb0ruMyfUba2ieF1dLY+ScN5nUWsaa6DNn+XovxNDl0LTWPr01pPJqj3bu7UfAQXGG P0KngSTUkWCHdY2eFplEDiVLUwJSHa5OzzS10zVlEABWMIVimLSYgRRrRTN8l2qVpCOp V5OQ== X-Gm-Message-State: AOJu0YyWo+1AX1rNytZVDGgdC5vTYwWhhtTlGAPYP8UniWrUWh7Llq4v 0gnQaIUwgTMfktgLeuzwcmr2XIMTq69Z4JJv9If0BewOOijjpbwqUVabqV2663zzX0pC4i2F1zI FUExVmZf8cKSy/kaRVWeIdzeoH2hGXYqB X-Google-Smtp-Source: AGHT+IE3qF4+2W7W+B0r0wujkKJZmyBLVdOoegUYeDmbF3o3spvr3w7Urb/2s4p+Kuaz8U8CAI1TxC3hlc1fo3541u4= X-Received: by 2002:a05:6102:32c8:b0:4ad:5c9c:c65f with SMTP id ada2fe7eead31-4adaf5acd66mr2368106137.20.1732092199960; Wed, 20 Nov 2024 00:43:19 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::934; envelope-from=ramin.honary@gmail.com; helo=mail-ua1-x934.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:22778 Archived-At: --0000000000004c287b062754249a Content-Type: text/plain; charset="UTF-8" Hello Guile developers: I have made a small bug fix for the Emacs Lisp parser in the (language elisp) module. - I fixed a simple bug in the lexer that decodes the carat encoding for control characters (for example "^@" translates to #\null), - and I implemented octal digit decoding in the lexer. I have tested these changes against Emacs Lisp code from the GNU Emacs source code. I can confirm that files like "subr.el" can be fully parsed to list data structures in Scheme now. Here is a simple test program that parses "subr.el" from GNU Emacs: (use-modules ((language elisp parser) #:select (read-elisp))) (define (file-read-all-forms filepath) (call-with-port (open-input-file filepath) (lambda (port) (let loop ((forms-list '())) (let ((form (read-elisp port))) (cond ((eof-object? form) (reverse forms-list)) (else (loop (cons form forms-list))) )))))) (define path-to-test-el "/home/ramin/src/emacs-29.4/lisp/subr.el") (define (main) (for-each (lambda (form) (display form) (newline)) (file-read-all-forms path-to-test-el))) Before applying my patch, the above test program fails with: ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure integer->char: Argument 1 out of range: 67108955 After applying my patch, the whole file parses successfully. The patch is not that large, so I am attaching it to this e-mail. But if you would prefer, I can submit it by some other means, such as the Savannah Git server, if you can instruct me how to do so. Regards, -- Ramin Honary (ActivityPub: @ramin_hal9001@fe.disroot.org) --0000000000004c287b062754249a Content-Type: application/gzip; name="2024-11-20_ramin-honary_improve-elisp-parser.patch.gz" Content-Disposition: attachment; filename="2024-11-20_ramin-honary_improve-elisp-parser.patch.gz" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_m3pmxfbq0 H4sICJmgPWcAAzIwMjQtMTEtMjBfcmFtaW4taG9uYXJ5X2ltcHJvdmUtZWxpc3AtcGFyc2VyLnBh dGNoAK1ae3PbxhH/n5/iRLUxGBIUQVKkpNiSPGncZKZNMnY66UzTdI7AkUQEAjQOsKTU7WfvPg5P HijFKccWCdze3t4+frv3eJMmO7FSs7k/U4G8WKrlaipni8tALebedDWR86mcyPPZhXcpZ+KvSSze qb3wlmIyuaJ/YjqZeL03wOZKvJW7MBZfJ7FMH8XLFJ9uszTZh74b6kiNt9QCXzt13fuTzNSV+FEF I2Ahvk0+wNd0LrzZ1Wx65XliOLmcTHrv8tUvys+uxD++f/3Dl1//U/hbGW+UyBKRbZX4aid9Lf4S 6r3Yy1SrVIAA2OBEQJZLoFQRtA7ELgnySPV6QrjiG7EOH1QgpNDhbh8psco3RcdIPQCXbCszESg/ CZSm175M4Y2K4U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