-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from rycont/rollback-function-invoke-syntax
Rollback function invoke syntax
- Loading branch information
Showing
14 changed files
with
121 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"@vue/runtime-dom": "npm:@vue/runtime-dom@^3.5.12", | ||
"@vueuse/core": "npm:@vueuse/core@^11.2.0", | ||
"ansi-to-html": "npm:ansi-to-html@^0.7.2", | ||
"assert": "https://deno.land/[email protected]/assert/mod.ts", | ||
"assert": "jsr:@std/assert", | ||
"quickjs-emscripten": "npm:quickjs-emscripten@^0.31.0", | ||
"quickjs-emscripten-core": "npm:quickjs-emscripten-core@^0.31.0", | ||
"typedoc": "npm:[email protected]", | ||
|
@@ -34,7 +34,7 @@ | |
} | ||
}, | ||
"name": "@yaksok-ts/core", | ||
"version": "0.1.12", | ||
"version": "0.1.13", | ||
"exports": "./src/index.ts", | ||
"nodeModulesDir": "auto" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,31 +1,22 @@ | ||
import { QuickJS, yaksok } from './src/index.ts' | ||
|
||
const quickJS = new QuickJS({ | ||
prompt: () => { | ||
return '10' | ||
}, | ||
}) | ||
|
||
await quickJS.init() | ||
import { yaksok } from './src/index.ts' | ||
|
||
yaksok( | ||
` | ||
번역(QuickJS), 에러 발생 | ||
*** | ||
return ("ㅁㄴㅇㄹ" as string) */ 10 | ||
*** | ||
약속, (음식)을/를 (사람)와/과 먹기 | ||
"맛있는 " + 음식 + ", " + 사람 + "의 입으로 모두 들어갑니다." 보여주기 | ||
에러 발생 | ||
`, | ||
{ | ||
runFFI(_, code, args) { | ||
const result = quickJS.run(code, args) | ||
|
||
if (!result) { | ||
throw new Error('Result is null') | ||
} | ||
"피자"를 "철수"와 먹기 | ||
"햄버거"를 "영희"와 먹기 | ||
"치킨"을 "형님"과 먹기 | ||
"초밥"을 "동생"과 먹기 | ||
return result | ||
("피자")를 ("철수")와 먹기 | ||
("햄버거")를 ("영희")와 먹기 | ||
("치킨")을 ("형님")과 먹기 | ||
("초밥")을 ("동생")과 먹기`, | ||
{ | ||
flags: { | ||
'future-function-invoke-syntax': false, | ||
}, | ||
}, | ||
) |
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,5 @@ | ||
export enum FEATURE_FLAG { | ||
FUTURE_FUNCTION_INVOKE_SYNTAX = 'future-function-invoke-syntax', | ||
} | ||
|
||
export type EnabledFlags = Partial<Record<FEATURE_FLAG, boolean>> |
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
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,5 +1,5 @@ | ||
약속, 키 (키) 몸무게 (몸무게)의 비만도 | ||
결과: 몸무게 / (키 / 100 * 키 / 100) | ||
|
||
비만도: 키 (177) 몸무게 (68)의 비만도 | ||
비만도: 키 177 몸무게 68 의 비만도 | ||
비만도 보여주기 |
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 @@ | ||
약속, (음식)을/를 (사람)와/과 먹기 | ||
"맛있는 " + 음식 + ", " + 사람 + "의 입으로 모두 들어갑니다." 보여주기 | ||
|
||
("피자")를 ("철수")와 먹기 | ||
("햄버거")를 ("영희")와 먹기 | ||
("치킨")을 ("형님")과 먹기 | ||
("초밥")을 ("동생")과 먹기 | ||
"피자"를 "철수"와 먹기 | ||
"햄버거"를 "영희"와 먹기 | ||
"치킨"을 "형님"과 먹기 | ||
"초밥"을 "동생"과 먹기 |
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 |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
막대1 + " -> " + 막대3 보여주기 | ||
하노이 (개수-1) (막대2) (막대1) (막대3) 이동 | ||
|
||
하노이 (3) ("A") ("B") ("C") 이동 | ||
하노이 3 "A" "B" "C" 이동 |
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,23 @@ | ||
import { equal } from 'assert' | ||
import { yaksok } from '../src/index.ts' | ||
|
||
Deno.test('미래의 약속 호출 문법', () => { | ||
let output = '' | ||
|
||
yaksok( | ||
`약속, (A)와 (B)를 더하기 | ||
결과: A + B | ||
(4)와 (5)를 더하기 보여주기`, | ||
{ | ||
flags: { | ||
'future-function-invoke-syntax': true, | ||
}, | ||
stdout(value) { | ||
output += value + '\n' | ||
}, | ||
}, | ||
) | ||
|
||
equal(output, '9\n') | ||
}) |
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