Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.ArgumentOutOfRangeException #78

Closed
terac opened this issue Jul 16, 2018 · 5 comments
Closed

System.ArgumentOutOfRangeException #78

terac opened this issue Jul 16, 2018 · 5 comments

Comments

@terac
Copy link
Contributor

terac commented Jul 16, 2018

I got this exception during syntax checking of json files containing errors.

"Index was out of range. Must be non-negative and less than the size of the collection."

`

    [Fact]
    public void TestErrorMissingClosingBracket()
    {
        EbnfJsonGenericParser jsonParser = new EbnfJsonGenericParser();
        ParserBuilder<JsonTokenGeneric, JSon> builder = new ParserBuilder<JsonTokenGeneric, JSon>();
        Parser = builder.BuildParser(jsonParser, ParserType.EBNF_LL_RECURSIVE_DESCENT, "root").Result;

        ParseResult<JsonTokenGeneric, JSon> r = Parser.Parse("{");
        Assert.True(r.IsError);
    }

`
After a first glance at the code you don't check the position accessing tokens after end of list .

@b3b00
Copy link
Owner

b3b00 commented Jul 16, 2018

Hi @terac ,

I am not sure but this seems to be your own testcase, isnt it ? If so feel free to debug and PR a bugfix.
I am currently quite busy at work with little time forCSLY.

Thanks for your testing, in parsing problems it is very difficult to test all posibilities. Glad you found this one.

Olivier

@b3b00
Copy link
Owner

b3b00 commented Jul 16, 2018

@terac, I took time to check your test case. I don't reproduce the bug. All Unit tests are OK on branch dev. Which branch di you test on ? Have you added some kind of specific ?
Could you make a PR with your code so we could debug your trouble ?

Thanks

@terac
Copy link
Contributor Author

terac commented Jul 16, 2018

I'll try to debug it in the evening.

@terac
Copy link
Contributor Author

terac commented Jul 16, 2018

Should I commit to dev or make a separate branch for that issue?

@b3b00
Copy link
Owner

b3b00 commented Jul 16, 2018

create a branch from dev than commit on it and send me and send me a pull-request. Never commit directly on dev branch.
for better tracking you should name your branch according to this issue : bugfix/78-argumentoutofrange or something like that

terac added a commit to terac/csly that referenced this issue Jul 16, 2018
…ingBracket is ok, TestJsonEbnfSyntaxMissingLastClosingBracket throws the exception
b3b00 pushed a commit that referenced this issue Jul 17, 2018
b3b00 pushed a commit that referenced this issue Jul 17, 2018
* dev:
  bugfix #78 : thanks to @terac
  #78 - two similar test cases: TestJsonSyntaxErrorMissingLastClosingBracket is ok, TestJsonEbnfSyntaxMissingLastClosingBracket throws the exception
@b3b00 b3b00 closed this as completed Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants