Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Goto definition #30

Merged
merged 17 commits into from
Apr 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
clarify docs
  • Loading branch information
nolanderc committed Apr 20, 2023
commit 0ebd8015bc5a43ab3d7c9f3110b1f2ad1f91383e
7 changes: 5 additions & 2 deletions src/symbols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,12 @@ bool is_whitespace(char c) {
return c == ' ' || c == '\t' || c == '\n';
}

/// Extracts all symbols from the given string, and inserts them into the symbol map.
/// Extracts all global symbols from the given string, and inserts them into the symbol map.
/// This will not register symbols within function bodies, as they are context dependent.
///
/// The current implementation is very naive and may not handle certain cases that well.
/// The current implementation uses naive heuristics and thus may not handle
/// certain cases that well, and also give wrong results. This should be
/// replaced with an actual parser, but is workable for now.
void extract_symbols(const char* text, SymbolMap& symbols) {
std::vector<Word> words;
int arguments = 0;
Expand Down