Skip to content

Commit

Permalink
Merge branch 'hchunhui:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
shewer authored Jun 6, 2022
2 parents 590d3d5 + 9e141b9 commit c219707
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 74 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on: [push, pull_request]

jobs:
macos:
uses: rime/librime/.github/workflows/macos-build.yml@master
with:
repository: rime/librime
rime_plugins: ${{ github.repository }}@${{ github.ref_name }}

windows:
uses: rime/librime/.github/workflows/windows-build.yml@master
with:
repository: rime/librime
rime_plugins: ${{ github.repository }}@${{ github.ref_name }}
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# librime-lua: Extending [RIME](https://rime.im) with Lua scripts

[![Build status](https://ci.appveyor.com/api/projects/status/github/hchunhui/librime-lua?svg=true)](https://ci.appveyor.com/project/hchunhui/librime-lua)

Features
===
- Supports extending RIME processors, segmentors, translators and filters
Expand Down Expand Up @@ -66,12 +64,6 @@ Build dependencies
- librime >= 1.5.0
- LuaJIT 2 / Lua 5.1 / Lua 5.2 / Lua 5.3 / Lua 5.4
Prebuilt versions
---
- Windows
- [1.4.0 backport](/~https://github.com/hchunhui/librime-lua/releases)
- [master](https://ci.appveyor.com/project/hchunhui/librime-lua/build/artifacts)
Instructions
---
1. Prepare source code
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion appveyor.install.bat → action-install.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
git clone /~https://github.com/hchunhui/librime-lua.git -b thirdparty --depth=1 %plugin_dir%\thirdparty
git clone /~https://github.com/hchunhui/librime-lua.git -b thirdparty --depth=1 thirdparty
5 changes: 0 additions & 5 deletions appveyor.rime-install.bat

This file was deleted.

53 changes: 0 additions & 53 deletions appveyor.yml

This file was deleted.

17 changes: 10 additions & 7 deletions src/lib/lua_templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,8 @@ struct LuaWrapper<S(*)(T...), f> {
};

// MemberWrapper: R (C::*)(T..) -> R (C &, T...)
// MemberWrapper(get variable): R (C::*) -> R (C &)
// MemberWrapper(set variable): R (C::*) -> void (C &, R)
// MemberWrapperV(get variable): R (C::*) -> R (C &)
// MemberWrapperV(set variable): R (C::*) -> void (C &, R)
template<typename F, F f>
struct MemberWrapper;

Expand All @@ -590,8 +590,11 @@ struct MemberWrapper<R (C::*)(T...) const, f> {
}
};

template<typename F, F f>
struct MemberWrapperV;

template<typename R, typename C, R C::*f>
struct MemberWrapper<R (C::*), f> {
struct MemberWrapperV<R (C::*), f> {
static R wrap_get(const C &c) {
return c.*f;
}
Expand All @@ -604,9 +607,9 @@ struct MemberWrapper<R (C::*), f> {
#define WRAP(f) (&(LuaWrapper<decltype(&f), &f>::wrap))
#define WRAPMEM(f) (&(LuaWrapper<decltype(&MemberWrapper<decltype(&f), &f>::wrap), \
&MemberWrapper<decltype(&f), &f>::wrap>::wrap))
#define WRAPMEM_GET(f) (&(LuaWrapper<decltype(&MemberWrapper<decltype(&f), &f>::wrap_get), \
&MemberWrapper<decltype(&f), &f>::wrap_get>::wrap))
#define WRAPMEM_SET(f) (&(LuaWrapper<decltype(&MemberWrapper<decltype(&f), &f>::wrap_set), \
&MemberWrapper<decltype(&f), &f>::wrap_set>::wrap))
#define WRAPMEM_GET(f) (&(LuaWrapper<decltype(&MemberWrapperV<decltype(&f), &f>::wrap_get), \
&MemberWrapperV<decltype(&f), &f>::wrap_get>::wrap))
#define WRAPMEM_SET(f) (&(LuaWrapper<decltype(&MemberWrapperV<decltype(&f), &f>::wrap_set), \
&MemberWrapperV<decltype(&f), &f>::wrap_set>::wrap))

#endif /* LIB_LUA_TEMPLATES_H_ */

0 comments on commit c219707

Please sign in to comment.