Skip to content

Commit e028034

Browse files
Provide c++ operators definition (talonhub#1974)
We can just use the c operators. I wanted to work on c++ support one feature at a time as the larger pull requests adding support for the entire language in one go seem to consistently lose momentum. It is worth discussing if we should put support for the language in a separate file. I personally think so to improve organization. We can use talon constructs and importing to reuse relevant pieces of the c implementation anyways. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent fd51cb9 commit e028034

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

lang/cpp/cpp.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from talon import Context, Module
2+
3+
from ..c.c import operators
4+
from ..tags.operators import Operators
5+
6+
ctx = Context()
7+
8+
ctx.matches = r"""
9+
code.language: cpp
10+
"""
11+
12+
13+
@ctx.action_class("user")
14+
class UserActions:
15+
def code_get_operators() -> Operators:
16+
return operators

lang/cpp/cpp.talon

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
code.language: cpp
2+
-
3+
4+
tag(): user.code_operators_array
5+
tag(): user.code_operators_assignment
6+
tag(): user.code_operators_bitwise
7+
tag(): user.code_operators_math
8+
tag(): user.code_operators_pointer

0 commit comments

Comments
 (0)