Implemented struct parser

This commit is contained in:
2025-02-04 14:41:04 +01:00
parent fc1b970f7f
commit 51e3c1ba0e
19 changed files with 388 additions and 252 deletions

View File

@ -0,0 +1 @@
struct{}

View File

@ -0,0 +1,3 @@
main() {
"Hello"
}

View File

@ -0,0 +1 @@
+

View File

@ -16,14 +16,17 @@ var errs = []struct {
}{
{"EmptySwitch.q", errors.EmptySwitch},
{"ExpectedFunctionDefinition.q", errors.ExpectedFunctionDefinition},
{"ExpectedFunctionName.q", errors.ExpectedFunctionName},
{"ExpectedFunctionName2.q", errors.ExpectedFunctionName},
{"ExpectedFunctionParameters.q", errors.ExpectedFunctionParameters},
{"ExpectedIfBeforeElse.q", errors.ExpectedIfBeforeElse},
{"ExpectedIfBeforeElse2.q", errors.ExpectedIfBeforeElse},
{"ExpectedStructName.q", errors.ExpectedStructName},
{"InvalidInstructionExpression.q", &errors.InvalidInstruction{Instruction: "+"}},
{"InvalidInstructionIdentifier.q", &errors.InvalidInstruction{Instruction: "abc"}},
{"InvalidInstructionNumber.q", &errors.InvalidInstruction{Instruction: "123"}},
{"InvalidInstructionExpression.q", &errors.InvalidInstruction{Instruction: "+"}},
{"InvalidInstructionString.q", &errors.InvalidInstruction{Instruction: "\"Hello\""}},
{"InvalidInstructionTopLevel.q", &errors.InvalidInstruction{Instruction: "123"}},
{"InvalidInstructionTopLevel2.q", &errors.InvalidInstruction{Instruction: "\"Hello\""}},
{"InvalidInstructionTopLevel3.q", &errors.InvalidInstruction{Instruction: "+"}},
{"InvalidExpression.q", errors.InvalidExpression},
{"InvalidCharacter.q", &errors.InvalidCharacter{Character: "@"}},
{"InvalidCharacter2.q", &errors.InvalidCharacter{Character: "@"}},