Skip to content

Commit

Permalink
allow letters after underscore in variables, eg. x_a
Browse files Browse the repository at this point in the history
  • Loading branch information
PaddiM8 committed Dec 9, 2020
1 parent ea236f7 commit 8e3016e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion kalk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kalk"
version = "0.2.1"
version = "0.2.2"
authors = ["PaddiM8"]
edition = "2018"
readme = "README.md"
Expand Down
4 changes: 2 additions & 2 deletions kalk/src/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ impl<'a> Lexer<'a> {
while is_valid_identifier(self.peek()) {
let c = *self.peek().unwrap();

// If the current character is an underscore, expect a number next.
// If the current character is an underscore, allow a number next.
// This is to allow the notation like the following: x_1
if c == '_' {
self.advance();
let num = self.next_number_literal().value;
let num = self.next().value;
value.push('_');
value.push_str(&num.trim_end()); // Trim, since the number_literal function allows whitespace, which identifiers should not contain.
break;
Expand Down
4 changes: 2 additions & 2 deletions kalk_cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kalk_cli"
version = "0.2.1"
version = "0.2.2"
authors = ["PaddiM8"]
edition = "2018"
readme = "../README.md"
Expand All @@ -15,7 +15,7 @@ path = "src/main.rs"
name = "kalk"

[dependencies]
kalk = { path = "../kalk", version = "^0.2.1" }
kalk = { path = "../kalk", version = "^0.2.2" }
rustyline = "6.1.2"
ansi_term = "0.12"
regex = "1"
Expand Down

0 comments on commit 8e3016e

Please sign in to comment.