Closed ElBe-Plaq closed 1 year ago
Branch issue-43 created!
After rewriting the identifier
rule, development can continue
Currently doing filtering stuff, just to give you an update,
I will take a look at https://learning-rust.github.io/docs/custom-error-types/ for the error rewrite.
I have decided not to use the pest provided pairs, but to make my own token struct and convert the pest types.
When running the parser with the input var x=1\n
the output is
[
Token {
token_type: Mark(
Assignment,
),
content: "var x=1",
inner: Some(
[
Token {
token_type: Mark(
Variable,
),
content: "var",
inner: None,
position: Position {
line: 1,
colon: 1,
},
},
Token {
token_type: Identifier,
content: "x",
inner: None,
position: Position {
line: 1,
colon: 5,
},
},
Token {
token_type: TypeDefinition(
Integer,
),
content: "1",
inner: Some(
[
Token {
token_type: TypeDefinition(
IntegerSign,
),
content: "",
inner: None,
position: Position {
line: 1,
colon: 7,
},
},
Token {
token_type: TypeDefinition(
Integer,
),
content: "1",
inner: None,
position: Position {
line: 1,
colon: 7,
},
},
],
),
position: Position {
line: 1,
colon: 7,
},
},
],
),
position: Position {
line: 1,
colon: 1,
},
},
]
This issue is now being used for multiple improvements, such as working on the parser or adding translations.
I will add a pratt parser and more grammar in the future.
Describe the solution you'd like Add pest grammar.
Describe alternatives you've considered BNF, EBNF or ABNF grammar.
Additional context Pest needs to be added to the dependency list.
This issue is now being used to track other changes as well.