Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some parser errors

See original GitHub issue

These 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

kornilova203commented, Dec 12, 2018

I fixed some of them

  1. tilda in function parameters b24cf9189dabc999fe8fcbbfa5ca257f28a694df
  2. tilda in groped return values 2f29aedcd1270dcfded440f8987a93489fe9a20e
  3. cell arrays d7910870c7bf4d9cf6c87742e335e69264e64e04
  4. meta classes, getters/setters, property attributes without values 34bc00b4816cea050baef8f73949fcc0aaad1963
crisluengocommented, Dec 12, 2018

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found