@zackad/prettier-plugin-twig 0.15.0 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zackad/prettier-plugin-twig",
3
- "version": "0.15.0",
3
+ "version": "0.15.2",
4
4
  "description": "Prettier Plugin for Twig",
5
5
  "repository": {
6
6
  "type": "git",
@@ -69,6 +69,14 @@ export const BinaryOrExpression = createBinaryOperatorNode({
69
69
  precedence: 10,
70
70
  associativity: LEFT
71
71
  });
72
+
73
+ export const BinaryXorExpression = createBinaryOperatorNode({
74
+ text: "xor",
75
+ type: "BinaryXorExpression",
76
+ precedence: 12,
77
+ associativity: LEFT
78
+ });
79
+
72
80
  export const BinaryAndExpression = createBinaryOperatorNode({
73
81
  text: "and",
74
82
  type: "BinaryAndExpression",
@@ -354,7 +354,10 @@ export default class Lexer {
354
354
  return this.createToken(TokenTypes.ARROW, pos);
355
355
  }
356
356
  default: {
357
- if (isDigit(input.lac(0))) {
357
+ if (
358
+ isDigit(input.lac(0)) ||
359
+ (input.la(0) === "-" && isDigit(input.lac(1)))
360
+ ) {
358
361
  input.next();
359
362
  return this.matchNumber(pos);
360
363
  }
@@ -601,6 +604,11 @@ export default class Lexer {
601
604
  matchNumber(pos) {
602
605
  const input = this.input;
603
606
  let c;
607
+
608
+ // check for negative number
609
+ if (input.la(0) === "-" && isDigit(input.lac(1))) {
610
+ input.next();
611
+ }
604
612
  while ((c = input.lac(0)) !== EOF) {
605
613
  if (!isDigit(c)) {
606
614
  break;