-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nixd/Syntax: basic parsing, with the test
- Loading branch information
Showing
13 changed files
with
353 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
|
||
#include "Parser/Require.h" | ||
|
||
namespace nixd::syntax { | ||
void parse(char *Text, size_t Size, ParseData *Data); | ||
} // namespace nixd::syntax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
libnixdASTDeps = [ nixd_lsp_server | ||
, nix_all | ||
, nixdExpr | ||
, nixdParser | ||
, nixdSyntax | ||
, nixdNix | ||
, llvm | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
|
||
#include "Parser.tab.h" | ||
|
||
#include "Lexer.tab.h" | ||
|
||
#include "nixd/Syntax/Parser.h" | ||
#include "nixd/Syntax/Parser/Require.h" | ||
|
||
namespace nixd::syntax { | ||
|
||
void parse(char *Text, size_t Size, ParseData *Data) { | ||
yyscan_t Scanner; | ||
yylex_init(&Scanner); | ||
yy_scan_buffer(Text, Size, Scanner); | ||
yyparse(Scanner, Data); | ||
yylex_destroy(Scanner); | ||
} | ||
|
||
} // namespace nixd::syntax |
Oops, something went wrong.