-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Classify parser errors and use them #320
Conversation
f174826
to
67dece9
Compare
Could you please check the translation again when this PR is ready from the draft? It's fine about 2 failing checks |
OK |
对不起,这个PR仍在进行中 |
oh, sorry. I read it wrong. |
b0e5218
to
12b74d7
Compare
19fe017
to
caf166c
Compare
b79e686
to
e5c62b5
Compare
0d4611b
to
58776d0
Compare
70% of the work has been done
|
27362ae
to
10c5393
Compare
d7b5e9f
to
6bc87db
Compare
2a40a5c
to
c234d50
Compare
The parser seems to erase class attributes. C = Class {x = Int;}
C.
x = 1 # no-linebreak $ cargo r -- --mode parse test.er
Finished dev [unoptimized + debuginfo] target(s) in 0.06s
Running `target\debug\erg.exe --mode parse test.er`
C =
::Class:
{::x =
::Int; }
$ |
2004433
to
b605216
Compare
This reverts commit 1979e95.
854366e
to
85bc213
Compare
I have finished writing the error messages, so if there are any translation errors or good translations in the Chinese ones please correct them, @C-BJ |
67d834a
to
68a27f8
Compare
Congrats & thank you so much! |
Currently, many of the errors in the parser use
simple_syntax_error
( orskip_and_throw_syntax_err
).This causes almost all errors to generate
invalid syntax error
, making them difficult to understand.This lets you know how
invalid syntax
is.In addition, add doc comment.
Changes proposed in this PR:
Define specify error
Use following errors
Internal error(parser bug)
It is a high possibility of the parser bug if it coccus
Invalid/unintended syntax error
Some sentences are written in Parser
They are not listed here
syntax error of parsing
invalid syntax
invalid syntax
semicolon or newline should be added
invalid syntax
failed to convert
from
toto
cannot define a variable at the end of a block
expect: ...
but found: ...
invalid syntax
invalid sequential elements declaration
only
var
ordef
can be used inrecord
different record type element declarations
expect: record
but found: ...
contents of data class are different
keyword is not specified
:=
should be addednon-default argument follows default argument
cannot declare type specified by Tuple type element
please specify the type
invalid type specification
add the
bracket
type
is not closed with thebracket
expect: method
but found: ...
Class methods should be defined
expect accessor
invalid syntax
expect: method, NatLit, attr, array
Minor adjustment
next_expr()
/line()
are used, put log!()@mtshiba