Module macro.clexer

A C lexical scanner using LPeg.

= CREDITS = based on the C lexer in Peter Odding's lua-lxsh

Functions

scan_c (input, name) get a token iterator from a source containing Lua code.


Functions

scan_c (input, name)
get a token iterator from a source containing Lua code. S is the source - can be a string or a file-like object (i.e. read() returns line) Note that this token iterator includes spaces and comments, and does not convert string and number tokens - so e.g. a string token is quoted and a number token is an unconverted string.

Parameters:

  • input:
  • name: