Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
nikeedev committed Dec 6, 2023
1 parent 4536e54 commit d2f2ba3
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 13 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/rain-lang.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@ fn main() {
let tokens = lexer.tokens;

for token in tokens {
println!("{:#?}", token);
// println!("{:#?}", token);
}

// let idents: Vec<Token> = lexer.idents;
let idents = lexer.idents;

// for ident in &idents {
// println!("{:#?}", ident);
// }
for ident in &idents {
println!("{:#?}", ident);
}

// lex(src_raw)
}
19 changes: 12 additions & 7 deletions src/rain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ pub enum TokenType {
Comment, // //
String { is_terminated: bool },

Dot, // for getting variables and functions out of structs or,
// defining a float
Dot, // 0.0f (floats), struct.name (for getting properties or doing function calls from something)
Function, // () {}
Ident, // x : =
If,
Else,
For,
If, // if
Else, // else / else if
For, // for

Plus, // +
Minus, // -
Expand Down Expand Up @@ -172,12 +171,18 @@ impl<'a> Lexer<'a> {
',' => TokenType::Comma,

'>' => match self.peek() {
'=' => TokenType::EqualsGreaterThan, // >=
'=' => {
self.bump();
TokenType::EqualsGreaterThan // >=
},
_ => TokenType::GreaterThan, // >
},

'<' => match self.peek() {
'=' => TokenType::EqualsLessThan, // <=
'=' => {
self.bump();
TokenType::EqualsLessThan // <=
},
_ => TokenType::LessThan, // <
},

Expand Down

0 comments on commit d2f2ba3

Please sign in to comment.