azcli.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*---------------------------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Licensed under the MIT License. See License.txt in the project root for license information.
  4. *--------------------------------------------------------------------------------------------*/
  5. export var conf = {
  6. comments: {
  7. lineComment: '#'
  8. }
  9. };
  10. export var language = {
  11. defaultToken: 'keyword',
  12. ignoreCase: true,
  13. tokenPostfix: '.azcli',
  14. str: /[^#\s]/,
  15. tokenizer: {
  16. root: [
  17. { include: '@comment' },
  18. [
  19. /\s-+@str*\s*/,
  20. {
  21. cases: {
  22. '@eos': { token: 'key.identifier', next: '@popall' },
  23. '@default': { token: 'key.identifier', next: '@type' }
  24. }
  25. }
  26. ],
  27. [
  28. /^-+@str*\s*/,
  29. {
  30. cases: {
  31. '@eos': { token: 'key.identifier', next: '@popall' },
  32. '@default': { token: 'key.identifier', next: '@type' }
  33. }
  34. }
  35. ]
  36. ],
  37. type: [
  38. { include: '@comment' },
  39. [
  40. /-+@str*\s*/,
  41. {
  42. cases: {
  43. '@eos': { token: 'key.identifier', next: '@popall' },
  44. '@default': 'key.identifier'
  45. }
  46. }
  47. ],
  48. [
  49. /@str+\s*/,
  50. {
  51. cases: {
  52. '@eos': { token: 'string', next: '@popall' },
  53. '@default': 'string'
  54. }
  55. }
  56. ]
  57. ],
  58. comment: [
  59. [
  60. /#.*$/,
  61. {
  62. cases: {
  63. '@eos': { token: 'comment', next: '@popall' }
  64. }
  65. }
  66. ]
  67. ]
  68. }
  69. };