Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Uncompensated overtime? Just Say No.


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.Peter J. Holzer

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

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: hjp-python@hjp.at (Peter J. Holzer)
Newsgroups: comp.lang.python
Subject: Re: What to use for finding as many syntax errors as possible.
Date: Mon, 10 Oct 2022 21:32:56 +0200
Lines: 76
Message-ID: <mailman.623.1665430379.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>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
protocol="application/pgp-signature"; boundary="lwngsto2guy6sc3g"
X-Trace: news.uni-berlin.de a8FMlJOLAw8Fd3NNVB9vKAa7ienNDzneu1CcahRFAXmw==
Return-Path: <hjp-python@hjp.at>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '2022': 0.05; 'content-
type:multipart/signed': 0.05; 'up?': 0.07; 'angelico': 0.09;
'compiler': 0.09; 'content-type:application/pgp-signature': 0.09;
'filename:fname piece:asc': 0.09; 'filename:fname
piece:signature': 0.09; 'filename:fname:signature.asc': 0.09;
'though.': 0.09; 'syntax': 0.15; 'that.': 0.15; '"creative': 0.16;
'"in': 0.16; '+1100,': 0.16; '__/': 0.16; 'antoon': 0.16;
'applies': 0.16; 'challenge!"': 0.16; 'from:addr:hjp-python':
0.16; 'from:addr:hjp.at': 0.16; 'from:name:peter j. holzer': 0.16;
'hjp@hjp.at': 0.16; 'holzer': 0.16; 'hour.': 0.16; 'pardon': 0.16;
'parsing': 0.16; 'reality.': 0.16; 'stross,': 0.16;
'subject:syntax': 0.16; 'url-ip:212.17.106.137/32': 0.16; 'url-
ip:212.17.106/24': 0.16; 'url-ip:212.17/16': 0.16; 'url:hjp':
0.16; 'useful.': 0.16; '|_|_)': 0.16; 'wrote:': 0.16; 'problem':
0.16; 'to:addr:python-list': 0.20; "i've": 0.22; 'maybe': 0.22;
'run': 0.23; "isn't": 0.27; 'chris': 0.28; 'sense': 0.28;
'example,': 0.28; 'error': 0.29; 'blog': 0.30; 'takes': 0.31;
'program': 0.31; 'think': 0.32; "doesn't": 0.32; '(as': 0.32;
'context': 0.32; 'half': 0.32; 'but': 0.32; 'subject:for': 0.33;
'there': 0.33; 'url:blog': 0.33; 'same': 0.34; 'header:In-Reply-
To:1': 0.34; 'yes,': 0.35; 'fix': 0.36; 'mon,': 0.36; 'posts':
0.36; 'really': 0.37; "it's": 0.37; 'file': 0.38; 'means': 0.38;
'error,': 0.38; 'read': 0.38; 'finding': 0.39; 'rest': 0.39;
'still': 0.40; "couldn't": 0.40; 'subject:What': 0.40; 'want':
0.40; 'here.': 0.61; 'received:212': 0.62; 'full': 0.64;
'authors': 0.64; 'becomes': 0.64; 'years': 0.65;
'received:userid': 0.66; 'time.': 0.66; 'worked': 0.67; '[1]':
0.67; 'away': 0.67; 'during': 0.69; 'papers': 0.69; 'url-
ip:212/8': 0.69; 'times': 0.69; 'took': 0.69; '[2]': 0.70;
'longer': 0.71; 'disagree': 0.84; 'received:at': 0.84;
'subject:many': 0.84; 'url-ip:149/8': 0.84
Mail-Followup-To: python-list@python.org
Content-Disposition: inline
In-Reply-To: <CAPTjJmp3OKmWgMBhO2qjiU9f5rnj_fQ+JZ7NkYAKZvwurnSbgA@mail.gmail.com>
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: <20221010193256.o7wa4vy4tmel6c6h@hjp.at>
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>
 by: Peter J. Holzer - Mon, 10 Oct 2022 19:32 UTC
Attachments: signature.asc (application/pgp-signature)

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.

> 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. But the same problem applies to
compilers. It's not very important if a compile run only takes a second
or so but even then it might be helpful to see several error messages
and not only one at a time. It becomes much more important as compile
times get longer (as an extreme[1] example, when I worked on a largeish
cobol program in the 1980s, compiling the thing took about half an hour.
I really wanted to fix *everything* before starting the compiler again.)

Marijn isn't the only person who revisited this problem recently[2].
I've read a few other blog posts and papers on that topic at about the
same time.

hp

[1] Yes, there are programs where a full compile takes much longer than
that. But you can usually get away with recompiling only a small
part, so you don't have to wait that long during normal development.
That cobol compiler couldn't do that.

[2] "Recently" means "in the last 10 years or so".

--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"

Attachments: signature.asc (application/pgp-signature)

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

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor