Some parser errors
See original GitHub issueThese three lines are legal syntax but show an error:
[V,~] = eig(S); % at the bracket after the `~`: "'...' or <expression> expected, got ']'"
t = V{:,ii}; % "':' unexpected"
pxsz(end+1:length(v)) = pxsz(end); % at the `+`: "',' or '...' expected, got '+'"
Similarly, in a function definition,
function res = istensor(~)
gives an error for unexpected ~
(it indicates that one input argument is accepted but not used).
In classdef
files,
properties (Access=private)
is parsed correctly, but
properties (Dependent)
shows an error at the closing bracket saying “‘=’ expected”.
The setter function
function img = set.Array(img,data)
shows an error at the dot: “‘.’ unexpected”. The same is true for getter methods, which start with get.
.
When overloading the end
function, the parser also throws a fit:
function ii = end(a,k,n)
It seems that end
is marked as a reserved keyword. It is true that it is not legal to use it as a variable name, but it is OK as a function name because it can be overloaded for custom classes.
Yes, MATLAB syntax is terrible… 😃
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Parser Errors - Point-Free
A new release of swift-parsing that brings delightful and informative error messaging to parser failures.
Read more >Common CSS Parser Errors (Parsing Errors Found)
An Unknown Word Error is similar to an unclosed block error and often shows when the selector is missing the left curly bracket....
Read more >Parse Error: What It Is and How to Fix It - Lifewire
A parse error is an error message you sometimes get on Android devices when an app fails to install. The message itself is...
Read more >What is a parse error? - Quora
Parse errors happen when the code you've written doesn't conform to the syntax or language rules for the language in which you're working....
Read more >Writing a Parser — Part III: Syntax Error Handling - Medium
A syntax error is a case where an unexpected token is reached, or in other words, the next token does not match the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I fixed some of them
I appreciate this immensely. It is fantastic being able to work on both the C++ and MATLAB portions of my project in the same editor!