Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

6 May, 2024: The networking issue during the past two days has been identified and appears to be fixed. Will keep monitoring.


devel / comp.lang.python / Re: What to use for finding as many syntax errors as possible.

SubjectAuthor
o Re: What to use for finding as many syntax errors as possible.Chris Angelico

1
Re: What to use for finding as many syntax errors as possible.

<mailman.624.1665435750.20444.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19774&group=comp.lang.python#19774

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: What to use for finding as many syntax errors as possible.
Date: Tue, 11 Oct 2022 08:02:17 +1100
Lines: 42
Message-ID: <mailman.624.1665435750.20444.python-list@python.org>
References: <a95001e1-b60e-63ce-d363-30481d115282@vub.be>
<CABaFrRayYinb9Cd1w=iAz1NWmt6MOzam1yEYXPaAMjREriVUAg@mail.gmail.com>
<00893b0c-e367-6fc9-cdae-f0ee42bc16c0@vub.be>
<CABaFrRaaXAz6ZygQNpp2LTNgVMh+hv55RoBv+ZS7E8s4ki83+w@mail.gmail.com>
<8ba966ed-a935-84ea-f65d-fec0dc71403a@vub.be>
<CAPTjJmp3OKmWgMBhO2qjiU9f5rnj_fQ+JZ7NkYAKZvwurnSbgA@mail.gmail.com>
<20221010193256.o7wa4vy4tmel6c6h@hjp.at>
<CAPTjJmrvVqpX8+bcH_2P8xr8c4=CSBK9vP9QkpxS5zxqkeObyg@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de Q5juLh3ENN55PZw97C84GAF/4ptms7zNFBgXr4Ns1/7Q==
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=jae4CsGD;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.021
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; '2022': 0.05; 'thread':
0.05; 'up?': 0.07; 'angelico': 0.09; 'compiler': 0.09;
'fundamental': 0.09; 'parse': 0.09; 'though.': 0.09; 'syntax':
0.15; '+1100,': 0.16; 'antoon': 0.16; 'chrisa': 0.16;
'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
'holzer': 0.16; 'pardon': 0.16; 'parsing': 0.16;
'received:209.85.218': 0.16; 'subject:syntax': 0.16; 'syntactic':
0.16; 'useful.': 0.16; 'wrote:': 0.16; 'tue,': 0.19; 'to:addr
:python-list': 0.20; 'doubt': 0.22; 'maybe': 0.22; 'code': 0.23;
'else': 0.27; 'chris': 0.28; 'expect': 0.28; 'sense': 0.28;
'error': 0.29; 'blog': 0.30; 'attempt': 0.31; 'think': 0.32;
"doesn't": 0.32; 'context': 0.32; 'suitable': 0.32; 'message-
id:@mail.gmail.com': 0.32; 'but': 0.32; 'subject:for': 0.33;
'url:blog': 0.33; 'use,': 0.33; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'from:addr:gmail.com': 0.35;
'errors': 0.36; 'mon,': 0.36; "it's": 0.37; 'received:209.85':
0.37; 'this.': 0.37; 'though': 0.37; 'file': 0.38; 'error,': 0.38;
'read': 0.38; 'received:209': 0.39; 'text': 0.39; 'finding': 0.39;
'rest': 0.39; 'still': 0.40; 'subject:What': 0.40; 'wants': 0.40;
'want': 0.40; 'here.': 0.61; 'skip:h 10': 0.61; "there's": 0.61;
'between': 0.63; 'everything': 0.63; 'authors': 0.64; 'your':
0.64; 'look': 0.65; 'that,': 0.67; 'lives': 0.69; 'quote': 0.74;
'features': 0.75; 'happens': 0.84; 'ages': 0.84; 'dark': 0.84;
'disagree': 0.84; 'happened.': 0.84; 'subject:many': 0.84;
'surprised': 0.84; 'url-ip:149/8': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:from:to:cc:subject:date:message-id:reply-to;
bh=x7ges12g3Ahy7t6F51atWyfiSjWKiqvNJz5ekLKFuT0=;
b=jae4CsGD3oZWZIs3Oxrz6OJ6nw+Q348EqEDA62oPko1SKFZIC64seD81PoK5CqFf5y
J1lS8D2A1HKGSvy9kAJX8+HDKOyM1oKURIwdZ+wsvVSiXL7tIy7SJn96JZUlepEE+Vhx
I8o7BQX+m0QxTi2Mbv5N+dsgatRsdNSKJwokvEEt0QmXH2adYStDy/bOuAJdNWYVL4HQ
Khro/YlYuNKMNvvMSkGjqKrW6GpzdA7s45brGlVPnV2cCYgjqtSfTZSuBXf6VXfbMrO/
r8BEjEMyFM/bVAIDT/9rVotM3oNF/P7dBAHU018uPDJfTQxdCU9kuO0B4ZJEKQ40B7Xt
QCxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=x7ges12g3Ahy7t6F51atWyfiSjWKiqvNJz5ekLKFuT0=;
b=vnS5UgLeFlC1H92DQiJvIEExV8uM8OY//Hv/VtOc2c+JfTo3x2+NlgHNh4ZUDLPs7c
QZjWnIdG+AvUsZ/bgsQfxqeAKX1boFlypfdD8kjBZsBlIyc1VSYYpEHnURmvBBBz1Kdr
Kxlg5VlTCPQvBa+9K3IG/RD6F1ilpeo/56siM/12QxE6k4XqODj6A4nZYsNRkPJef3tx
PC/ubjnKaXFI9NePhVlgYboig4tlcPGn5C/06xXGJKVo1PDroTYDIHyTo7UZg4x8scRh
8f2ziQm69UBGn8YictSa+RIScWj2tUNnHHB8s5d5v6xIT3s2tW+gmb4au/flplUn7e2U
qPEA==
X-Gm-Message-State: ACrzQf24SmiEAit0zWFr+SbcNTYX9jlJ0Zqu+WxDvPn2Zn1hXK+4qHZO
C0A+BBz+9MbJdp69MojU+uuHHwFILfk8hqGHRpSnH3h+
X-Google-Smtp-Source: AMsMyM74KwsAtleI4MyiIynjyDjPGw47gJZ4mPrU4sZ021Nph8mDLt0de7LtUgEZtBJRIu6ZsC6TOOPP8KkJqHR5cyA=
X-Received: by 2002:a17:907:a4c:b0:77b:ba98:d3e with SMTP id
be12-20020a1709070a4c00b0077bba980d3emr16723221ejc.13.1665435748557; Mon, 10
Oct 2022 14:02:28 -0700 (PDT)
In-Reply-To: <20221010193256.o7wa4vy4tmel6c6h@hjp.at>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmrvVqpX8+bcH_2P8xr8c4=CSBK9vP9QkpxS5zxqkeObyg@mail.gmail.com>
X-Mailman-Original-References: <a95001e1-b60e-63ce-d363-30481d115282@vub.be>
<CABaFrRayYinb9Cd1w=iAz1NWmt6MOzam1yEYXPaAMjREriVUAg@mail.gmail.com>
<00893b0c-e367-6fc9-cdae-f0ee42bc16c0@vub.be>
<CABaFrRaaXAz6ZygQNpp2LTNgVMh+hv55RoBv+ZS7E8s4ki83+w@mail.gmail.com>
<8ba966ed-a935-84ea-f65d-fec0dc71403a@vub.be>
<CAPTjJmp3OKmWgMBhO2qjiU9f5rnj_fQ+JZ7NkYAKZvwurnSbgA@mail.gmail.com>
<20221010193256.o7wa4vy4tmel6c6h@hjp.at>
 by: Chris Angelico - Mon, 10 Oct 2022 21:02 UTC

On Tue, 11 Oct 2022 at 06:34, Peter J. Holzer <hjp-python@hjp.at> wrote:
>
> On 2022-10-10 09:23:27 +1100, Chris Angelico wrote:
> > On Mon, 10 Oct 2022 at 06:50, Antoon Pardon <antoon.pardon@vub.be> wrote:
> > > I just want a parser that doesn't give up on encoutering the first syntax
> > > error. Maybe do some semantic checking like checking the number of parameters.
> >
> > That doesn't make sense though.
>
> I think you disagree with most compiler authors here.
>
> > It's one thing to keep going after finding a non-syntactic error, but
> > an error of syntax *by definition* makes parsing the rest of the file
> > dubious.
>
> Dubious but still useful.

There's a huge difference between non-fatal errors and syntactic
errors. The OP wants the parser to magically skip over a fundamental
syntactic error and still parse everything else correctly. That's
never going to work perfectly, and the OP is surprised at this.

> > What would it even *mean* to not give up?
>
> Read the blog post on Lezer for some ideas:
> https://marijnhaverbeke.nl/blog/lezer.html
>
> This is in the context of an editor.

Incidentally, that's actually where I would expect to see that kind of
feature show up the most - syntax highlighters will often be designed
to "carry on, somehow" after a syntax error, even though it often
won't make any sense (just look at what happens to your code
highlighting when you omit a quote character). It still won't always
be any use, but you do see *some* attempt at it.

But if the OP would be satisfied with that, I rather doubt that this
thread would even have happened. Unless, of course, the OP still lives
in the dark ages when no text editor available had any suitable
features for code highlighting.

ChrisA

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor