Skip to content

Commit 3dc9c17

Browse files
committed
feat: add nodiscard
1 parent b4a0ae9 commit 3dc9c17

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

esparser/src/tokenizer/Scanner.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ namespace jetpack {
2424
Scanner& operator=(Scanner&&) = delete;
2525

2626
struct ScannerState {
27+
public:
2728
uint32_t index_ = 0;
2829
uint32_t line_number_ = 0;
2930
uint32_t line_start_ = 0;
3031
};
3132

33+
[[nodiscard]]
3234
inline int32_t Length() const {
3335
return source_.size();
3436
}
@@ -118,15 +120,18 @@ namespace jetpack {
118120

119121
char32_t CodePointAt(uint32_t index, uint32_t* size_ = nullptr) const;
120122

123+
[[nodiscard]]
121124
inline char16_t CharAt(uint32_t index) const {
122125
if (unlikely(index >= source_.size())) return u'\0';
123126
return source_.at(index);
124127
}
125128

126-
[[nodiscard]] UString Source() const {
129+
[[nodiscard]]
130+
UString Source() const {
127131
return source_;
128132
}
129133

134+
[[nodiscard]]
130135
inline UString ValueBuffer() const {
131136
return value_buffer_;
132137
}

0 commit comments

Comments
 (0)