Skip to content

Commit 2e1c938

Browse files
paulo-santos-skylildudeAlhadis
authored
Add Bikeshed & Brighterscript (github-linguist#5643)
* add brighterscript * PR comment changes - correct naming * folder case switch part 1 * folder case switch part 2 * added heuristics * a-z sorting after merge * added bikeshed for distinction between BrighterScript and Bikeshed languages * updated heuristics tests * Finish: update heuristics * added a second bikeshed example * Update lib/linguist/languages.yml Co-authored-by: John Gardner <gardnerjohng@gmail.com> * Update lib/linguist/languages.yml Co-authored-by: John Gardner <gardnerjohng@gmail.com> * Update lib/linguist/heuristics.yml Co-authored-by: John Gardner <gardnerjohng@gmail.com> * Update lib/linguist/heuristics.yml Co-authored-by: John Gardner <gardnerjohng@gmail.com> * update brighterscript heuristics pattern * update heuristics bikeshed * Update lib/linguist/heuristics.yml Co-authored-by: John Gardner <gardnerjohng@gmail.com> * better brighterscript check for function/end function sub/end sub * Update lib/linguist/heuristics.yml Co-authored-by: John Gardner <gardnerjohng@gmail.com> * Remove both {Bright,Brighter}Script grammars The latter is only temporary. * Register new BrighterScript grammar correctly * Update lib/linguist/heuristics.yml Co-authored-by: John Gardner <gardnerjohng@gmail.com> * Revert "Update lib/linguist/heuristics.yml" This reverts commit 2936ef0. * added another sample on brighter script and now it passes cross validation * Whitelist CC0-1.0 license * Update link to license whitelist * Correct order * Correct order Co-authored-by: Colin Seymour <colin@github.com> Co-authored-by: John Gardner <gardnerjohng@gmail.com>
1 parent b797af7 commit 2e1c938

18 files changed

+14021
-14
lines changed

.gitmodules

+6-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
[submodule "vendor/grammars/AutoHotkey"]
1717
path = vendor/grammars/AutoHotkey
1818
url = https://github.com/ahkscript/SublimeAutoHotkey
19-
[submodule "vendor/grammars/BrightScript.tmbundle"]
20-
path = vendor/grammars/BrightScript.tmbundle
21-
url = https://github.com/cmink/BrightScript.tmbundle
2219
[submodule "vendor/grammars/CUE-Sheet_sublime"]
2320
path = vendor/grammars/CUE-Sheet_sublime
2421
url = https://github.com/relikd/CUE-Sheet_sublime
@@ -332,6 +329,9 @@
332329
[submodule "vendor/grammars/bicep"]
333330
path = vendor/grammars/bicep
334331
url = https://github.com/azure/bicep
332+
[submodule "vendor/grammars/bikeshed"]
333+
path = vendor/grammars/bikeshed
334+
url = https://github.com/tabatkins/bikeshed.git
335335
[submodule "vendor/grammars/blitzmax"]
336336
path = vendor/grammars/blitzmax
337337
url = https://github.com/textmate/blitzmax.tmbundle
@@ -1109,6 +1109,9 @@
11091109
[submodule "vendor/grammars/vscode-antlers-language-server"]
11101110
path = vendor/grammars/vscode-antlers-language-server
11111111
url = https://github.com/Stillat/vscode-antlers-language-server.git
1112+
[submodule "vendor/grammars/vscode-brightscript-language"]
1113+
path = vendor/grammars/vscode-brightscript-language
1114+
url = https://github.com/rokucommunity/vscode-brightscript-language.git
11121115
[submodule "vendor/grammars/vscode-cadence"]
11131116
path = vendor/grammars/vscode-cadence
11141117
url = https://github.com/onflow/vscode-cadence.git

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ As Linguist is a production dependency for GitHub we have a couple of workflow r
208208
[grammars]: /vendor/README.md
209209
[heuristic]: https://github.com/github/linguist/blob/master/lib/linguist/heuristics.yml
210210
[languages]: /lib/linguist/languages.yml
211-
[licenses]: https://github.com/github/linguist/blob/257425141d4e2a5232786bf0b13c901ada075f93/vendor/licenses/config.yml#L2-L11
211+
[licenses]: https://github.com/github/linguist/blob/9b1023ed5d308cb3363a882531dea1e272b59977/vendor/licenses/config.yml#L4-L15
212212
[new-issue]: https://github.com/github/linguist/issues/new
213213
[samples]: /samples
214214
[search-example]: https://github.com/search?utf8=%E2%9C%93&q=extension%3Aboot+NOT+nothack&type=Code&ref=searchresults

grammars.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ vendor/grammars/Atom-PostScript:
1010
- source.postscript
1111
vendor/grammars/AutoHotkey:
1212
- source.ahk
13-
vendor/grammars/BrightScript.tmbundle:
14-
- source.brightauthorproject
15-
- source.brightscript
1613
vendor/grammars/CUE-Sheet_sublime:
1714
- source.cuesheet
1815
vendor/grammars/CoDT7-Sublime:
@@ -276,6 +273,8 @@ vendor/grammars/berry-grammar:
276273
vendor/grammars/bicep:
277274
- markdown.bicep.codeblock
278275
- source.bicep
276+
vendor/grammars/bikeshed:
277+
- source.csswg
279278
vendor/grammars/blitzmax:
280279
- source.blitzmax
281280
vendor/grammars/boogie-vscode:
@@ -974,6 +973,8 @@ vendor/grammars/vscode-TalonScript:
974973
- source.talon
975974
vendor/grammars/vscode-antlers-language-server:
976975
- text.html.statamic
976+
vendor/grammars/vscode-brightscript-language:
977+
- source.brs
977978
vendor/grammars/vscode-cadence:
978979
- markdown.cadence.codeblock
979980
- source.cadence

lib/linguist/heuristics.yml

+10
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ disambiguations:
9898
rules:
9999
- language: FreeBasic
100100
pattern: '^[ \t]*#(?:define|endif|endmacro|ifn?def|if|include|lang|macro)\s'
101+
- extensions: ['.bs']
102+
rules:
103+
- language: Bikeshed
104+
pattern: '^(?i:<pre\s+class)\s*=\s*(''|\"|\b)metadata\b\1[^>\r\n]*>'
105+
- language: BrighterScript
106+
pattern:
107+
- (?i:^\s*(?=^sub\s)(?:sub\s*\w+\(.*?\))|(?::\s*sub\(.*?\))$)
108+
- (?i:^\s*(end\ssub)$)
109+
- (?i:^\s*(?=^function\s)(?:function\s*\w+\(.*?\)\s*as\s*\w*)|(?::\s*function\(.*?\)\s*as\s*\w*)$)
110+
- (?i:^\s*(end\sfunction)$)
101111
- extensions: ['.builds']
102112
rules:
103113
- language: XML

lib/linguist/languages.yml

+19-1
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,16 @@ Bicep:
560560
tm_scope: source.bicep
561561
ace_mode: text
562562
language_id: 321200902
563+
Bikeshed:
564+
type: markup
565+
color: "#5562ac"
566+
extensions:
567+
- ".bs"
568+
tm_scope: source.csswg
569+
ace_mode: html
570+
codemirror_mode: htmlmixed
571+
codemirror_mime_type: text/html
572+
language_id: 1055528081
563573
Bison:
564574
type: programming
565575
color: "#6A463F"
@@ -647,12 +657,20 @@ Brainfuck:
647657
codemirror_mode: brainfuck
648658
codemirror_mime_type: text/x-brainfuck
649659
language_id: 38
660+
BrighterScript:
661+
type: programming
662+
color: "#66AABB"
663+
extensions:
664+
- ".bs"
665+
tm_scope: source.brs
666+
ace_mode: text
667+
language_id: 943571030
650668
Brightscript:
651669
type: programming
652670
color: "#662D91"
653671
extensions:
654672
- ".brs"
655-
tm_scope: source.brightscript
673+
tm_scope: source.brs
656674
ace_mode: text
657675
language_id: 39
658676
Browserslist:

samples/Bikeshed/example.bs

+211
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
<pre class='metadata'>
2+
Title: WebAssembly JavaScript Interface
3+
Shortname: wasm-js-api
4+
Group: wasm
5+
Status: ED
6+
Level: 1
7+
TR: https://www.w3.org/TR/wasm-js-api-1/
8+
ED: https://webassembly.github.io/spec/js-api/
9+
Editor: Ms2ger (Igalia)
10+
Repository: WebAssembly/spec
11+
Markup Shorthands: css no, markdown yes
12+
Abstract: This document provides an explicit JavaScript API for interacting with WebAssembly.
13+
Prepare For TR: true
14+
</pre>
15+
16+
<pre class='biblio'>
17+
{
18+
"WEBASSEMBLY": {
19+
"href": "https://webassembly.github.io/spec/core/",
20+
"title": "WebAssembly Core Specification",
21+
"publisher": "W3C WebAssembly Community Group",
22+
"status": "Draft"
23+
}
24+
}
25+
</pre>
26+
27+
<pre class="anchors">
28+
urlPrefix: https://tc39.github.io/ecma262/; spec: ECMASCRIPT
29+
type: interface; for: ECMAScript
30+
text: ArrayBuffer; url: sec-arraybuffer-objects
31+
type: exception; for: ECMAScript
32+
text: Error; url: sec-error-objects
33+
text: NativeError; url: sec-nativeerror-constructors
34+
text: TypeError; url: sec-native-error-types-used-in-this-standard-typeerror
35+
text: RangeError; url: sec-native-error-types-used-in-this-standard-rangeerror
36+
type: dfn
37+
text: agent cluster; url: sec-agent-clusters
38+
text: agent; url: agent
39+
text: data block; url: sec-data-blocks
40+
text: Bound Function; url: sec-bound-function-exotic-objects
41+
text: NumericLiteral; url: sec-literals-numeric-literals
42+
text: surrounding agent; url: surrounding-agent
43+
text: ToNumber; url: sec-tonumber
44+
text: ToInt32; url: sec-toint32
45+
text: ToString; url: sec-tostring
46+
url: sec-ecmascript-data-types-and-values
47+
text: Type
48+
text: Type(x)
49+
url: sec-iscallable
50+
text: IsCallable
51+
text: callable; for: ECMAScript
52+
url: sec-well-known-intrinsic-objects
53+
text: %ErrorPrototype%
54+
text: %ObjectPrototype%; url: sec-properties-of-the-object-prototype-object
55+
text: %FunctionPrototype%; url: sec-properties-of-the-function-prototype-object
56+
text: %Promise%; url: sec-promise-constructor
57+
text: Property Descriptor; url: sec-property-descriptor-specification-type
58+
text: array index; url: sec-array-exotic-objects
59+
text: OrdinaryGetOwnProperty; url: sec-ordinarygetownproperty
60+
text: OrdinaryDefineOwnProperty; url: sec-ordinarydefineownproperty
61+
text: OrdinaryPreventExtensions; url: sec-ordinarypreventextensions
62+
text: OrdinarySet; url: sec-ordinaryset
63+
text: equally close values; url: sec-ecmascript-language-types-number-type
64+
text: internal slot; url: sec-object-internal-methods-and-internal-slots
65+
text: JavaScript execution context stack; url: execution-context-stack
66+
text: running JavaScript execution context; url: running-execution-context
67+
text: GetIterator; url: sec-getiterator
68+
text: IteratorStep; url: sec-iteratorstep
69+
text: NormalCompletion; url: sec-normalcompletion
70+
text: IteratorValue; url: sec-iteratorvalue
71+
url: sec-well-known-symbols
72+
text: @@iterator
73+
text: @@toStringTag
74+
text: CreateDataProperty; url: sec-createdataproperty
75+
text: DetachArrayBuffer; url: sec-detacharraybuffer
76+
text: SetIntegrityLevel; url: sec-setintegritylevel
77+
text: Call; url: sec-call
78+
text: Get; url: sec-get-o-p
79+
text: DefinePropertyOrThrow; url: sec-definepropertyorthrow
80+
text: current Realm; url: current-realm
81+
text: ObjectCreate; url: sec-objectcreate
82+
text: CreateBuiltinFunction; url: sec-createbuiltinfunction
83+
text: SetFunctionName; url: sec-setfunctionname
84+
text: SetFunctionLength; url: sec-setfunctionlength
85+
text: the Number value; url: sec-ecmascript-language-types-number-type
86+
text: NumberToRawBytes; url: sec-numbertorawbytes
87+
text: Built-in Function Objects; url: sec-built-in-function-objects
88+
text: NativeError Object Structure; url: sec-nativeerror-object-structure
89+
text: CreateArrayFromList; url: sec-createarrayfromlist
90+
text: GetMethod; url: sec-getmethod
91+
text: IterableToList; url: sec-iterabletolist
92+
text: ToBigInt64; url: #sec-tobigint64
93+
text: BigInt; url: #sec-ecmascript-language-types-bigint-type
94+
type: abstract-op
95+
text: CreateMethodProperty; url: sec-createmethodproperty
96+
urlPrefix: https://webassembly.github.io/spec/core/; spec: WebAssembly; type: dfn
97+
url: valid/modules.html#valid-module
98+
text: valid
99+
text: WebAssembly module validation
100+
text: module grammar; url: binary/modules.html#binary-module
101+
text: custom section; url: binary/modules.html#custom-section
102+
text: customsec; url: binary/modules.html#binary-customsec
103+
text: memory instance; url: exec/runtime.html#memory-instances
104+
text: table instance; url: exec/runtime.html#table-instances
105+
text: global instance; url: exec/runtime.html#global-instances
106+
text: trap; url: exec/runtime.html#syntax-trap
107+
url: exec/runtime.html#values
108+
text: WebAssembly value
109+
text: i64.const
110+
text: i32.const
111+
text: f32.const
112+
text: f64.const
113+
text: ref.null
114+
text: ref.func
115+
text: ref.extern
116+
text: function index; url: syntax/modules.html#syntax-funcidx
117+
text: function instance; url: exec/runtime.html#function-instances
118+
text: store_init; url: appendix/embedding.html#embed-store-init
119+
text: module_decode; url: appendix/embedding.html#embed-module-decode
120+
text: module_validate; url: appendix/embedding.html#embed-module-validate
121+
text: module_instantiate; url: appendix/embedding.html#embed-module-instantiate
122+
text: module_imports; url: appendix/embedding.html#embed-module-imports
123+
text: module_exports; url: appendix/embedding.html#embed-module-exports
124+
text: instance_export; url: appendix/embedding.html#embed-instance-export
125+
text: func_alloc; url: appendix/embedding.html#embed-func-alloc
126+
text: func_type; url: appendix/embedding.html#embed-func-type
127+
text: func_invoke; url: appendix/embedding.html#embed-func-invoke
128+
text: table_alloc; url: appendix/embedding.html#embed-table-alloc
129+
text: table_type; url: appendix/embedding.html#embed-table-type
130+
text: table_read; url: appendix/embedding.html#embed-table-read
131+
text: table_write; url: appendix/embedding.html#embed-table-write
132+
text: table_size; url: appendix/embedding.html#embed-table-size
133+
text: table_grow; url: appendix/embedding.html#embed-table-grow
134+
text: mem_alloc; url: appendix/embedding.html#embed-mem-alloc
135+
text: mem_type; url: appendix/embedding.html#embed-mem-type
136+
text: mem_read; url: appendix/embedding.html#embed-mem-read
137+
text: mem_write; url: appendix/embedding.html#embed-mem-write
138+
text: mem_size; url: appendix/embedding.html#embed-mem-size
139+
text: mem_grow; url: appendix/embedding.html#embed-mem-grow
140+
text: global_alloc; url: appendix/embedding.html#embed-global-alloc
141+
text: global_type; url: appendix/embedding.html#embed-global-type
142+
text: global_read; url: appendix/embedding.html#embed-global-read
143+
text: global_write; url: appendix/embedding.html#embed-global-write
144+
text: error; url: appendix/embedding.html#embed-error
145+
text: store; url: exec/runtime.html#syntax-store
146+
text: table type; url: syntax/types.html#syntax-tabletype
147+
text: table address; url: exec/runtime.html#syntax-tableaddr
148+
text: function address; url: exec/runtime.html#syntax-funcaddr
149+
text: memory address; url: exec/runtime.html#syntax-memaddr
150+
text: global address; url: exec/runtime.html#syntax-globaladdr
151+
text: extern address; url: exec/runtime.html#syntax-externaddr
152+
url: syntax/types.html#syntax-numtype
153+
text: i32
154+
text: i64
155+
text: f32
156+
text: f64
157+
url: syntax/types.html#syntax-reftype
158+
text: reftype
159+
text: funcref
160+
text: externref
161+
text: function element; url: exec/runtime.html#syntax-funcelem
162+
text: import component; url: syntax/modules.html#imports
163+
text: external value; url: exec/runtime.html#syntax-externval
164+
text: host function; url: exec/runtime.html#syntax-hostfunc
165+
text: the instantiation algorithm; url: exec/modules.html#instantiation
166+
text: module; url: syntax/modules.html#syntax-module
167+
text: imports; url: syntax/modules.html#syntax-module
168+
text: import; url: syntax/modules.html#syntax-import
169+
url: syntax/types.html#external-types
170+
text: external type
171+
text: func
172+
text: table
173+
text: mem
174+
text: global
175+
text: global type; url: syntax/types.html#syntax-globaltype
176+
url: syntax/types.html#syntax-mut
177+
text: var
178+
text: const
179+
text: address; url: exec/runtime.html#addresses
180+
text: signed_32; url: exec/numerics.html#aux-signed
181+
text: memory.grow; url: exec/instructions.html#exec-memory-grow
182+
text: current frame; url: exec/conventions.html#exec-notation-textual
183+
text: module; for: frame; url: exec/runtime.html#syntax-frame
184+
text: memaddrs; for: moduleinst; url: exec/runtime.html#syntax-moduleinst
185+
text: signed_64; url: exec/numerics.html#aux-signed
186+
text: sequence; url: syntax/conventions.html#grammar-notation
187+
urlPrefix: https://heycam.github.io/webidl/; spec: WebIDL
188+
type: dfn
189+
text: create a namespace object; url: create-a-namespace-object
190+
</pre>
191+
192+
<pre class='link-defaults'>
193+
spec:infra; type:dfn; text:list
194+
spec:ecma-262; type:exception; for:ECMAScript; text:Error
195+
spec:ecmascript; type:exception; for:ECMAScript; text:TypeError
196+
spec:ecmascript; type:exception; for:ECMAScript; text:RangeError
197+
spec:ecmascript; type:interface; for:ECMAScript; text:ArrayBuffer
198+
spec:webidl; type:dfn; text:resolve
199+
</pre>
200+
201+
<style>
202+
emu-const {
203+
font-family: serif;
204+
}
205+
</style>
206+
207+
This API provides a way to access WebAssembly [[WEBASSEMBLY]] through a bridge to explicitly construct modules from JavaScript [[ECMASCRIPT]].
208+
209+
<h2 id="sample">Sample API Usage</h2>
210+
211+
<p><em>This section is non-normative.</em></p>

0 commit comments

Comments
 (0)