Age | Commit message (Collapse) | Author |
|
|
|
This was caught by SonarCloud.
|
|
|
|
SonarCloud flagged this 'Identical sub-expressions on both sides of
operator "||"'. When looking at the git history it looks like it was
just a copy / paste mistake that happened when Token::Type::Arrow
support was added.
|
|
After this change, the parser is completely separated from preprocessor
concepts.
|
|
When the preprocessor encounters an #include statement it now adds
the preprocessor definitions that exist in the included header to its
own set of definitions.
We previously only aggregated the definitions from headers after
processing the source, which was less correct. (For example, there
could be an #ifdef that depends on a definition from another header).
|
|
We now call Preprocessor::process_and_lex() and pass the result to the
parser.
Doing the lexing in the preprocessor will allow us to maintain the
original position information of tokens after substituting definitions.
|
|
|
|
Now LibCpp can understand the eastest of consts too :^)
|
|
This is just ignored right now.
|
|
This makes it work with types like `Function<T(U, V)>`.
|
|
This is too lax for functions that aren't class members, but let's
allow that anyway.
|
|
|
|
|
|
|
|
|
|
Note that this is not the `extern "C"` declarations, just extern decl
qualifiers.
|
|
For instance, `Type Scope::Class::variable = value;` is a valid
declaration.
|
|
We previously stored the entire ASTNode vector in each parser state,
and this vector was copied whenever a state was loaded or saved.
We don't actually need to store the whole nodes list in each state
because a new state can only add new nodes to this list, and won't
mutate existing nodes.
It would suffice to only hold a vector of the nodes that were created
while parsing in the current state to keep a reference to them.
This reduces the time it takes on my machine for the c++ language
server to handle a file that #includes <LibGUI/Widget.h> from ~4sec to
~0.7sec.
|
|
There's no need to store parser error messages for states with
depth > 0, as they will eventually be popped from the states stack and
their error messages will never be displayed to the user.
Profiling shows that this change reduces the % of backtraces that
contain the store_state & load_state functions from ~95% to ~70%.
Empirically this change reduces the time it takes on my machine for the
c++ language server to handle a file that #includes <LibGUI/Widget.h>
from ~14sec to ~4sec.
|
|
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.
|
|
|
|
Previously the positional information for the node of an ellipsis was
incorrect.
|
|
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).
|
|
LOG_SCOPE() uses ScopeLogger and additionally shows the current token
in the parser's state.
|
|
|
|
Now you can click a TODO entry to set focus on that position of that
file.
|
|
Now `get_todo_entries` collects all TODO found within a comment
statement.
|
|
|
|
We can now handle access-specifier tags (for example 'private:') when
parsing class declarations.
We currently only consume these tags on move on. We'll need to add some
logic that accounts for the access level of symbols down the road.
|
|
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.
|
|
Token::to_string() now includes not only the token's type, but also its
text and span in the document.
|
|
match_expression() will now return true if there's a match for a Name
node.
|
|
|
|
A Name node can now have a non-empty scope and a null name.
For example, "AK::" has a non-empty scope and a null name component.
|
|
After this commit, Parser::index_of_node_at will prefer to return nodes
with greater indices.
Since the parsing logic ensures that child nodes come after parent
nodes, this change makes this function return child nodes when possible.
|
|
|
|
What happens if one file defines DEBUG_SPAM, and another doesn't,
then we link them together and get ODR violations? -- @ADKaster
|
|
|
|
Utilize AK::SourceLocation to get function information into
the scope logger, instead of relying on pre-processor macros.
|
|
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.
|
|
|
|
|
|
|
|
|