broomhlda 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hl/lexers/yaml.ay +38 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5841f61e93c8c3411d7941da19ccf65387695007
4
- data.tar.gz: ecc7612997c65556d44c23a7b8b581e6a5c7ffa9
3
+ metadata.gz: 8e4e015b3a863bdd7bb60b140a07cdfe99bb0c3f
4
+ data.tar.gz: 00e951c27d40c290ee1d939691cd8cb84b1fb8b2
5
5
  SHA512:
6
- metadata.gz: 3dc935718a23fe89c7c9e1ce166d70679098836c14afd10d86a90d16fed739dd67f2e949af795900503521ca5eadbd2881db32b98297b6af719e932f2fefcb52
7
- data.tar.gz: 2a8f6a62d8005ba9404b69983c4cd8e1aca320056d2d60ce298fce3a8a8474de2f2283081d36ab5976646a03a2f7462bb73ca6da4dde425c21007179d18d3a9c
6
+ metadata.gz: 168266efc868ba4abb4f9eb77b225490187811eedfd1b18855bd15cf9071da8cc0b90186837ac9cf85fb4e11c5a3f4821b45d60d66c11d6232307db108f716b9
7
+ data.tar.gz: 732bc42d202a80811e42d9458d7d6244dcefc93d8b048a42f10fbc981f2765ec4379aed279354e1c10f6fad4ca10ee817e748451d7015477ec7912901b999ffa
@@ -131,7 +131,7 @@ lexer = lexer:
131
131
  -- whitespaces separating tokens
132
132
  r"[ ]+" is(text)
133
133
 
134
- -- tags, anchors and aliases,
134
+ -- tags, anchors and aliases
135
135
  any-of(descriptors)
136
136
 
137
137
  -- block collections and scalars
@@ -140,6 +140,9 @@ lexer = lexer:
140
140
  -- flow collections and quoted scalars
141
141
  any-of(flow-nodes)
142
142
 
143
+ -- constant literals (null, bool, numeric)
144
+ any-of(constants)
145
+
143
146
  -- a plain scalar
144
147
  r"(?=[^\s?:,\[\]{}#&*!|>'\"%@`-]|[?:-]\S)" is(name.variable) => plain-scalar-in-block-context
145
148
 
@@ -225,6 +228,9 @@ lexer = lexer:
225
228
  -- nested collections and quoted scalars
226
229
  any-of(flow-nodes)
227
230
 
231
+ -- constant literals (null, bool, numeric)
232
+ any-of(constants)
233
+
228
234
  -- a plain scalar
229
235
  r"(?=[^\s?:,\[\]{}#&*!|>'\"%@`])" is(name.variable) => plain-scalar-in-flow-context
230
236
 
@@ -321,8 +327,6 @@ lexer = lexer:
321
327
  -- other whitespaces are a part of the value
322
328
  r"[ ]+" is(literal.scalar.plain)
323
329
 
324
- any-of(constants)
325
-
326
330
  -- regular non-whitespace characters acting as a key
327
331
  r"(?::(?!\s)|[^\s:])+(?=:( |$))" is(name.property)
328
332
 
@@ -347,8 +351,6 @@ lexer = lexer:
347
351
  -- other whitespaces are a part of the value
348
352
  r"[ ]+" is(name.variable)
349
353
 
350
- any-of(constants)
351
-
352
354
  -- regular non-whitespace characters acting as a key
353
355
  r"[^\s,:?\[\]{}]+(?=:( |$))" is(name.property)
354
356
 
@@ -357,8 +359,38 @@ lexer = lexer:
357
359
 
358
360
 
359
361
  lex(constants):
362
+ -- null
360
363
  r"\b(~|null|Null|NULL)\b" is(keyword.constant)
361
- r"\b(y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)\b" is(keyword.constant)
364
+
365
+ -- true/false
366
+ r"\b(yes|Yes|YES|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)\b" is(keyword.constant)
367
+
368
+ -- base 60 floats (yes really)
369
+ r"[\-+]?[0-9][0-9_]*(:[0-5]?[0-9])+\.[0-9_]*(?![.0-9_])" is(literal.number.float)
370
+
371
+ -- base 10 floats
372
+ r"[\-+]?([0-9][0-9_]*)?\.[0-9]+([eE][-+][0-9]+)?(?![.0-9_])" is(literal.number.float)
373
+
374
+ -- infinity
375
+ r"[\-+]?\.(inf|Inf|INF)\b" is(literal.number.float)
376
+
377
+ -- not a number
378
+ r"\.(nan|NaN|NAN)\b" is(literal.number.float)
379
+
380
+ -- base 2 integers
381
+ r"[\-+]?0b[0-1_]+(?![.0-9_])" is(literal.number.integer)
382
+
383
+ -- base 60 integers (yes really)
384
+ r"[\-+]?[1-9][0-9_]*(:[0-5]?[0-9])+(?![.0-9_])" is(literal.number.integer)
385
+
386
+ -- base 16 integers
387
+ r"[\-+]?0x[0-9a-fA-F_]+(?![.0-9_])" is(literal.number.hex)
388
+
389
+ -- base 8 integers
390
+ r"[\-+]?0[0-7_]+(?![.0-9_])" is(literal.number.oct)
391
+
392
+ -- base 10 integers
393
+ r"[\-+]?(0|[1-9][0-9_]*)(?![.0-9_])" is(literal.number.integer)
362
394
 
363
395
 
364
396
  const-set(.Lexer, lexer)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: broomhlda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Suraci