main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
3.0 KB
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | module.exports = al
|
---|
| 4 | al.displayName = 'al'
|
---|
| 5 | al.aliases = []
|
---|
| 6 | function al(Prism) {
|
---|
| 7 | // based on https://github.com/microsoft/AL/blob/master/grammar/alsyntax.tmlanguage
|
---|
| 8 | Prism.languages.al = {
|
---|
| 9 | comment: /\/\/.*|\/\*[\s\S]*?\*\//,
|
---|
| 10 | string: {
|
---|
| 11 | pattern: /'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/,
|
---|
| 12 | greedy: true
|
---|
| 13 | },
|
---|
| 14 | function: {
|
---|
| 15 | pattern:
|
---|
| 16 | /(\b(?:event|procedure|trigger)\s+|(?:^|[^.])\.\s*)[a-z_]\w*(?=\s*\()/i,
|
---|
| 17 | lookbehind: true
|
---|
| 18 | },
|
---|
| 19 | keyword: [
|
---|
| 20 | // keywords
|
---|
| 21 | /\b(?:array|asserterror|begin|break|case|do|downto|else|end|event|exit|for|foreach|function|if|implements|in|indataset|interface|internal|local|of|procedure|program|protected|repeat|runonclient|securityfiltering|suppressdispose|temporary|then|to|trigger|until|var|while|with|withevents)\b/i, // objects and metadata that are used like keywords
|
---|
| 22 | /\b(?:action|actions|addafter|addbefore|addfirst|addlast|area|assembly|chartpart|codeunit|column|controladdin|cuegroup|customizes|dataitem|dataset|dotnet|elements|enum|enumextension|extends|field|fieldattribute|fieldelement|fieldgroup|fieldgroups|fields|filter|fixed|grid|group|key|keys|label|labels|layout|modify|moveafter|movebefore|movefirst|movelast|page|pagecustomization|pageextension|part|profile|query|repeater|report|requestpage|schema|separator|systempart|table|tableelement|tableextension|textattribute|textelement|type|usercontrol|value|xmlport)\b/i
|
---|
| 23 | ],
|
---|
| 24 | number:
|
---|
| 25 | /\b(?:0x[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(?:F|LL?|U(?:LL?)?)?\b/i,
|
---|
| 26 | boolean: /\b(?:false|true)\b/i,
|
---|
| 27 | variable: /\b(?:Curr(?:FieldNo|Page|Report)|x?Rec|RequestOptionsPage)\b/,
|
---|
| 28 | 'class-name':
|
---|
| 29 | /\b(?:automation|biginteger|bigtext|blob|boolean|byte|char|clienttype|code|completiontriggererrorlevel|connectiontype|database|dataclassification|datascope|date|dateformula|datetime|decimal|defaultlayout|dialog|dictionary|dotnetassembly|dotnettypedeclaration|duration|errorinfo|errortype|executioncontext|executionmode|fieldclass|fieldref|fieldtype|file|filterpagebuilder|guid|httpclient|httpcontent|httpheaders|httprequestmessage|httpresponsemessage|instream|integer|joker|jsonarray|jsonobject|jsontoken|jsonvalue|keyref|list|moduledependencyinfo|moduleinfo|none|notification|notificationscope|objecttype|option|outstream|pageresult|record|recordid|recordref|reportformat|securityfilter|sessionsettings|tableconnectiontype|tablefilter|testaction|testfield|testfilterfield|testpage|testpermissions|testrequestpage|text|textbuilder|textconst|textencoding|time|transactionmodel|transactiontype|variant|verbosity|version|view|views|webserviceactioncontext|webserviceactionresultcode|xmlattribute|xmlattributecollection|xmlcdata|xmlcomment|xmldeclaration|xmldocument|xmldocumenttype|xmlelement|xmlnamespacemanager|xmlnametable|xmlnode|xmlnodelist|xmlprocessinginstruction|xmlreadoptions|xmltext|xmlwriteoptions)\b/i,
|
---|
| 30 | operator: /\.\.|:[=:]|[-+*/]=?|<>|[<>]=?|=|\b(?:and|div|mod|not|or|xor)\b/i,
|
---|
| 31 | punctuation: /[()\[\]{}:.;,]/
|
---|
| 32 | }
|
---|
| 33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.