Skip to content

Commit

Permalink
feat: Improve visual sample and update Lexer accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviermignot committed Oct 27, 2024
1 parent f983c95 commit 012c29d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/rouge/lexers/bicep.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ class Bicep < Rouge::RegexLexer
resourceGroup subscription tenant base64 base64ToJson base64ToString dataUri dataUriToString
endsWith format guid indexOf lastIndexOf length newGuid padLeft replace split startsWith
string substring toLower toUpper trim uniqueString uri uriComponent uriComponentToString
toObject
)

operators = %w(+ - * / % < <= > >= == != && || !)

punctuation = %w(( ) { } [ ] , : ; =)
punctuation = %w(( ) { } [ ] , : ; = .)

state :root do
mixin :comments
Expand Down
9 changes: 6 additions & 3 deletions spec/visual/samples/bicep
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ targetScope = 'subscription' // To create a resource group
@description('The Azure region to create the resources in.')
param location string

var suffix = padLeft('my-suffix', 10)
var suffix = uniqueString(subscription().subscriptionId, 'my-project')

var array = [
var someTags = [
{
fldmfl: 'fldmlfd'
key: 'location'
value: location
}
]

// Create a resource group
resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: 'rg-${suffix}'
location: location

tags: toObject(someTags, tag => tag.key, tag => tag.value)
}

0 comments on commit 012c29d

Please sign in to comment.