-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sema: minor optimizations for symbol lookup
- Loading branch information
1 parent
55a3f9b
commit b3807a6
Showing
5 changed files
with
83 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2024 The Jule Programming Language. | ||
// Use of this source code is governed by a BSD 3-Clause | ||
// license that can be found in the LICENSE file. | ||
|
||
use utf8 for std::unicode::utf8 | ||
use unicode for std::unicode | ||
use nosafe for std::internal::nosafe | ||
|
||
// Reports whether identifier is public. | ||
fn IsPub(&ident: str): bool { | ||
if ident[0] < utf8::RuneSelf { // ASCII, fast way. | ||
let b = ident[0] | ||
ret 'A' <= b && b <= 'Z' | ||
} | ||
let (r, _) = utf8::DecodeRune(nosafe::Stobs(ident)) | ||
ret unicode::IsUpper(r) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters