Age | Commit message (Collapse) | Author |
|
|
|
Previously, the names of declarations where stored as a simple
StringView.
Because of that, we couldn't parse out-of-line function definitions,
which have qualified names.
For example, we couldn't parse the following snippet:
```
void MyClass::foo(){}
```
To fix this, we now store the name of a declaration with a
ASTNode::Name node, which represents a qualified named.
|
|
Previously, Declaration::is_member() was just a stub that always
returned false.
It now works by checking whether the parent ASTNode is a declaration
of a struct or a class type.
|
|
|
|
This makes it work with types like `Function<T(U, V)>`.
|
|
|
|
|
|
Thanks to @alimpfard for suggesting this :)
|
|
Previously almost all fields were public and were directly accessed by
the Parser and CppComprehensionEngine.
This commit makes all fields of AST node types private. They are now
accessed via getters & setters.
|
|
This function returns the tokens that exist in the specified range.
|
|
This adds a new ASTNode type called 'NamedType' which inherits from
the Type node.
Previously every Type node had a name field, but it was not logically
accurate. For example, pointer types do not have a name
(the pointed-to type may have one).
|
|
|
|
|
|
Previously, we had a special ASTNode for class members,
"MemberDeclaration", which only represented fields.
This commit removes MemberDeclaration and instead uses regular
Declaration nodes for representing the members of a class.
This means that we can now also parse methods, inner-classes, and other
declarations that appear inside of a class.
|
|
|
|
Previously, ASTNode::dump() used outln() for output, which meant it
always wrote its output to stdout.
After this commit, ASTNode::dump() receives an 'output' argument (which
is stdout by default). This enables writing the output to somewhere
else.
This will be useful for testing the LibCpp Parser with the output of
ASTNode::dump.
|
|
|
|
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
|
|
|
|
|
|
This type represents templatized names, and replaces our previous use
of 'TemplatizedType' and 'TemplatizedFunctionCall'.
Also, we now parse function calls as secondary expressions.
|
|
This allows us to use pase_* methods inside match_* methods,
without adding any actual AST nodes to the m_nodes list.
|
|
|
|
|
|
|
|
|
|
|
|
parse static_cast, reinterpret_cast, dynamic_cast & const_cast
|
|
|
|
|
|
A Name node is basically an identifier with an optional scope,
e.g Core::File.
|
|
We can now parse things like Vector<int>
|
|
|
|
|
|
|
|
|
|
Also, remove unused State::Context
|
|
It was previously implemented by directly iterating over the program's
source.
|
|
We can now parse the printf function declaration :^)
|
|
|
|
The Locator now keeps a cache of the declared symbol in a document.
The language client updates that cache whenever it gets an update from
the language server about declared symbols.
This allows searching for symbol declarations in the Locator, in
addition to file names.
Closes #5478
|
|
As a document is parsed, the language server updates the client
asynchronously about symbol declarations it finds.
|
|
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)
Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.
We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
|
|
As part of the position information, we now also store the filename the
ASTNode belongs to.
|
|
|
|
|
|
Arbitrarily split up to make git bisect easier.
These unnecessary #include's were found by combining an automated tool (which
determined likely candidates) and some brain power (which decided whether
the #include is also semantically superfluous).
My favorite #include:
#include "Applications/Piano/Music.h" // You can't have too much music in life!
|
|
This parser will be used by the C++ langauge server to provide better
auto-complete (& maybe also other things in the future).
It is designed to be error tolerant, and keeps track of the position
spans of the AST nodes, which should be useful later for incremental
parsing.
|