Skip to content

Commit

Permalink
Update build and add missing definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 committed Sep 7, 2017
1 parent 89c2c6a commit 2a615e6
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 18 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ This project contains experimental version of parser ftl to ast tree
- `#stop`
- `#t`
- `#visit`
- `#noparse`, `#noParse`
2 changes: 2 additions & 0 deletions index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "freemarker",
"name": "freemarker-parser",
"version": "1.0.0",
"description": "Freemarker Parser is a javascript implementation of the Freemarker",
"scripts": {
Expand All @@ -23,6 +23,7 @@
},
"keywords": [
"freemarker",
"parser",
"js",
"ast",
"ftl"
Expand Down
2 changes: 2 additions & 0 deletions src/Names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,6 @@ export const directives : IDirectivesTypes = {
break: NodeNames.Break,
// t: 't',
// visit: 'visit',
noparse: NodeNames.Text,
noParse: NodeNames.Text,
}
1 change: 1 addition & 0 deletions src/Tokenizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ export class Tokenizer {
while (this.cursorPos <= this.template.length) {
const ch = this.charCodeAt(this.cursorPos)
const char = this.charAt(this.cursorPos)
// TODO: fix me "${"${""}"}"
if (char === '"') {
inString = !inString
}
Expand Down
36 changes: 20 additions & 16 deletions typings/line-column.d.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
interface LineColumnType {
line : number
col : number
}
interface LineColumnOptions {
origin : number
}

declare class line_column {
constructor(str: string, options: LineColumnOptions);
declare module 'line-column' {
export interface ILineColumnType {
line : number
col : number
}

fromIndex(index: number): LineColumnType | null;
toIndex(line: number, column: number): number | -1;
}
export interface ILineColumnOptions {
origin? : number
}

declare function lineColumn(name: string): line_column;
export interface ItoIndexObject {
line : number
col? : number
column? : number
}

declare module 'line-column' {
export default lineColumn
export default interface ILineColumnFinder {
(str : string, options? : ILineColumnOptions | number) : ILineColumnFinder
new (str : string, options? : ILineColumnOptions | number)
fromIndex (index : number) : ILineColumnType | null
toIndex (line : number, column : number) : number | -1
toIndex (options : number[] | ItoIndexObject) : number | -1
}
}

0 comments on commit 2a615e6

Please sign in to comment.