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