Allow_identifiers_to_have_underscores
This commit is contained in:
parent
069c277516
commit
10d62eb1f7
@ -1,18 +1,18 @@
|
|||||||
|
|
||||||
extern fn puts(message: *str) -> i32;
|
extern fn puts(message: *str) -> i32;
|
||||||
|
|
||||||
struct DivT {
|
struct div_t {
|
||||||
quotient: i32,
|
quotient: i32,
|
||||||
remainder: i32,
|
remainder: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
extern fn div(numerator: i32, denominator: i32) -> DivT;
|
extern fn div(numerator: i32, denominator: i32) -> div_t;
|
||||||
|
|
||||||
pub fn print(message: *str) {
|
pub fn print(message: *str) {
|
||||||
puts(message);
|
puts(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn intdiv(numerator: i32, denominator: i32) -> DivT {
|
pub fn int_div(numerator: i32, denominator: i32) -> div_t {
|
||||||
return div(numerator, denominator);
|
return div(numerator, denominator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ pub fn tokenize<T: Into<String>>(to_tokenize: T) -> Result<Vec<FullToken>, Error
|
|||||||
c if c.is_alphabetic() => {
|
c if c.is_alphabetic() => {
|
||||||
let mut value = character.to_string();
|
let mut value = character.to_string();
|
||||||
while let Some(c) = cursor.first() {
|
while let Some(c) = cursor.first() {
|
||||||
if !c.is_ascii_alphanumeric() {
|
if !(c.is_ascii_alphanumeric() || c == '_') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
value += &c.to_string();
|
value += &c.to_string();
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
|
|
||||||
import std::print;
|
import std::print;
|
||||||
import std::intdiv;
|
import std::int_div;
|
||||||
|
|
||||||
fn main() -> i32 {
|
fn main() -> i32 {
|
||||||
let hello = "hello world";
|
let hello = "hello world";
|
||||||
|
|
||||||
print(hello);
|
print(hello);
|
||||||
|
|
||||||
return intdiv(15, 5).quotient;
|
return int_div(15, 5).quotient;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user