Skip to content

Commit

Permalink
Merge branch 'feature/line_block_comments' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jpt13653903 committed Jun 29, 2024
2 parents 767d696 + 9731625 commit a88a017
Show file tree
Hide file tree
Showing 14 changed files with 38,941 additions and 31,184 deletions.
6 changes: 4 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ module.exports = grammar({
$.string_literal_std_logic,
$.bit_string_literal,
$.operator_symbol,
$.comment,
$.line_comment,
$.block_comment,

$.token_end_marker, // Scanner internal use only

Expand Down Expand Up @@ -189,7 +190,8 @@ module.exports = grammar({
],

extras: $ => [
$.comment,
$.line_comment,
$.block_comment,
$._tool_directive,
/\s+/
],
Expand Down
3 changes: 2 additions & 1 deletion queries/Helix/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@
; gutter - gutter indicator
; ------------------------------------------------------------------------------

(comment) @comment
(line_comment) @comment.line
(block_comment) @comment.block
(identifier) @variable

[
Expand Down
4 changes: 3 additions & 1 deletion queries/Neovim/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@
; @tag.delimiter XML-style tag delimiters
; ------------------------------------------------------------------------------

(comment) @comment @spell
(line_comment) @comment @spell
(block_comment) @comment @spell

(identifier) @variable

[
Expand Down
14 changes: 8 additions & 6 deletions src/TokenType.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ typedef enum TokenTypeTag{
TOKEN_STRING_LITERAL_STD_LOGIC,
TOKEN_BIT_STRING_LITERAL,
TOKEN_OPERATOR_SYMBOL,
TOKEN_COMMENT,
TOKEN_LINE_COMMENT,
TOKEN_BLOCK_COMMENT,

TOKEN_END_MARKER, // Internal use only

Expand Down Expand Up @@ -179,8 +180,8 @@ typedef enum TokenTypeTag{
ERROR_SENTINEL,

// For internal use only...
COMMENT_LINE_START,
COMMENT_BLOCK_START,
LINE_COMMENT_START,
BLOCK_COMMENT_START,

STRING_LITERAL_STD_LOGIC_START,

Expand Down Expand Up @@ -349,7 +350,8 @@ bool is_base_specifier (TokenType type);
case TOKEN_STRING_LITERAL_STD_LOGIC: return "TOKEN_STRING_LITERAL_STD_LOGIC";
case TOKEN_BIT_STRING_LITERAL: return "TOKEN_BIT_STRING_LITERAL";
case TOKEN_OPERATOR_SYMBOL: return "TOKEN_OPERATOR_SYMBOL";
case TOKEN_COMMENT: return "TOKEN_COMMENT";
case TOKEN_LINE_COMMENT: return "TOKEN_LINE_COMMENT";
case TOKEN_BLOCK_COMMENT: return "TOKEN_BLOCK_COMMENT";

case TOKEN_END_MARKER: return "TOKEN_END_MARKER";

Expand Down Expand Up @@ -380,8 +382,8 @@ bool is_base_specifier (TokenType type);

case ERROR_SENTINEL: return "ERROR_SENTINEL";

case COMMENT_LINE_START: return "COMMENT_LINE_START";
case COMMENT_BLOCK_START: return "COMMENT_BLOCK_START";
case LINE_COMMENT_START: return "LINE_COMMENT_START";
case BLOCK_COMMENT_START: return "BLOCK_COMMENT_START";

case STRING_LITERAL_STD_LOGIC_START: return "STRING_LITERAL_STD_LOGIC_START";

Expand Down
4 changes: 2 additions & 2 deletions src/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ static void register_delimiters(TokenTree* token_tree)
// token_tree_insert(token_tree, "<<", DELIMITER_DOUBLE_LESS_THAN);
// token_tree_insert(token_tree, ">>", DELIMITER_DOUBLE_GREATER_THAN);

token_tree_insert(token_tree, "--", COMMENT_LINE_START);
token_tree_insert(token_tree, "/*", COMMENT_BLOCK_START);
token_tree_insert(token_tree, "--", LINE_COMMENT_START);
token_tree_insert(token_tree, "/*", BLOCK_COMMENT_START);
}
//------------------------------------------------------------------------------

Expand Down
12 changes: 10 additions & 2 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a88a017

Please sign in to comment.