-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Transform languages #3948
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
Merged
Merged
Transform languages #3948
Changes from all commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
2276d38
Vala
DmitrySharabin 96a1366
Firestore security rules
DmitrySharabin 6ffb7dc
Xeora
DmitrySharabin 117848b
Flow
DmitrySharabin b4d3186
Wiki
DmitrySharabin b9268b0
V
DmitrySharabin 763e2a1
Velocity
DmitrySharabin fbee503
glsl
DmitrySharabin 7111d97
gml
DmitrySharabin 3563429
Go
DmitrySharabin 9887b42
gradle
DmitrySharabin 58b3f9a
groovy
DmitrySharabin f93c836
haxe
DmitrySharabin ca7729a
kotlin
DmitrySharabin ae16a15
javadoc
DmitrySharabin cf50ee3
squirrel
DmitrySharabin 3e76dc8
hlsl
DmitrySharabin 6e83d98
idris
DmitrySharabin ed773b5
json5
DmitrySharabin abf2d62
jsonp
DmitrySharabin 9a87359
less
DmitrySharabin 42ba110
n4js
DmitrySharabin 08ebab7
objectivec
DmitrySharabin e52c094
opencl
DmitrySharabin 7d60552
sqf
DmitrySharabin 6047ce6
sparql
DmitrySharabin c383134
solidity
DmitrySharabin 222481b
scala
DmitrySharabin 5183bbc
reason
DmitrySharabin ccb3d6a
racket
DmitrySharabin 427dca0
qore
DmitrySharabin 4f0f2a2
purescript
DmitrySharabin 190307e
purebasic
DmitrySharabin d2ccfb0
protobuf
DmitrySharabin cbd86e2
processing
DmitrySharabin cdb1819
plsql
DmitrySharabin 1b597a2
phpdoc
DmitrySharabin 67658e6
mongodb
DmitrySharabin 28c19b6
jolie
DmitrySharabin e062955
latte
DmitrySharabin c995387
parser
DmitrySharabin 9f5ae15
textile
DmitrySharabin 7900d65
qsharp
DmitrySharabin b53c26d
ruby
DmitrySharabin 9f99a67
sass
DmitrySharabin f4e27b3
scss
DmitrySharabin bdb73f0
xquery
DmitrySharabin 47abee3
http
DmitrySharabin c0d0421
haml
DmitrySharabin fdf22de
rescript
DmitrySharabin 3c8263d
Address feedback: use `$insert`–`$before` syntactic sugar
DmitrySharabin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,48 +1,45 @@ | ||
| import { insertBefore } from '../util/insert'; | ||
| import clike from './clike'; | ||
| import type { LanguageProto } from '../types'; | ||
| import type { Grammar, LanguageProto } from '../types'; | ||
|
|
||
| export default { | ||
| id: 'firestore-security-rules', | ||
| require: clike, | ||
| grammar ({ extend }) { | ||
| const fsr = extend('clike', { | ||
| base: clike, | ||
| grammar (): Grammar { | ||
| return { | ||
| 'comment': /\/\/.*/, | ||
| 'keyword': /\b(?:allow|function|if|match|null|return|rules_version|service)\b/, | ||
| 'operator': /&&|\|\||[<>!=]=?|[-+*/%]|\b(?:in|is)\b/, | ||
| }); | ||
|
|
||
| delete fsr['class-name']; | ||
|
|
||
| insertBefore(fsr, 'keyword', { | ||
| 'path': { | ||
| pattern: | ||
| /(^|[\s(),])(?:\/(?:[\w\xA0-\uFFFF]+|\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)))+/, | ||
| lookbehind: true, | ||
| greedy: true, | ||
| inside: { | ||
| 'variable': { | ||
| pattern: /\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)/, | ||
| $insertBefore: { | ||
| 'keyword': { | ||
| 'path': { | ||
| pattern: | ||
| /(^|[\s(),])(?:\/(?:[\w\xA0-\uFFFF]+|\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)))+/, | ||
| lookbehind: true, | ||
| greedy: true, | ||
| inside: { | ||
| 'operator': /=/, | ||
| 'keyword': /\*\*/, | ||
| 'punctuation': /[.$(){}]/, | ||
| 'variable': { | ||
| pattern: /\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)/, | ||
| inside: { | ||
| 'operator': /=/, | ||
| 'keyword': /\*\*/, | ||
| 'punctuation': /[.$(){}]/, | ||
| }, | ||
| }, | ||
| 'punctuation': /\//, | ||
| }, | ||
| }, | ||
| 'method': { | ||
| // to make the pattern shorter, the actual method names are omitted | ||
| pattern: /(\ballow\s+)[a-z]+(?:\s*,\s*[a-z]+)*(?=\s*[:;])/, | ||
| lookbehind: true, | ||
| alias: 'builtin', | ||
| inside: { | ||
| 'punctuation': /,/, | ||
| }, | ||
| }, | ||
| 'punctuation': /\//, | ||
| }, | ||
| }, | ||
| 'method': { | ||
| // to make the pattern shorter, the actual method names are omitted | ||
| pattern: /(\ballow\s+)[a-z]+(?:\s*,\s*[a-z]+)*(?=\s*[:;])/, | ||
| lookbehind: true, | ||
| alias: 'builtin', | ||
| inside: { | ||
| 'punctuation': /,/, | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| return fsr; | ||
| $delete: ['class-name'], | ||
| }; | ||
| }, | ||
| } as LanguageProto<'firestore-security-rules'>; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me point you to the languages I'd love you to review.
The first in this one—Flow. The reason: I used
baseand$mergehere.