pug-lexer

WebJar for pug-lexer

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

pug-lexer
Last Version

Last Version

4.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

pug-lexer
WebJar for pug-lexer
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/pugjs/pug-lexer

Download pug-lexer

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/pug-lexer/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>pug-lexer</artifactId>
    <version>4.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/pug-lexer/
implementation 'org.webjars.npm:pug-lexer:4.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/pug-lexer/
implementation ("org.webjars.npm:pug-lexer:4.0.0")
'org.webjars.npm:pug-lexer:jar:4.0.0'
<dependency org="org.webjars.npm" name="pug-lexer" rev="4.0.0">
  <artifact name="pug-lexer" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='pug-lexer', version='4.0.0')
)
libraryDependencies += "org.webjars.npm" % "pug-lexer" % "4.0.0"
[org.webjars.npm/pug-lexer "4.0.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : character-parser jar [2.1.1,3)
org.webjars.npm : is-expression jar [3.0.0,4)
org.webjars.npm : pug-error jar [1.3.2,2)

Project Modules

There are no modules declared in this project.

pug-lexer

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

Build Status Dependency 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

org.webjars.npm

Pug

Versions

Version
4.0.0