mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
v.util, v.parser: inline some commonly used fns (#23535)
This commit is contained in:
parent
4800a609f6
commit
facee322fc
2 changed files with 4 additions and 0 deletions
|
@ -3536,6 +3536,7 @@ fn (mut p Parser) parse_concrete_types() []ast.Type {
|
|||
}
|
||||
|
||||
// is_generic_name returns true if the current token is a generic name.
|
||||
@[inline]
|
||||
fn (p &Parser) is_generic_name() bool {
|
||||
return p.tok.kind == .name && util.is_generic_type_name(p.tok.lit)
|
||||
}
|
||||
|
|
|
@ -572,14 +572,17 @@ pub fn ensure_modules_for_all_tools_are_installed(is_verbose bool) {
|
|||
}
|
||||
}
|
||||
|
||||
@[inline]
|
||||
pub fn strip_mod_name(name string) string {
|
||||
return name.all_after_last('.')
|
||||
}
|
||||
|
||||
@[inline]
|
||||
pub fn strip_main_name(name string) string {
|
||||
return name.replace('main.', '')
|
||||
}
|
||||
|
||||
@[inline]
|
||||
pub fn no_dots(s string) string {
|
||||
return s.replace('.', '__')
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue