5.0.1 • Published 4 years ago

pug-lexer v5.0.1

Weekly downloads
1,168,703
License
MIT
Repository
github
Last release
4 years ago

pug-lexer

The pug lexer. This module is responsible for taking a string and converting it into an array of tokens.

Build Status Dependencies Status DevDependencies Status NPM version Coverage Status

Installation

npm install pug-lexer

Usage

var lex = require('pug-lexer');

lex(str, options)

Convert Pug string to an array of tokens.

options can contain the following properties:

  • filename (string): The name of the Pug file; it is used in error handling if provided.
  • plugins (array): An array of plugins, in the order they should be applied.
console.log(JSON.stringify(lex('div(data-foo="bar")', {filename: 'my-file.pug'}), null, '  '))
[
  {
    "type": "tag",
    "line": 1,
    "val": "div",
    "selfClosing": false
  },
  {
    "type": "attrs",
    "line": 1,
    "attrs": [
      {
        "name": "data-foo",
        "val": "\"bar\"",
        "escaped": true
      }
    ]
  },
  {
    "type": "eos",
    "line": 1
  }
]

new lex.Lexer(str, options)

Constructor for a Lexer class. This is not meant to be used directly unless you know what you are doing.

options may contain the following properties:

  • filename (string): The name of the Pug file; it is used in error handling if provided.
  • interpolated (boolean): if the Lexer is created as a child lexer for inline tag interpolation (e.g. #[p Hello]). Defaults to false.
  • startingLine (integer): the real line number of the first line in the input. It is also used for inline tag interpolation. Defaults to 1.
  • plugins (array): An array of plugins, in the order they should be applied.

License

MIT

pug@olivervorasai/sliderfalling42-butterfly-envelopefalling42-butterfly-wowjsasterjs@everything-registry/sub-chunk-2492teapackage-tatespoorman297then-pugvolar-service-pugvscode-pug-languageservicevlsvue-eslint-parser-template-tokenizer-pug@dinert/component@principalstudio/principal-purgecss-extractorjaidejade2scriptjsxgettextjungledrumstylinpug@amory/transform-react-pug@amory/react-pug@astql/pug.pug@bitfirer/vue-qriously@brydget/restifyyi18n-corezliq-pug@hazyflame/vue-jitsi-meet@fishx/view-dsl-lsp@grantstrachan/npm-packaging-test@infinitebrahmanuniverse/nolb-pug@ladjs/pug@ladjs/pug-lint@linthtml/linthtml-pug@mydiem/aot-fixer-pug@markuplint/pug-parser@emitty/language-pug@kocan-plugins/pug@kocan/pug-language-service@i18never/parse@i18never/preprocess@prettier/plugin-pug@ptb/transform-react-pug@scoutgg/fn-pug@object-studio/react-native-web@seletskiy/plugin-pugmolossermitroofann-pugmi18n-coreparcel-plugin-pugscegrpugrcs-corepug-uses-variablespug-vdompugjs-angular-language-serverpugjs-angular-templatepugjs-language-servicenessapretty-plugin-pug-gprettier-plugin-pugpug-stylekit-webpack-pluginpug-react-compilerpug-react-loaderpug-pack-loaderpug-package-loaderpug-cachepug-code-blockpug-customer-parserpug-dependenciespug-dependencypug-asyncpug-lintpug-fmtpug-html-vuepug-inheritancepug-layoutpug-element-loaderpug2tsxpug3-ast-loadersi18n-coreimport-bem-webpack-pluginicons-vue-testgulp-bemblockshtml-typingsio-ng2-aot-fixer-puglocal-scoped-scss-with-pug-loader@uiengine/adapter-pug@unisharp/pug-inheritance@virtualpatterns/mablung-check-dependency@virtualpatterns/nessa@volar-plugins/pug@volar/pug-language-service@zalastax/nolb-pugangular-aot-fixer-pugalisselisss-lab3aidobabel-plugin-react-pugbabel-plugin-transform-react-pugbabel-plugin-transform-react-pug-coffeebabel-plugin-transform-react-pug-coffee7
5.0.1

4 years ago

5.0.1-canary-8

4 years ago

5.0.1-canary-9

4 years ago

5.0.1-canary-7

4 years ago

5.0.1-canary-10

4 years ago

5.0.0

5 years ago

5.0.0-canary-2

5 years ago

5.0.0-canary-1

5 years ago

4.1.0

6 years ago

4.0.0

7 years ago

3.1.0

8 years ago

3.0.0

8 years ago

2.3.2

8 years ago

2.3.1

8 years ago

2.3.0

9 years ago

2.2.2

9 years ago

2.2.1

9 years ago

2.2.0

9 years ago

2.1.0

9 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.2.0

9 years ago

1.0.1

9 years ago

1.0.0

10 years ago

0.0.0

10 years ago