Skip to content

Commit

Permalink
feat: add Microsoft's SEH extension
Browse files Browse the repository at this point in the history
Co-authored-by: Denny Sun <[email protected]>
  • Loading branch information
DennySun2100 and DennySun2020 authored Oct 16, 2023
1 parent 0d33f04 commit 25371f9
Show file tree
Hide file tree
Showing 5 changed files with 70,249 additions and 65,283 deletions.
23 changes: 23 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@ module.exports = grammar({
$.break_statement,
$.continue_statement,
$.goto_statement,
$.seh_try_statement,
$.seh_leave_statement,
),

_top_level_statement: $ => choice(
Expand Down Expand Up @@ -823,6 +825,27 @@ module.exports = grammar({
';',
),

seh_try_statement: $ => seq(
'__try',
field('body', $.compound_statement),
choice($.seh_except_clause, $.seh_finally_clause),
),

seh_except_clause: $ => seq(
'__except',
field('filter', $.parenthesized_expression),
field('body', $.compound_statement),
),

seh_finally_clause: $ => seq(
'__finally',
field('body', $.compound_statement),
),

seh_leave_statement: _ => seq(
'__leave', ';',
),

// Expressions

_expression: $ => choice(
Expand Down
93 changes: 93 additions & 0 deletions src/grammar.json

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

109 changes: 109 additions & 0 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 25371f9

Please sign in to comment.