Age | Commit message (Collapse) | Author |
|
|
|
|
|
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.
|
|
|
|
And use them to highlight javascript in HTML source.
This commit also changes how TextDocumentSpan::data is interpreted,
as it used to be an opaque pointer, but everyone stuffed an enum value
inside it, which made the values not unique to each highlighter;
that field is now a u64 serial id.
The syntax highlighters don't need to change their ways of stuffing
token types into that field, but a highlighter that calls another
nested highlighter needs to register the nested types for use with
token pairs.
|
|
This changes the C++ SyntaxHighlighter to conform to the now-fixed
rendering of syntax highlighting spans in GUI::TextEditor.
Contrary to other syntax highlighters, for this one the change has been
made to the SyntaxHighlighter rather than the Lexer. This is due to the
fact that the Parser also uses the same Lexer. I'm soure there is some
more elegant way to do this, but this patch at least unbreaks the C++
syntax highlighting.
|
|
If an include statement didn't contain whitespace between the word
"include" and the '<' or '"', the lexer would previous emit an empty
whitespace token. This has been changed now.
|
|
|
|
|
|
Since the purpose of this file is just to verify the AST generated,
we can leave it alone.
|
|
Also convert outln(stderr, ...) to warnln(...)
|
|
... in FunctionDeclaration::declarations()
|
|
|
|
This also moves most of the logic that was in handle_preprocessor_line
into handle_preprocessor_keyword.
|
|
Token::to_string() now includes not only the token's type, but also its
text and span in the document.
|
|
For each .cpp file in the test suite data, there is a .ast file that
represents the "known good" baseline of the parser result.
Each .cpp file goes through the parser, and the result of
invoking `ASTNode::dump()` on the root node is compared to the
baseline to find regressions.
We also check that there were no parser errors when parsing the .cpp
files.
|
|
|
|
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.
|
|
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.
|
|
This makes it more symmetrical with adopt_own() (which is used to
create a NonnullOwnPtr from the result of a naked new.)
|
|
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>
|
|
|