Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(askscript): allow else if construct #459

Merged
merged 42 commits into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0fbcd27
build(deps-dev): bump @jest/environment from 26.1.0 to 26.2.0 (#425)
dependabot[bot] Aug 3, 2020
bccdc43
build(deps-dev): bump expect from 26.1.0 to 26.2.0 (#427)
dependabot[bot] Aug 3, 2020
d876330
build(deps-dev): bump @types/node from 14.0.26 to 14.0.27 (#429)
dependabot[bot] Aug 3, 2020
aa586b4
build(deps-dev): bump nanoid from 3.1.10 to 3.1.12 (#430)
dependabot[bot] Aug 3, 2020
de18517
build(deps-dev): bump webpack from 4.44.0 to 4.44.1 (#432)
dependabot[bot] Aug 3, 2020
590e4b0
build(deps-dev): bump @types/cors from 2.8.6 to 2.8.7 (#433)
dependabot[bot] Aug 3, 2020
a45ba05
build(deps-dev): bump @jest/types from 26.1.0 to 26.2.0 (#426)
dependabot[bot] Aug 4, 2020
beb49c5
build(deps-dev): bump @babel/preset-env from 7.10.4 to 7.11.0 (#428)
dependabot[bot] Aug 4, 2020
47e28b1
chore: remove npm-watch (#438)
km4 Aug 10, 2020
f434ac6
build(deps-dev): bump jest from 26.1.0 to 26.2.2 (#431)
dependabot[bot] Aug 10, 2020
29ed707
feat(askvm): toInt (#408)
RichardM99 Aug 10, 2020
1828947
feat: implement mod resource (#250) (#437)
bhargav-khalasi Aug 10, 2020
e865776
build(deps-dev): bump @typescript-eslint/eslint-plugin (#440)
dependabot[bot] Aug 10, 2020
35a0a5d
build(deps-dev): bump @types/jest from 26.0.3 to 26.0.9 (#444)
dependabot[bot] Aug 10, 2020
d3d4dc4
build(deps-dev): bump @babel/core from 7.10.5 to 7.11.1 (#445)
dependabot[bot] Aug 10, 2020
de44d15
build(deps-dev): bump eslint from 7.5.0 to 7.6.0 (#443)
dependabot[bot] Aug 10, 2020
d1b60d6
build(deps-dev): bump @typescript-eslint/parser from 3.7.0 to 3.8.0 (…
dependabot[bot] Aug 10, 2020
db2fe91
build(deps-dev): bump @types/lodash from 4.14.158 to 4.14.159 (#441)
dependabot[bot] Aug 10, 2020
47460eb
feat(cli): add welcome message (#446)
czerwinskilukasz1 Aug 11, 2020
664f27f
feat(askscript): add grammer to support "else if" key word and eb== I…
markkulube Aug 19, 2020
413605c
feat(askscript): defined ElseIf statement and class.
markkulube Aug 19, 2020
35c3969
test: test script for else-if else-if control flow statement.
markkulube Aug 19, 2020
f9d4655
build(deps-dev): bump babel-jest from 26.1.0 to 26.2.2 (#424)
dependabot[bot] Aug 3, 2020
8d51490
Merge branch 'master' of https://github.com/xFAANG/askql
markkulube Sep 13, 2020
db5b766
feat(askvm): resolve merge conflicts
markkulube Sep 13, 2020
091f013
style: run prettier
markkulube Sep 13, 2020
871d9f0
style(prettier-plugin): concatenate if else block is instance of clas…
markkulube Sep 13, 2020
fb9b6da
feat(askscript): boolean to specify if else block is instance of clas…
markkulube Sep 13, 2020
d139623
test: test different branch combinations in an `else-if else-if' ladder.
markkulube Sep 13, 2020
e95d04d
style: run prettier.
markkulube Sep 13, 2020
0d72ec2
feat(askscript): better naming (props.elseType --> props.elseBlock)
markkulube Sep 16, 2020
c6d74ff
fix: linked-list traversal from root node to generate all branches of…
markkulube Sep 16, 2020
1a14a1b
fix(askscript/_tests_): updated *.ast.ts arising from iimplentation t…
markkulube Sep 16, 2020
811d398
test: add missing *.askcode and *.ast.tsx for testing implementation …
markkulube Sep 16, 2020
37d5524
fix: restore previous formatting.
markkulube Sep 16, 2020
0e2316d
fix: restore to version with all required dependencies.
markkulube Sep 16, 2020
4ffd37c
fix: restore previous formatting.
markkulube Sep 16, 2020
6c2e083
fix: restore previous formatting.
markkulube Sep 16, 2020
cffe36f
fix: restore previous formatting.
markkulube Sep 16, 2020
b55733b
style:run prettier.
markkulube Sep 16, 2020
4b95a6b
test: added test for the case when `if else-if else` ladder terminate…
markkulube Sep 20, 2020
ae0eff1
fix: variable redeclaration using let: var ladder --> let ladder.
markkulube Sep 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export = (
}
/>
}
elseBlock={false}
>
<return value={<ref name="n" />} />
</if>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export = (
<ask args={<list />} returns={<ref name="string" />}>
<if condition={<call name="checkThis" args={<list />} />}>
<if condition={<call name="checkThis" args={<list />} />} elseBlock={false}>
<return value="your string" />
</if>
{"my string"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export = (
}
/>
}
elseBlock={false}
>
<return value={<ref name="n" />} />
</if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export = (
}
/>
}
elseBlock={false}
>
<return value={<ref name="n" />} />
</if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export = (
}
/>
}
elseBlock={false}
>
<return value={<ref name="n" />} />
</if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export = (
/>
</list>
}
elseBlock={true}
>
<assign
name="newStr"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export = (
/>
</list>
}
elseBlock={true}
>
<assign
name="newStr"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export = (
/>
</list>
}
elseBlock={true}
>
<assign
name="newStr"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export = (
/>
</list>
}
elseBlock={true}
>
<assign
name="newStr"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export = (
}
/>
}
elseBlock={false}
>
<return value={<ref name="a" />} />
</if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export = (
}
/>
}
elseBlock={false}
>
<return value={<ref name="a" />} />
</if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export = (
<return value={<ref name="no" />} />
</list>
}
elseBlock={true}
>
<return value={<ref name="yes" />} />
</if>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ask {
let len = 10
if (len == 10) {
return '0AP';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ask(let('len',10),if(call(get('=='),call(get('get'),'len'),10),block(return('0AP')),block()))
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export = (
<ask args={<list />}>
<let name="len" type={<ref name="any" />} value={10} />
<if
condition={
<call
name="=="
args={
<list>
<ref name="len" />
{10}
</list>
}
isOperator={true}
/>
}
elseBlock={false}
>
<return value="0AP" />
</if>
</ask>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export = '0AP';
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ask {
let len = 10
if (len == 12) {
return '0BF';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ask(let('len',10),if(call(get('=='),call(get('get'),'len'),12),block(return('0BF')),block()))
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export = (
<ask args={<list />}>
<let name="len" type={<ref name="any" />} value={10} />
<if
condition={
<call
name="=="
args={
<list>
<ref name="len" />
{12}
</list>
}
isOperator={true}
/>
}
elseBlock={false}
>
<return value="0BF" />
</if>
</ask>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export = null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ask {
let len = 10
if (len == 12) {
return '0CF';
} else if (len == 10) {
return '0CP';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ask(let('len',10),if(call(get('=='),call(get('get'),'len'),12),block(return('0CF')),block(if(call(get('=='),call(get('get'),'len'),10),block(return('0CP')),block()))))
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
export = (
<ask args={<list />}>
<let name="len" type={<ref name="any" />} value={10} />
<if
condition={
<call
name="=="
args={
<list>
<ref name="len" />
{12}
</list>
}
isOperator={true}
/>
}
else={
<if
condition={
<call
name="=="
args={
<list>
<ref name="len" />
{10}
</list>
}
isOperator={true}
/>
}
elseBlock={false}
>
<return value="0CP" />
</if>
}
elseBlock={false}
>
<return value="0CF" />
</if>
</ask>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export = '0CP';
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ask {
let len = 10
if (len == 12) {
return '0DF';
} else if (len == 14) {
return '0DF';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ask(let('len',10),if(call(get('=='),call(get('get'),'len'),12),block(return('0DF')),block(if(call(get('=='),call(get('get'),'len'),14),block(return('0DF')),block()))))
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
export = (
<ask args={<list />}>
<let name="len" type={<ref name="any" />} value={10} />
<if
condition={
<call
name="=="
args={
<list>
<ref name="len" />
{12}
</list>
}
isOperator={true}
/>
}
else={
<if
condition={
<call
name="=="
args={
<list>
<ref name="len" />
{14}
</list>
}
isOperator={true}
/>
}
elseBlock={false}
>
<return value="0DF" />
</if>
}
elseBlock={false}
>
<return value="0DF" />
</if>
</ask>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export = null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ask {
let len = 10
if (len == 10) {
return '1AP';
} else {
return '1AF';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ask(let('len',10),if(call(get('=='),call(get('get'),'len'),10),block(return('1AP')),block(list(return('1AF')))))
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export = (
<ask args={<list />}>
<let name="len" type={<ref name="any" />} value={10} />
<if
condition={
<call
name="=="
args={
<list>
<ref name="len" />
{10}
</list>
}
isOperator={true}
/>
}
else={
<list>
<return value="1AF" />
</list>
}
elseBlock={true}
>
<return value="1AP" />
</if>
</ask>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export = '1AP';
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ask {
let len = 10
if (len == 12) {
return '1BF';
} else {
return '1BP';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ask(let('len',10),if(call(get('=='),call(get('get'),'len'),12),block(return('1BF')),block(list(return('1BP')))))
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export = (
<ask args={<list />}>
<let name="len" type={<ref name="any" />} value={10} />
<if
condition={
<call
name="=="
args={
<list>
<ref name="len" />
{12}
</list>
}
isOperator={true}
/>
}
else={
<list>
<return value="1BP" />
</list>
}
elseBlock={true}
>
<return value="1BF" />
</if>
</ask>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export = '1BP';
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ask {
let len = 10
if (len == 10) {
return '2AP';
} else if (len == 12) {
return '2AF';
} else {
return '2AF';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ask(let('len',10),if(call(get('=='),call(get('get'),'len'),10),block(return('2AP')),block(if(call(get('=='),call(get('get'),'len'),12),block(return('2AF')),block(list(return('2AF')))))))
Loading