Project

General

Profile

Feature #673

Error message: I was expecting...

Added by John Abbott about 3 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
enhancing/improving
Target version:
Start date:
11 Mar 2015
Due date:
% Done:

0%

Estimated time:
3.00 h
Spent time:

Description

The generic error message

ERROR: I was expecting an identifier by found "weights" 

should be improved, e.g. to explain why weights is unsuitable (because it's a keyword).


Related issues

Related to CoCoA-5 - Design #668: Remove keyword "weights"?Closed2015-03-05

Related to CoCoA-5 - Support #530: Interpreter error message: "for" with missing "do"New2014-04-09

History

#1 Updated by John Abbott about 3 years ago

  • Estimated time set to 3.00 h

The relevant source code is Parser.H:156

The following rule may help identify the "type" of a parser token:
  • starts with a letter --> keyword or identifier
  • starts with a digit --> number
  • starts with double quote --> string (literal)
  • otherwise symbol/operator

#2 Updated by John Abbott over 2 years ago

The original report did not contain an example of input which produces the unhelpful error message. I think the following illustrates the problem:

record[for := 1];

Curiously, this input evidently confuses the parser because it produces two very similar error messages -- probably not worth fixing.

Also available in: Atom PDF