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

C Error: [ ';' expected (got "MessageError") ] #13484

Open
Sarund9 opened this issue Feb 15, 2022 · 1 comment
Open

C Error: [ ';' expected (got "MessageError") ] #13484

Sarund9 opened this issue Feb 15, 2022 · 1 comment
Labels
Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor.

Comments

@Sarund9
Copy link

Sarund9 commented Feb 15, 2022

V version: V 0.2.4 3ac4155
OS: Windows 10

What did you do?
I compiled from the VSCode terminal using v ., this is the project structure:

Root Folder
|- include
|  |- lexer
|     |- tokens.v
|- main.v

main:

module main

import include.lexer

fn main() {
	println("")
}

tokens:

module lexer

enum TkType {
	Err
	
	Name
	Comment
	StringLit
	NumLit
	NewLine

	// Brackets
	LeftBracket            	// {
	RightBracket            // }
	LeftParen               // (
	RightParen             	// )
	LeftSqBracket          	// [
	RightSqBracket	        // ]

	// Operator Characters
	Period                  // .
	Comma                   // ,
	Colon                   // :
	Semicolon               // ;
	EqualsSign              // =
	PlusSign                // +
	MinusSign               // -
	Asterisk                // *
	ForwardSlash            // /
	PercentSign             // %
	Ampersand               // &
	VerticalBar             // |
	Caret                   // ^
	Tilde                   // ~
	LessThanSign            // <
	GreaterThanSign         // >
	ExclamationSign         // !
	QuestionSign            // ?
	DollarSign              // $
	// HashSign             // # Unused, # is for Comments
	AtSign                  // @
	// Backslash            // \ Unsued, 

	// Compound Operators
	OpScopeClose 			// :>

	OpEquals			// ==
	OpNotEquals			// !=
	OpGreaterEquals			// >=
	OpLesserEquals			// <=
	OpAddEquals			// +=
	OpSubEquals			// -=
	OpMultEquals			// *=
	OpDivEquals			// /=
	OpModEquals			// %=
	OpXorEquals			// ^=

	OpLogicalOr			// ||
	OpLogicalAnd			// &&

}

struct Tok {
	ty TkType
	value any
}

fn tk_name(text string) Tok {
	return Tok { .Name, text }
}

What did you expect to see?
The code compiled, or throwing a Compilation Error

What did you see instead?
A Builder Error:
image

@Sarund9 Sarund9 added the Bug This tag is applied to issues which reports bugs. label Feb 15, 2022
@JalonSolov
Copy link
Contributor

Still failing with V 0.4.9 7d60ce0, only with a different error message:

/tmp/v_1000/foo.01JMNQQP7DHA6FCMX0DN4RCG5H.tmp.c:573: error: ';' expected (got "None__")

@JalonSolov JalonSolov added the Status: Confirmed This bug has been confirmed to be valid by a contributor. label Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor.
Projects
None yet
Development

No branches or pull requests

2 participants