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

Fix table.field names, CONNECT() methods #25

Merged
merged 7 commits into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
325 changes: 287 additions & 38 deletions abl.tmLanguage.json

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions spec/blocks/finally-blocks.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const { assert, expect } = require('chai');
const shared = require('../shared.js');

describe('', () => {
let statement = `FINALLY:
ASSIGN oBusinessEntityDescriptor = ?.
END FINALLY.`;
let expectedTokens = [
[
{ "startIndex": 0, "endIndex": 7, "scopes": ["source.abl", "meta.block.abl", "keyword.other.abl"] }, // 'FINALLY'
{ "startIndex": 7, "endIndex": 9, "scopes": ["source.abl"] } // ':'
],
[
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 4, "endIndex": 10, "scopes": ["source.abl", "keyword.other.abl"] }, // 'ASSIGN'
{ "startIndex": 10, "endIndex": 11, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 11, "endIndex": 36, "scopes": ["source.abl", "variable.other.abl"] }, // 'oBusinessEntityDescriptor'
{ "startIndex": 36, "endIndex": 37, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 37, "endIndex": 38, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
{ "startIndex": 38, "endIndex": 39, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 39, "endIndex": 40, "scopes": ["source.abl", "constant.language.abl"] }, // '?'
{ "startIndex": 40, "endIndex": 41, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
],
[
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'END'
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 4, "endIndex": 11, "scopes": ["source.abl", "keyword.other.abl"] }, // 'FINALLY'
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
]
];
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
})

describe('', () => {
let statement = `FINALLY:
END. // no finally on END`;
let expectedTokens = [
[
{ "startIndex": 0, "endIndex": 7, "scopes": ["source.abl", "meta.block.abl", "keyword.other.abl"] }, // 'FINALLY'
{ "startIndex": 7, "endIndex": 9, "scopes": ["source.abl"] } // ':'
],
[
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 2, "endIndex": 5, "scopes": ["source.abl", "keyword.other.abl"] }, // 'END'
{ "startIndex": 5, "endIndex": 6, "scopes": ["source.abl", "punctuation.terminator.abl"] }, // '.'
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 7, "endIndex": 27, "scopes": ["source.abl", "comment.line.double-slash.abl"] } // '// no finally on END'
]
];
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
})
69 changes: 69 additions & 0 deletions spec/db-table-and-field/fields-except.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
const { assert, expect } = require('chai');
const shared = require('../shared.js');

describe('', () => {
let statement = `for each customer fields (name customer.custnum), first order of customer except(comments) no-lock where order.orderdate < today:`;
let expectedTokens = [
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'for'
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 4, "endIndex": 8, "scopes": ["source.abl", "keyword.other.abl"] }, // 'each'
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 9, "endIndex": 17, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'customer'
{ "startIndex": 17, "endIndex": 18, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 18, "endIndex": 24, "scopes": ["source.abl", "keyword.other.abl"] }, // 'fields'
{ "startIndex": 24, "endIndex": 25, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 25, "endIndex": 26, "scopes": ["source.abl", "meta.brace.round.js"] }, // '('
{ "startIndex": 26, "endIndex": 30, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'name'
{ "startIndex": 30, "endIndex": 31, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 31, "endIndex": 47, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'customer.custnum'
{ "startIndex": 47, "endIndex": 48, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
{ "startIndex": 48, "endIndex": 49, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // ','
{ "startIndex": 49, "endIndex": 50, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 50, "endIndex": 55, "scopes": ["source.abl", "keyword.other.abl"] }, // 'first'
{ "startIndex": 55, "endIndex": 56, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 56, "endIndex": 61, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'order'
{ "startIndex": 61, "endIndex": 62, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 62, "endIndex": 64, "scopes": ["source.abl", "keyword.other.abl"] }, // 'of'
{ "startIndex": 64, "endIndex": 65, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 65, "endIndex": 73, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'customer'
{ "startIndex": 73, "endIndex": 74, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 74, "endIndex": 80, "scopes": ["source.abl", "keyword.other.abl"] }, // 'except'
{ "startIndex": 80, "endIndex": 81, "scopes": ["source.abl", "meta.brace.round.js"] }, // '('
{ "startIndex": 81, "endIndex": 89, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'comments'
{ "startIndex": 89, "endIndex": 90, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
{ "startIndex": 90, "endIndex": 91, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 91, "endIndex": 98, "scopes": ["source.abl", "keyword.other.abl"] }, // 'no-lock'
{ "startIndex": 98, "endIndex": 99, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 99, "endIndex": 104, "scopes": ["source.abl", "keyword.other.abl"] }, // 'where'
{ "startIndex": 104, "endIndex": 105, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 105, "endIndex": 120, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'order.orderdate'
{ "startIndex": 120, "endIndex": 121, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 121, "endIndex": 122, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '<'
{ "startIndex": 122, "endIndex": 123, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 123, "endIndex": 128, "scopes": ["source.abl", "constant.language.abl"] }, // 'today'
{ "startIndex": 128, "endIndex": 130, "scopes": ["source.abl"] } // ':'
];
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
})

describe('', () => {
let statement = `for each salesrep fields (month_quota[1] month_quota[12]):`;
let expectedTokens = [
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'for'
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 4, "endIndex": 8, "scopes": ["source.abl", "keyword.other.abl"] }, // 'each'
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 9, "endIndex": 17, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'salesrep'
{ "startIndex": 17, "endIndex": 18, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 18, "endIndex": 24, "scopes": ["source.abl", "keyword.other.abl"] }, // 'fields'
{ "startIndex": 24, "endIndex": 25, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 25, "endIndex": 26, "scopes": ["source.abl", "meta.brace.round.js"] }, // '('
{ "startIndex": 26, "endIndex": 40, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'month_quota[1]'
{ "startIndex": 40, "endIndex": 41, "scopes": ["source.abl"] }, // ' '
{ "startIndex": 41, "endIndex": 56, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'month_quota[12]'
{ "startIndex": 56, "endIndex": 57, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
{ "startIndex": 57, "endIndex": 59, "scopes": ["source.abl"] } // ':'
];
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
})

Loading